32#ifndef _math_scmat_local_h
33#define _math_scmat_local_h
35#include <math/scmat/block.h>
36#include <math/scmat/matrix.h>
37#include <math/scmat/abstract.h>
49class LocalSCMatrixKit:
public SCMatrixKit {
60class LocalSCVector:
public SCVector {
61 friend class LocalSCMatrix;
62 friend class LocalSymmSCMatrix;
63 friend class LocalDiagSCMatrix;
73 void assign_v(SCVector*);
74 void assign_p(
const double*);
80 void accumulate_product_rv(
SCMatrix*,SCVector*);
89 void vprint(
const char* title=0,
99class LocalSCMatrix:
public SCMatrix {
100 friend class LocalSymmSCMatrix;
101 friend class LocalDiagSCMatrix;
102 friend class LocalSCVector;
108 int compute_offset(
int,
int)
const;
109 void resize(
int,
int);
118 void set_element(
int,
int,
double);
119 void accumulate_element(
int,
int,
double);
126 void assign_column(
SCVector *v,
int i);
128 void accumulate_column(
SCVector *v,
int i);
130 void accumulate_product_rr(SCMatrix*,SCMatrix*);
149 SCMatrix*,SCMatrix*);
150 void vprint(
const char* title=0,
161class LocalSymmSCMatrix:
public SymmSCMatrix {
162 friend class LocalSCMatrix;
163 friend class LocalDiagSCMatrix;
164 friend class LocalSCVector;
170 int compute_offset(
int,
int)
const;
174 ~LocalSymmSCMatrix();
178 void set_element(
int,
int,
double);
179 void accumulate_element(
int,
int,
double);
197 void gen_invert_this();
201 void accumulate_symmetric_outer_product(
SCVector*);
202 void accumulate_symmetric_product(
SCMatrix*);
204 void accumulate_transform(
SCMatrix*,SymmSCMatrix*,
205 SCMatrix::Transform = SCMatrix::NormalTransform);
207 SCMatrix::Transform = SCMatrix::NormalTransform);
208 void accumulate_transform(SymmSCMatrix*,SymmSCMatrix*);
213 SymmSCMatrix*,SymmSCMatrix*);
214 void vprint(
const char* title=0,
225class LocalDiagSCMatrix:
public DiagSCMatrix {
226 friend class LocalSCMatrix;
227 friend class LocalSymmSCMatrix;
228 friend class LocalSCVector;
234 ~LocalDiagSCMatrix();
239 void set_element(
int,
double);
240 void accumulate_element(
int,
double);
251 DiagSCMatrix*,DiagSCMatrix*);
252 void vprint(
const char* title=0,
The SymmSCMatrix class is the abstract base class for diagonal double valued matrices.
Definition abstract.h:503
int n() const
Return the dimension.
Definition abstract.h:542
static std::ostream & out0()
Return an ostream that writes from node 0.
double invert_this()
Invert this.
void accumulate(const DiagSCMatrix *)
Sum m into this.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
void gen_invert_this()
Do a generalized inversion of this.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
double get_element(int) const
Return or modify an element.
double trace()
Return the trace.
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.
The LocalSCMatrixKit produces matrices that work in a single processor environment.
Definition local.h:49
SCMatrix * matrix(const RefSCDimension &, const RefSCDimension &)
Given the dimensions, create matrices or vectors.
void transpose_this()
Transpose this.
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.
SCMatrix * get_subblock(int, int, int, int)
Return a subblock of this.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this matrix.
double trace()
Return the trace.
void assign_val(double)
Overridden to implement to assign members.
void svd_this(SCMatrix *U, DiagSCMatrix *sigma, SCMatrix *V)
Compute the singular value decomposition for this, possibly destroying this.
void accumulate_row(SCVector *v, int i)
Sum v to a row or column of this.
double invert_this()
Invert this.
void assign_row(SCVector *v, int i)
Assign v to a row or column of this.
double get_element(int, int) const
Return or modify an element.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
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.
int schmidt_orthog_tol(SymmSCMatrix *, double tol, double *res=0)
Schmidt orthogonalize 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.
void accumulate_outer_product(SCVector *, SCVector *)
Sum into this the products of various vectors or matrices.
void accumulate(const SCMatrix *)
Sum m into this.
void set_element(int, double)
Set element i to val.
void accumulate(const SCMatrix *)
Sum m into this. One of m's dimensions must be 1.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this vector.
Ref< SCMatrixSubblockIter > all_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the all blocks used in this vector.
void accumulate(const SCVector *)
Sum v into this.
double get_element(int) const
Return the value of element i.
void assign_val(double)
Overridden to implement the assign functions.
double scalar_product(SCVector *)
Return the dot product.
void element_op(const Ref< SCElementOp > &)
Perform the element operation op on each element of this.
void accumulate_element(int, double)
Add val to element i.
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.
SCMatrix * get_subblock(int, int, int, int)
Return a subblock of this.
SCVector * get_row(int i)
Return a row of this.
double invert_this()
Invert this.
Ref< SCMatrixSubblockIter > local_blocks(SCMatrixSubblockIter::Access)
Returns iterators for the local (rapidly accessible) blocks used in this matrix.
void assign_subblock(SCMatrix *, int, int, int, int)
Assign m to a subblock of this.
double scalar_product(SCVector *)
Return the scalar obtained by multiplying this on the left and right by v.
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 of this.
void accumulate(const SymmSCMatrix *)
Sum m into this.
void diagonalize(DiagSCMatrix *, SCMatrix *)
Diagonalize this, placing the eigenvalues in d and the eigenvectors in m.
void accumulate_row(SCVector *v, int i)
Sum v to a row of this.
double get_element(int, int) const
Return or modify an element.
double trace()
Return the trace.
void accumulate_symmetric_sum(SCMatrix *)
Sum into this the products of various vectors or matrices.
void accumulate_subblock(SCMatrix *, int, int, int, int)
Sum m into a subblock of this.
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition dim.h:156
A template class that maintains references counts.
Definition ref.h:332
The SCMatrix class is the abstract base class for general double valued n by m matrices.
Definition abstract.h:195
The SCVector class is the abstract base class for double valued vectors.
Definition abstract.h:97
Serializes objects that derive from SavableState.
Definition stateout.h:61
The SymmSCMatrix class is the abstract base class for symmetric double valued matrices.
Definition abstract.h:364
int n() const
Return the dimension.
Definition abstract.h:412