36 #ifndef MAT_UTILS_HEADER 37 #define MAT_UTILS_HEADER 42 template<
typename Tmatrix,
typename Treal>
49 assert(
A.get_nrows() ==
B.get_nrows() );
53 return Tmatrix::frob_diff(
A,
B);
56 Treal & euclUpperBound)
const {
57 Treal frobTmp =
frob();
59 euclUpperBound = frobTmp;
66 template<
typename Tvector>
69 tmp = (Treal)-1.0 *
B * x;
70 y = (Treal)1.0 *
A * x;
71 y += (Treal)1.0 * tmp;
77 template<
typename Tmatrix,
typename Treal>
87 Treal & euclUpperBound)
const {
88 Treal frobA =
A.frob();
90 euclUpperBound = frobA * frobA;
94 template<
typename Tvector>
105 template<
typename Tmatrix,
typename Tmatrix2,
typename Treal>
112 assert(
A.get_nrows() ==
Z.get_nrows() );
113 return A.get_nrows();
116 Treal & euclUpperBound)
const {
117 Treal frobA =
A.frob();
118 Treal frobZ =
Z.frob();
120 euclUpperBound = frobA * frobZ * frobZ;
130 y = (Treal)1.0 *
A * tmp;
136 template<
typename Tmatrix,
typename Tmatrix2,
typename Treal>
143 return E.get_ncols();
146 Treal & euclUpperBound)
const {
147 Treal frobA =
A.frob();
148 Treal frobZ =
Zt.frob();
149 Treal frobE =
E.frob();
151 euclUpperBound = frobA * frobE * frobE + 2 * frobA * frobE * frobZ;
161 :
A(A_),
Zt(Z_),
E(E_) {}
166 y = (Treal)-1.0 *
A * tmp;
172 tmp1 = (Treal)1.0 *
A * tmp;
174 y += (Treal)1.0 * tmp1;
178 tmp1 = (Treal)1.0 *
A * tmp;
180 y += (Treal)1.0 * tmp1;
TripleMatrix(Tmatrix const &A_, Tmatrix2 const &Z_)
Definition: mat_utils.h:125
Tmatrix const & B
Definition: mat_utils.h:63
void quickEuclBounds(Treal &euclLowerBound, Treal &euclUpperBound) const
Definition: mat_utils.h:55
DiffMatrix(Tmatrix const &A_, Tmatrix const &B_)
Definition: mat_utils.h:64
Proxy structs used by the matrix API.
Tmatrix::VectorType VectorType
Definition: mat_utils.h:79
void quickEuclBounds(Treal &euclLowerBound, Treal &euclUpperBound) const
Definition: mat_utils.h:145
Tmatrix2 const & Zt
Definition: mat_utils.h:155
void matVecProd(VectorType &y, VectorType const &x) const
Definition: mat_utils.h:127
Tmatrix::VectorType VectorType
Definition: mat_utils.h:44
void matVecProd(Tvector &y, Tvector const &x) const
Definition: mat_utils.h:95
Tmatrix2 const & Z
Definition: mat_utils.h:124
void matVecProd(VectorType &y, VectorType const &x) const
Definition: mat_utils.h:162
Definition: allocate.cc:39
Describes dimensions of matrix and its blocks on all levels.
Definition: SizesAndBlocks.h:45
generalVector VectorType
Definition: GetDensFromFock.cc:62
int get_nrows() const
Definition: mat_utils.h:101
void getCols(SizesAndBlocks &colsCopy) const
Definition: mat_utils.h:108
int get_nrows() const
Definition: mat_utils.h:142
void getCols(SizesAndBlocks &colsCopy) const
Definition: mat_utils.h:139
int get_nrows() const
Definition: mat_utils.h:111
CongrTransErrorMatrix(Tmatrix const &A_, Tmatrix2 const &Z_, Tmatrix2 const &E_)
Definition: mat_utils.h:158
void matVecProd(Tvector &y, Tvector const &x) const
Definition: mat_utils.h:67
void quickEuclBounds(Treal &euclLowerBound, Treal &euclUpperBound) const
Definition: mat_utils.h:86
void quickEuclBounds(Treal &euclLowerBound, Treal &euclUpperBound) const
Definition: mat_utils.h:115
Definition: mat_utils.h:106
Tmatrix const & A
Definition: mat_utils.h:123
Tmatrix const & A
Definition: mat_utils.h:62
Definition: mat_utils.h:137
Definition: mat_utils.h:78
void getCols(SizesAndBlocks &colsCopy) const
Definition: mat_utils.h:45
Tmatrix2 const & E
Definition: mat_utils.h:156
Definition: mat_utils.h:43
Tmatrix const & A
Definition: mat_utils.h:80
Tmatrix::VectorType VectorType
Definition: mat_utils.h:138
int get_nrows() const
Definition: mat_utils.h:48
Tmatrix::VectorType VectorType
Definition: mat_utils.h:107
Tmatrix const & A
Definition: mat_utils.h:154
Treal frob() const
Definition: mat_utils.h:52
Xtrans< TX > transpose(TX const &A)
Transposition.
Definition: matrix_proxy.h:131
ATAMatrix(Tmatrix const &A_)
Definition: mat_utils.h:81
Treal template_blas_sqrt(Treal x)
void getCols(SizesAndBlocks &colsCopy) const
Definition: mat_utils.h:83