28 #ifndef _math_scmat_matrix_h
29 #define _math_scmat_matrix_h
36 #include <math/scmat/abstract.h>
42 class SymmSCMatrixdouble;
43 class DiagSCMatrixdouble;
45 class SCMatrixBlockIter;
46 class SCMatrixRectBlock;
47 class SCMatrixLTriBlock;
48 class SCMatrixDiagBlock;
49 class SCVectorSimpleBlock;
52 class RefSymmSCMatrix;
94 void set_element(
int i,
double val)
const;
95 void accumulate_element(
int i,
double val)
const;
96 double get_element(
int)
const;
102 double maxabs()
const;
105 void normalize()
const;
106 void randomize()
const;
108 void assign(
double val)
const;
109 void assign(
const double* v)
const;
110 void convert(
double*)
const;
111 void scale(
double val)
const;
121 void print(std::ostream&out)
const;
122 void print(
const char*title=0,
123 std::ostream&out=
ExEnv::out0(),
int precision=10)
const;
186 RefSCMatrix get_subblock(
int br,
int er,
int bc,
int ec);
187 void assign_subblock(
const RefSCMatrix&,
int br,
int er,
int bc,
int ec,
188 int source_br = 0,
int source_bc = 0);
189 void accumulate_subblock(
const RefSCMatrix&,
int,
int,
int,
int,
190 int source_br = 0,
int source_bc = 0);
195 void accumulate_row(
const RefSCVector&,
int)
const;
196 void accumulate_column(
const RefSCVector&,
int)
const;
201 void scale(
double)
const;
202 void randomize()
const;
203 void assign(
double)
const;
204 void assign(
const double*)
const;
205 void assign(
const double**)
const;
206 void convert(
double*)
const;
207 void convert(
double**)
const;
222 void set_element(
int,
int,
double)
const;
223 void accumulate_element(
int,
int,
double)
const;
224 double get_element(
int,
int)
const;
225 void print(std::ostream&)
const;
226 void print(
const char*title=0,
228 double trace()
const;
299 void set_element(
int,
int,
double)
const;
300 void accumulate_element(
int,
int,
double)
const;
301 double get_element(
int,
int)
const;
303 RefSCMatrix get_subblock(
int br,
int er,
int bc,
int ec);
305 void assign_subblock(
const RefSCMatrix&,
int br,
int er,
int bc,
int ec);
307 void accumulate_subblock(
const RefSCMatrix&,
int,
int,
int,
int);
313 void accumulate_symmetric_outer_product(
const RefSCVector&)
const;
315 void accumulate_symmetric_product(
const RefSCMatrix&)
const;
316 void accumulate_symmetric_sum(
const RefSCMatrix&)
const;
319 SCMatrix::Transform = SCMatrix::NormalTransform)
const;
321 SCMatrix::Transform = SCMatrix::NormalTransform)
const;
325 void randomize()
const;
327 void scale(
double)
const;
328 void assign(
double)
const;
329 void assign(
const double*)
const;
330 void assign(
const double**)
const;
331 void convert(
double*)
const;
332 void convert(
double**)
const;
340 double trace()
const;
344 void print(std::ostream&)
const;
345 void print(
const char*title=0,
415 void set_element(
int,
double)
const;
416 void accumulate_element(
int,
double)
const;
417 double get_element(
int)
const;
418 void randomize()
const;
420 void scale(
double)
const;
421 void assign(
double)
const;
422 void assign(
const double*)
const;
423 void convert(
double*)
const;
434 double trace()
const;
435 void print(std::ostream&)
const;
436 void print(
const char*title=0,
467 double operator=(
double a);
484 double operator=(
double a);
501 double operator=(
double a);
518 double operator=(
double a);
526 #ifdef INLINE_FUNCTIONS
527 #include <math/scmat/matrix_i.h>
RefSCMatrix i() const
Return the inverse of this.
double determ() const
Returns the determinant of the referenced matrix.
RefSCMatrix operator+(const RefSCMatrix &) const
Matrix addition.
void diagonalize(const RefDiagSCMatrix &eigvals, const RefSCMatrix &eigvecs) const
Sets eigvals to the eigenvalues and eigvecs to the eigenvalues and eigenvectors of the referenced mat...
RefDiagSCMatrix i() const
Return the inverse of this.
The SCVector class is the abstract base class for double valued vectors.
Definition: abstract.h:97
void restore(StateIn &)
Restores the matrix from StateIn object. The matrix must have been initialized already.
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:261
RefSymmSCMatrix i() const
Return the inverse of this.
int nblock() const
If this matrix is blocked return the number of blocks.
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
RefSymmSCMatrix operator+(const RefSymmSCMatrix &) const
Matrix addition and subtraction.
A template class that maintains references counts.
Definition: ref.h:332
RefDiagSCMatrix clone() const
These call the SCMatrix members of the same name after checking for references to 0.
RefSCMatrix clone() const
These call the SCMatrix members of the same name after checking for references to 0.
int nblock() const
If this matrix is blocked return the number of blocks.
RefDiagSCMatrix block(int i) const
If this matrix is blocked return block i.
SCVector & operator*() const
Returns a C++ reference to the reference counted object.
Definition: ref.h:390
RefSCMatrix eigvecs() const
Returns the eigenvectors of the reference matrix.
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition: matrix.h:380
RefSymmSCMatrix clone() const
These call the SCMatrix members of the same name after checking for references to 0.
The SymmSCMatrix class is the abstract base class for diagonal double valued matrices.
Definition: abstract.h:503
double solve_lin(const RefSCVector &v) const
Solves this x = v.
RefSCVector()
Initializes the vector pointer to 0.
double solve_lin(const RefSCVector &) const
Solves this x = v.
RefSCVector & operator=(SCVector *v)
Make this refer to v.
Restores objects that derive from SavableState.
Definition: statein.h:70
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:156
SCMatrixdouble operator()(int i, int j) const
Assign and examine matrix elements.
RefDiagSCMatrix eigvals() const
Returns the eigenvalues of the reference matrix.
RefSymmSCMatrix block(int i) const
If this matrix is blocked return block i.
void restore(StateIn &)
Restores the matrix from StateIn object. The matrix must have been initialized already.
RefSCMatrix operator-(const RefSCMatrix &) const
Matrix subtraction.
RefSymmSCMatrix & operator=(SymmSCMatrix *m)
Make this refer to m.
void restore(StateIn &)
Restores the matrix from StateIn object. The matrix must have been initialized already.
RefDiagSCMatrix()
Initializes the matrix pointer to 0.
RefDiagSCMatrix operator+(const RefDiagSCMatrix &) const
Matrix addition and subtraction.
RefSCMatrix()
Initializes the matrix pointer to 0.
void svd(const RefSCMatrix &U, const RefDiagSCMatrix &sigma, const RefSCMatrix &V)
Compute the singular value decomposition, this = U sigma V.t().
int nblock() const
If this matrix is blocked return the number of blocks.
SCVectordouble operator()(int) const
Return an l-value that can be used to assign or retrieve an element.
RefDiagSCMatrix gi() const
Return the generalized inverse of this.
void accumulate_transform(const RefSCMatrix &a, const RefSymmSCMatrix &b, SCMatrix::Transform=SCMatrix::NormalTransform) const
Add a * b * a.t() to this.
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
RefSymmSCMatrix symmetric_outer_product() const
The outer product of this with itself is a symmetric matrix.
Serializes objects that derive from SavableState.
Definition: stateout.h:61
RefSCMatrix & operator=(SCMatrix *m)
Make this refer to m.
RefSCMatrix t() const
Return the transpose of this.
The SymmSCMatrix class is the abstract base class for symmetric double valued matrices.
Definition: abstract.h:364
DiagSCMatrixdouble operator()(int i) const
Assign and examine matrix elements.
SCVectordouble operator[](int) const
Return an l-value that can be used to assign or retrieve an element.
static std::ostream & out0()
Return an ostream that writes from node 0.
RefSCMatrix gi() const
Return the generalized inverse of this.
double determ() const
Returns the determinant of the referenced matrix.
The SCMatrix class is the abstract base class for general double valued n by m matrices.
Definition: abstract.h:195
SymmSCMatrixdouble operator()(int i, int j) const
Assign and examine matrix elements.
RefSCMatrix outer_product(const RefSCVector &v) const
Return the outer product between this and v.
RefDiagSCMatrix & operator=(DiagSCMatrix *m)
Make this refer to m.
RefSCVector operator+(const RefSCVector &a) const
Add two vectors.
double determ() const
Returns the determinant of the referenced matrix.
RefSCMatrix block(int i) const
If this matrix is blocked return block i.
void restore(StateIn &)
Restores the matrix from StateIn object. The vector must have been initialized already.
RefSymmSCMatrix()
Initializes the matrix pointer to 0.
RefSymmSCMatrix gi() const
Return the generalized inverse of this.
RefSCVector operator-(const RefSCVector &a) const
Subtract two vectors.
Generated at Sun Jan 26 2020 23:33:04 for MPQC
2.3.1 using the documentation package Doxygen
1.8.16.