28#ifndef _math_scmat_blocked_h
29#define _math_scmat_blocked_h
31#include <math/scmat/block.h>
32#include <math/scmat/elemop.h>
33#include <math/scmat/matrix.h>
34#include <math/scmat/abstract.h>
38class BlockedSCMatrixKit;
41class BlockedSymmSCMatrix;
42class BlockedDiagSCMatrix;
94 void assign_p(
const double*);
112 void vprint(
const char* title=0,
148 void set_element(
int,
int,
double);
149 void accumulate_element(
int,
int,
double);
151 void assign_p(
const double*);
152 void assign_pp(
const double**);
153 void convert_p(
double*)
const;
154 void convert_pp(
double**)
const;
163 void assign_column(
SCVector *v,
int i);
165 void accumulate_column(
SCVector *v,
int i);
187 void convert_accumulate(
SCMatrix*a);
195 void vprint(
const char* title=0,
201 RefSCDimension rowdim(
int)
const;
202 RefSCDimension coldim(
int)
const;
204 RefSCMatrix block(
int);
230 void set_element(
int,
int,
double);
231 void accumulate_element(
int,
int,
double);
236 void assign_p(
const double*);
237 void assign_pp(
const double**);
238 void convert_p(
double*)
const;
239 void convert_pp(
double**)
const;
264 void accumulate_symmetric_outer_product(
SCVector*);
281 void vprint(
const char* title=0,
314 void set_element(
int,
double);
315 void accumulate_element(
int,
double);
331 void vprint(
const char* title=0,
350 void working_on(
int);
351 int current_block()
const;
360 void working_on(
int);
361 int current_block()
const;
370 void working_on(
int);
371 int current_block()
const;
Blocked DiagSCMatrix.
Definition blocked.h:295
double get_element(int) const
Return or modify an element.
double invert_this()
Invert this.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
void save(StateOut &)
Save and restore this in an implementation independent way.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
void gen_invert_this(double condition_number_threshold=1e8)
generalized-invert this.
double trace()
Return the trace.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
void accumulate(const DiagSCMatrix *)
Sum m into this.
double determ_this()
Return the determinant of this. this is overwritten.
BlockedSCMatrixKit is a SCMatrixKit that produces blocked matrices.
Definition blocked.h:45
Ref< SCMatrixKit > subkit_lowest()
same as subkit, but recursive
Definition blocked.h:61
Ref< SCMatrixKit > subkit()
the kit used to implement blocks of the matrices
Definition blocked.h:58
SCMatrix * matrix(const RefSCDimension &, const RefSCDimension &)
Given the dimensions, create matrices or vectors.
Blocked SCMatrix.
Definition blocked.h:126
void schmidt_orthog(SymmSCMatrix *, int)
Schmidt orthogonalize this.
void assign_subblock(SCMatrix *, int, int, int, int, int=0, int=0)
Assign m to a subblock of this.
double get_element(int, int) const
Return or modify an element.
double determ_this()
Return the determinant of this. this is overwritten.
void assign_val(double)
Overridden to implement to assign members.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
void gen_invert_this(double condition_number_threshold=1e8)
generalized-invert this.
void accumulate_outer_product(SCVector *, SCVector *)
Sum into this the products of various vectors or matrices.
SCVector * get_row(int i)
Return a row or column of this.
double invert_this()
Invert this.
void accumulate_subblock(SCMatrix *, int, int, int, int, int=0, int=0)
Sum m into a subblock of this.
void transpose_this()
Transpose this.
void svd_this(SCMatrix *U, DiagSCMatrix *sigma, SCMatrix *V)
Compute the singular value decomposition for this, possibly destroying this.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
void assign_row(SCVector *v, int i)
Assign v to a row or column of this.
double trace()
Return the trace.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
void accumulate(const SCMatrix *)
Sum m into this.
void accumulate_row(SCVector *v, int i)
Sum v to a row or column of this.
void save(StateOut &)
Save and restore this in an implementation independent way.
SCMatrix * get_subblock(int, int, int, int)
Return a subblock of this.
int schmidt_orthog_tol(SymmSCMatrix *, double tol, double *res=0)
Schmidt orthogonalize this.
double scalar_product(SCVector *)
Return the dot product.
void accumulate(const SCMatrix *)
Sum m into this. One of m's dimensions must be 1.
void assign_val(double)
Overridden to implement the assign functions.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
double get_element(int) const
Return the value of element i.
void set_element(int, double)
Set element i to val.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this vector.
void accumulate_element(int, double)
Add val to element i.
void accumulate(const SCVector *)
Sum v into this.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this vector.
void save(StateOut &)
Save and restore this in an implementation independent way.
Blocked SymmSCMatrix.
Definition blocked.h:211
double determ_this()
Return the determinant of this. this is overwritten.
void diagonalize(DiagSCMatrix *, SCMatrix *)
Diagonalize this, placing the eigenvalues in d and the eigenvectors in m.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
double scalar_product(SCVector *)
Return the scalar obtained by multiplying this on the left and right by v.
void accumulate_symmetric_sum(SCMatrix *)
Sum into a + a.t()
void element_op(const Ref< SCElementOp > &)
only applied to the unique elements of this.
void scale(double)
Multiply all elements by val.
void accumulate(const SymmSCMatrix *)
Sum m into this.
void assign_subblock(SCMatrix *, int, int, int, int)
Assign m to a subblock of this.
SCMatrix * get_subblock(int, int, int, int)
Return a subblock of this.
void assign_val(double)
Overridden to implement the assign functions.
void save(StateOut &)
Save and restore this in an implementation independent way.
void accumulate_symmetric_product(SCMatrix *)
Sum into this a * a.t()
double invert_this()
Invert this.
void eigensystem(SymmSCMatrix *S, DiagSCMatrix *e, SCMatrix *V)
like diagonalize(), but with general metric S
void gen_invert_this(double condition_number_threshold=1e8)
generalized-invert this.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
void accumulate_subblock(SCMatrix *, int, int, int, int)
Sum m into a subblock of this.
double get_element(int, int) const
Return or modify an element.
SCVector * get_row(int i)
Return a row of this.
void assign_row(SCVector *v, int i)
Assign v to a row of this.
void accumulate_row(SCVector *v, int i)
Sum v to a row of this.
double trace()
Return the trace.
The SymmSCMatrix class is the abstract base class for diagonal double valued matrices.
Definition abstract.h:555
static std::ostream & out0()
Return an ostream that writes from node 0.
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition matrix.h:389
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition dim.h:152
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition matrix.h:135
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition matrix.h:55
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition matrix.h:265
A template class that maintains references counts.
Definition ref.h:361
T * pointer() const
Returns a pointer the reference counted object.
Definition ref.h:413
The SCDimension class is used to determine the size and blocking of matrices.
Definition dim.h:105
The SCElementOp2 class is very similar to the SCElementOp class except that pairs of blocks are treat...
Definition elemop.h:159
The SCElementOp3 class is very similar to the SCElementOp class except that a triplet of blocks is tr...
Definition elemop.h:181
Objects of class SCElementOp are used to perform operations on the elements of matrices.
Definition elemop.h:94
The SCMatrixKit abstract class acts as a factory for producing matrices.
Definition abstract.h:57
The SCMatrix class is the abstract base class for general double valued n by m matrices.
Definition abstract.h:199
Transform
types of matrix transforms. Only real-valued matrices are assumed.
Definition abstract.h:205
The SCVector class is the abstract base class for double valued vectors.
Definition abstract.h:97
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
The SymmSCMatrix class is the abstract base class for symmetric double valued matrices.
Definition abstract.h:389
Contains all MPQC code up to version 3.
Definition mpqcin.h:14