28#ifndef _math_scmat_dist_h
29#define _math_scmat_dist_h
31#include <util/group/message.h>
32#include <util/group/mstate.h>
34#include <math/scmat/block.h>
35#include <math/scmat/matrix.h>
36#include <math/scmat/abstract.h>
61 void init_blocklist();
62 double *find_element(
int i)
const;
63 int element_to_node(
int i)
const;
64 int block_to_node(
int)
const;
66 void error(
const char *);
70 void assign_p(
const double*);
72 void convert(
double* v)
const;
87 void vprint(
const char* title=0,
109 void init_blocklist();
110 void error(
const char *);
111 double *find_element(
int i,
int j)
const;
112 int element_to_node(
int i,
int j)
const;
113 int block_to_node(
int,
int)
const;
118 enum VecOp {CopyFromVec, CopyToVec, AccumFromVec, AccumToVec};
119 enum Form { Row, Col } form;
120 void create_vecform(Form,
int nvec = -1);
121 void delete_vecform();
122 void vecform_op(VecOp op,
int *ivec = 0);
131 void set_element(
int,
int,
double);
132 void accumulate_element(
int,
int,
double);
139 void assign_column(
SCVector *v,
int i);
141 void accumulate_column(
SCVector *v,
int i);
163 void vprint(
const char* title=0,
165 void vprint(
const char* title=0,
183 void init_blocklist();
184 double *find_element(
int i,
int j)
const;
185 int element_to_node(
int i,
int j)
const;
186 int block_to_node(
int,
int)
const;
189 void error(
const char *msg);
196 void set_element(
int,
int,
double);
197 void accumulate_element(
int,
int,
double);
243 void init_blocklist();
244 double *find_element(
int i)
const;
245 int element_to_node(
int i)
const;
246 int block_to_node(
int)
const;
248 void error(
const char *msg);
255 void set_element(
int,
double);
256 void accumulate_element(
int,
double);
284 void maybe_advance_list();
The SymmSCMatrix class is the abstract base class for diagonal double valued matrices.
Definition abstract.h:555
Distributed DiagSCMatrix.
Definition dist.h:236
double trace()
Return the trace.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
double invert_this()
Invert this.
double get_element(int) const
Return or modify an element.
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 element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
double determ_this()
Return the determinant of this. this is overwritten.
void accumulate(const DiagSCMatrix *)
Sum m into this.
The DistSCMatrixKit produces matrices that work in a many processor environment.
Definition dist.h:42
SCMatrix * matrix(const RefSCDimension &, const RefSCDimension &)
Given the dimensions, create matrices or vectors.
void begin()
Start at the beginning.
void next()
Proceed to the next block.
Distributed SCMatrix.
Definition dist.h:97
SCMatrix * get_subblock(int, int, int, int)
Return a subblock of this.
void transpose_this()
Transpose this.
double get_element(int, int) const
Return or modify an element.
void assign_row(SCVector *v, int i)
Assign v to a row or column of this.
void schmidt_orthog(SymmSCMatrix *, int)
Schmidt orthogonalize this.
int schmidt_orthog_tol(SymmSCMatrix *, double tol, double *res=0)
Schmidt orthogonalize this.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
void gen_invert_this(double condition_number_threshold=1e8)
uses invert_this()
void assign_subblock(SCMatrix *, int, int, int, int, int=0, int=0)
Assign m to a subblock of this.
void accumulate(const SCMatrix *)
Sum m into this.
SCVector * get_row(int i)
Return a row or column of this.
void accumulate_subblock(SCMatrix *, int, int, int, int, int=0, int=0)
Sum m into a subblock of this.
double determ_this()
Return the determinant of this. this is overwritten.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
void accumulate_row(SCVector *v, int i)
Sum v to a row or column of this.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
double invert_this()
Invert this.
void accumulate_outer_product(SCVector *, SCVector *)
Sum into this the products of various vectors or matrices.
double trace()
Return the trace.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this vector.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
void accumulate(const SCMatrix *m)
Sum m into this. One of m's dimensions must be 1.
void set_element(int, double)
Set element i to val.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this vector.
double scalar_product(SCVector *)
Return the dot product.
void accumulate(const SCVector *)
Sum v into this.
void accumulate_element(int, double)
Add val to element i.
double get_element(int) const
Return the value of element i.
Distributed SymmSCMatrix.
Definition dist.h:175
double get_element(int, int) const
Return or modify an element.
double invert_this()
Invert this.
void accumulate_subblock(SCMatrix *, int, int, int, int)
Sum m into a subblock of this.
void diagonalize(DiagSCMatrix *, SCMatrix *)
Diagonalize this, placing the eigenvalues in d and the eigenvectors in m.
void eigensystem(SymmSCMatrix *, DiagSCMatrix *, SCMatrix *)
Solve generalized eigensystem for this with metric s, placing the eigenvalues in d and the eigenvecto...
SCMatrix * get_subblock(int, int, int, int)
Return a subblock of this.
void element_op(const Ref< SCElementOp > &)
only applied to the unique elements of this.
void accumulate(const SymmSCMatrix *)
Sum m into this.
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 of this.
double trace()
Return the trace.
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_symmetric_sum(SCMatrix *)
Sum into a + a.t()
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
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)
uses invert_this()
double determ_this()
Return the determinant of this. this is overwritten.
static std::ostream & out0()
Return an ostream that writes from node 0.
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition dim.h:152
A template class that maintains references counts.
Definition ref.h:361
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
The SCVector class is the abstract base class for double valued vectors.
Definition abstract.h:97
StateRecv is a concrete specialization of MsgStateRecv that does the receive part of point to point c...
Definition mstate.h:193
StateSend is a concrete specialization of MsgStateSend that does the send part of point to point comm...
Definition mstate.h:165
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
std::vector< double > convert(const RefDiagSCMatrix &A)
Converts RefDiagSCMatrix to std::vector<double>