You are here:
Concepts
>
Concepts Web
>
Class documentation
Class documentation of Concepts
Loading...
Searching...
No Matches
basics
arrays.hh
Go to the documentation of this file.
1
7
#ifndef arrays_hh
8
#define arrays_hh
9
10
#include "
toolbox/array.hh
"
11
12
namespace
concepts
{
13
14
// ****************************************************** ArrayDeterminant **
15
20
template
<
class
F,
int
dim>
21
class
ArrayDeterminant
:
public
Array
<F> {
22
public
:
23
ArrayDeterminant
(
const
concepts::Array
<
concepts::Mapping<F,dim>
>*
array
) :
24
Array<F>
(
array
?
array
->size() : 0) {
25
if
(
array
) {
26
F*
foo
=
data_
;
27
const
concepts::Mapping<F,dim>
* matrix =
28
(
const
concepts::Mapping<F,dim>
*)*
array
;
29
for
(
uint
i =
array
->size(); i--;)
30
*
foo
++ = matrix++->determinant();
31
}
32
}
33
};
34
35
// **************************************************** ArrayMatrixInverse **
36
41
template
<
class
F,
int
dim>
42
class
ArrayMatrixInverse
:
public
Array
<concepts::Mapping<F,dim> > {
43
public
:
44
ArrayMatrixInverse
45
(
const
concepts::Array
<
concepts::Mapping<F,dim>
>*
array
) :
46
Array<concepts::Mapping<F,dim>
>(
array
?
array
->size() : 0) {
47
if
(
array
) {
48
concepts::Mapping<F,dim>
*
foo
=
data_
;
49
const
concepts::Mapping<F,dim>
* matrix =
50
(
const
concepts::Mapping<F,dim>
*)*
array
;
51
for
(
uint
i =
array
->size(); i--;)
52
*
foo
++ = matrix++->inverse();
53
}
54
}
55
};
56
57
// ************************************************** ArrayMatrixTranspose **
58
64
template
<
class
F,
int
dim>
65
class
ArrayMatrixTranspose
:
public
Array
<concepts::Mapping<F, dim> > {
66
public
:
67
ArrayMatrixTranspose
68
(
const
concepts::Array
<
concepts::Mapping<F,dim>
>*
array
) :
69
Array<concepts::Mapping<F,dim>
>(
array
?
array
->size() : 0) {
70
if
(
array
) {
71
concepts::Mapping<F,dim>
*
foo
=
data_
;
72
const
concepts::Mapping<F,dim>
* matrix =
73
(
const
concepts::Mapping<F,dim>
*)*
array
;
74
for
(
uint
i =
array
->size(); i--;)
75
*
foo
++ = matrix++->transpose();
76
}
77
}
78
};
79
80
// ******************************************************* ArrayReciprocal **
81
86
template
<
class
F>
87
class
ArrayReciprocal
:
public
Array
<F> {
88
public
:
89
ArrayReciprocal
(
const
concepts::Array<F>
*
array
) :
90
Array<F>
(
array
?
array
->size() : 0) {
91
if
(
array
) {
92
F*
foo
=
data_
;
const
F* a = *
array
;
93
for
(
uint
i =
array
->size(); i--;)
94
*
foo
++ = 1.0 / *a++;
95
}
96
}
97
};
98
99
// ******************************************************* ArrayGramMatrix **
100
106
template
<
class
F,
int
dim>
107
class
ArrayGramMatrix
:
public
Array
<concepts::Mapping<F,dim> > {
108
public
:
109
ArrayGramMatrix
(
const
concepts::Array
<
concepts::Mapping<F,dim>
>&
array
) :
110
Array<concepts::Mapping<F,dim>
>(
array
.size()) {
111
concepts::Mapping<F,dim>
*
foo
=
data_
, *matrix = *
array
;
112
for
(
uint
i =
array
.size(); i--;)
113
*
foo
++ = *matrix * matrix++->transpose();
114
}
115
};
116
117
}
// namespace concepts
118
119
#endif
array.hh
concepts::ArrayDeterminant
Definition
arrays.hh:21
concepts::ArrayGramMatrix
Definition
arrays.hh:107
concepts::ArrayMatrixInverse
Definition
arrays.hh:42
concepts::ArrayMatrixTranspose
Definition
arrays.hh:65
concepts::ArrayReciprocal
Definition
arrays.hh:87
concepts::Array
Definition
array.hh:46
concepts::Array::data_
F * data_
Data.
Definition
array.hh:273
concepts::Mapping
Definition
vectorsMatrices.hh:313
concepts
Definition
pml_formula.h:16
concepts::makeSet
Set< F > makeSet(uint n, const F &first,...)
Definition
set.hh:320
Generated on Wed Sep 13 2023 21:06:17 for Concepts by
1.9.8