27 #ifndef MAT_UTILS_HEADER
28 #define MAT_UTILS_HEADER
33 template<
typename Tmatrix,
typename Treal>
40 assert(
A.get_nrows() ==
B.get_nrows() );
44 return Tmatrix::frob_diff(
A,
B);
47 Treal & euclUpperBound)
const {
48 Treal frobTmp =
frob();
50 euclUpperBound = frobTmp;
57 template<
typename Tvector>
60 tmp = (Treal)-1.0 * B * x;
61 y = (Treal)1.0 * A * x;
62 y += (Treal)1.0 * tmp;
68 template<
typename Tmatrix,
typename Treal>
78 Treal & euclUpperBound)
const {
79 Treal frobA = A.frob();
81 euclUpperBound = frobA * frobA;
85 template<
typename Tvector>
96 template<
typename Tmatrix,
typename Tmatrix2,
typename Treal>
103 assert(
A.get_nrows() ==
Z.get_nrows() );
104 return A.get_nrows();
107 Treal & euclUpperBound)
const {
108 Treal frobA =
A.frob();
109 Treal frobZ =
Z.frob();
111 euclUpperBound = frobA * frobZ * frobZ;
118 void matVecProd(VectorType & y, VectorType
const & x)
const {
121 y = (Treal)1.0 * A * tmp;
127 template<
typename Tmatrix,
typename Tmatrix2,
typename Treal>
134 return E.get_ncols();
137 Treal & euclUpperBound)
const {
138 Treal frobA =
A.frob();
139 Treal frobZ =
Zt.frob();
140 Treal frobE =
E.frob();
142 euclUpperBound = frobA * frobE * frobE + 2 * frobA * frobE * frobZ;
152 : A(A_), Zt(Z_), E(E_) {}
153 void matVecProd(VectorType & y, VectorType
const & x)
const {
157 y = (Treal)-1.0 * A * tmp;
163 tmp1 = (Treal)1.0 * A * tmp;
165 y += (Treal)1.0 * tmp1;
169 tmp1 = (Treal)1.0 * A * tmp;
171 y += (Treal)1.0 * tmp1;
TripleMatrix(Tmatrix const &A_, Tmatrix2 const &Z_)
Definition: mat_utils.h:116
Tmatrix const & B
Definition: mat_utils.h:54
int get_nrows() const
Definition: mat_utils.h:92
void matVecProd(Tvector &y, Tvector const &x) const
Definition: mat_utils.h:58
DiffMatrix(Tmatrix const &A_, Tmatrix const &B_)
Definition: mat_utils.h:55
void matVecProd(Tvector &y, Tvector const &x) const
Definition: mat_utils.h:86
Proxy structs used by the matrix API.
Tmatrix::VectorType VectorType
Definition: mat_utils.h:70
Tmatrix2 const & Zt
Definition: mat_utils.h:146
Tmatrix::VectorType VectorType
Definition: mat_utils.h:35
Tmatrix2 const & Z
Definition: mat_utils.h:115
int get_nrows() const
Definition: mat_utils.h:39
void matVecProd(VectorType &y, VectorType const &x) const
Definition: mat_utils.h:118
int get_nrows() const
Definition: mat_utils.h:133
void getCols(SizesAndBlocks &colsCopy) const
Definition: mat_utils.h:74
Definition: allocate.cc:30
Describes dimensions of matrix and its blocks on all levels.
Definition: SizesAndBlocks.h:37
CongrTransErrorMatrix(Tmatrix const &A_, Tmatrix2 const &Z_, Tmatrix2 const &E_)
Definition: mat_utils.h:149
void quickEuclBounds(Treal &euclLowerBound, Treal &euclUpperBound) const
Definition: mat_utils.h:136
Definition: mat_utils.h:97
Tmatrix const & A
Definition: mat_utils.h:114
void getCols(SizesAndBlocks &colsCopy) const
Definition: mat_utils.h:36
Tmatrix const & A
Definition: mat_utils.h:53
Definition: mat_utils.h:128
void matVecProd(VectorType &y, VectorType const &x) const
Definition: mat_utils.h:153
void quickEuclBounds(Treal &euclLowerBound, Treal &euclUpperBound) const
Definition: mat_utils.h:106
Definition: mat_utils.h:69
Tmatrix2 const & E
Definition: mat_utils.h:147
Definition: mat_utils.h:34
void getCols(SizesAndBlocks &colsCopy) const
Definition: mat_utils.h:130
Tmatrix const & A
Definition: mat_utils.h:71
Treal frob() const
Definition: mat_utils.h:43
Tmatrix::VectorType VectorType
Definition: mat_utils.h:129
Tmatrix::VectorType VectorType
Definition: mat_utils.h:98
void quickEuclBounds(Treal &euclLowerBound, Treal &euclUpperBound) const
Definition: mat_utils.h:77
Tmatrix const & A
Definition: mat_utils.h:145
void quickEuclBounds(Treal &euclLowerBound, Treal &euclUpperBound) const
Definition: mat_utils.h:46
Xtrans< TX > transpose(TX const &A)
Transposition.
Definition: matrix_proxy.h:129
int get_nrows() const
Definition: mat_utils.h:102
ATAMatrix(Tmatrix const &A_)
Definition: mat_utils.h:72
Treal template_blas_sqrt(Treal x)
void getCols(SizesAndBlocks &colsCopy) const
Definition: mat_utils.h:99