32 #ifndef _math_scmat_blocked_h 33 #define _math_scmat_blocked_h 35 #include <math/scmat/block.h> 36 #include <math/scmat/elemop.h> 37 #include <math/scmat/matrix.h> 38 #include <math/scmat/abstract.h> 42 class BlockedSCMatrixKit;
43 class BlockedSCVector;
44 class BlockedSCMatrix;
45 class BlockedSymmSCMatrix;
46 class BlockedDiagSCMatrix;
84 void assign_p(
const double*);
102 void vprint(
const char* title=0,
137 void set_element(
int,
int,
double);
138 void accumulate_element(
int,
int,
double);
147 void assign_column(
SCVector *v,
int i);
149 void accumulate_column(
SCVector *v,
int i);
166 void gen_invert_this();
176 void vprint(
const char* title=0,
210 void set_element(
int,
int,
double);
211 void accumulate_element(
int,
int,
double);
230 void gen_invert_this();
236 void accumulate_symmetric_outer_product(
SCVector*);
237 void accumulate_symmetric_product(
SCMatrix*);
240 SCMatrix::Transform = SCMatrix::NormalTransform);
242 SCMatrix::Transform = SCMatrix::NormalTransform);
253 void vprint(
const char* title=0,
285 void set_element(
int,
double);
286 void accumulate_element(
int,
double);
299 void vprint(
const char* title=0,
318 void working_on(
int);
319 int current_block()
const;
328 void working_on(
int);
329 int current_block()
const;
338 void working_on(
int);
339 int current_block()
const;
double trace()
Return the trace.
Definition: blocked.h:191
void accumulate(const SCMatrix *)
Sum m into this.
void save(StateOut &)
Save and restore this in an implementation independent way.
void save(StateOut &)
Save and restore this in an implementation independent way.
double get_element(int, int) const
Return or modify an element.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this vector.
void transpose_this()
Transpose this.
void accumulate_symmetric_sum(SCMatrix *)
Sum into this the products of various vectors or matrices.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition: matrix.h:55
double invert_this()
Invert this.
Serializes objects that derive from SavableState.
Definition: stateout.h:61
void assign_subblock(SCMatrix *, int, int, int, int, int=0, int=0)
Assign m to a subblock of this.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
void diagonalize(DiagSCMatrix *, SCMatrix *)
Diagonalize this, placing the eigenvalues in d and the eigenvectors in m.
The SCMatrix class is the abstract base class for general double valued n by m matrices.
Definition: abstract.h:195
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition: matrix.h:380
double trace()
Return the trace.
void accumulate_subblock(SCMatrix *, int, int, int, int, int=0, int=0)
Sum m into a subblock of this.
void schmidt_orthog(SymmSCMatrix *, int)
Schmidt orthogonalize this.
double invert_this()
Invert this.
A template class that maintains references counts.
Definition: ref.h:332
void assign_val(double)
Overridden to implement to assign members.
double invert_this()
Invert this.
The SCMatrixKit abstract class acts as a factory for producing matrices.
Definition: abstract.h:58
int schmidt_orthog_tol(SymmSCMatrix *, double tol, double *res=0)
Schmidt orthogonalize this.
Definition: blocked.h:332
Definition: blocked.h:312
double get_element(int, int) const
Return or modify an element.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
Definition: blocked.h:266
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization. ...
Definition: matrix.h:261
Definition: blocked.h:322
double scalar_product(SCVector *)
Return the dot product.
void accumulate(const SymmSCMatrix *)
Sum m into this.
void svd_this(SCMatrix *U, DiagSCMatrix *sigma, SCMatrix *V)
Compute the singular value decomposition for this, possibly destroying this.
The SymmSCMatrix class is the abstract base class for diagonal double valued matrices.
Definition: abstract.h:503
SCVector * get_row(int i)
Return a row of this.
void scale(double)
Multiply all elements by val.
double determ_this()
Return the determinant of this. this is overwritten.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:156
SCMatrix * get_subblock(int, int, int, int)
Return a subblock of this.
Restores objects that derive from SavableState.
Definition: statein.h:70
The SCVector class is the abstract base class for double valued vectors.
Definition: abstract.h:97
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 trace()
Return the trace.
SCMatrix * matrix(const RefSCDimension &, const RefSCDimension &)
Given the dimensions, create matrices or vectors.
void set_element(int, double)
Set element i to val.
void assign_row(SCVector *v, int i)
Assign v to a row of this.
double scalar_product(SCVector *)
Return the scalar obtained by multiplying this on the left and right by v.
The SCElementOp2 class is very similar to the SCElementOp class except that pairs of blocks are treat...
Definition: elemop.h:125
void accumulate_element(int, double)
Add val to element i.
void accumulate_subblock(SCMatrix *, int, int, int, int)
Sum m into a subblock of this.
static std::ostream & out0()
Return an ostream that writes from node 0.
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
The SymmSCMatrix class is the abstract base class for symmetric double valued matrices.
Definition: abstract.h:364
double determ_this()
Return the determinant of this. this is overwritten.
double get_element(int) const
Return or modify an element.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
SCVector * get_row(int i)
Return a row or column of 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.
void assign_val(double)
Overridden to implement the assign functions.
void gen_invert_this()
Do a generalized inversion of this.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
void assign_subblock(SCMatrix *, int, int, int, int)
Assign m to a subblock of this.
void accumulate_row(SCVector *v, int i)
Sum v to a row or column of this.
The SCElementOp3 class is very similar to the SCElementOp class except that a triplet of blocks is tr...
Definition: elemop.h:147
void accumulate(const SCVector *)
Sum v into this.
void accumulate_outer_product(SCVector *, SCVector *)
Sum into this the products of various vectors or matrices.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
double determ_this()
Return the determinant of this. this is overwritten.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
Objects of class SCElementOp are used to perform operations on the elements of matrices.
Definition: elemop.h:60
double get_element(int) const
Return the value of element i.
void accumulate_row(SCVector *v, int i)
Sum v to a row of this.
void assign_row(SCVector *v, int i)
Assign v to a row or column of this.
SCMatrix * get_subblock(int, int, int, int)
Return a subblock of this.
Definition: blocked.h:115
void save(StateOut &)
Save and restore this in an implementation independent way.
The SCDimension class is used to determine the size and blocking of matrices.
Definition: dim.h:109
void accumulate(const DiagSCMatrix *)
Sum m into this.