28#ifndef _math_scmat_elemop_h
29#define _math_scmat_elemop_h
35#include <util/state/state.h>
36#include <util/group/message.h>
60class SCElementOp:
public SavableState {
63 SCElementOp(
StateIn&s): SavableState(s) {}
64 virtual ~SCElementOp();
73 virtual void defer_collect(
int);
125class SCElementOp2:
public SavableState {
128 SCElementOp2(
StateIn&s): SavableState(s) {}
129 virtual ~SCElementOp2();
130 virtual int has_collect();
131 virtual void defer_collect(
int);
132 virtual int has_side_effects();
133 virtual int has_side_effects_in_arg();
147class SCElementOp3:
public SavableState {
150 SCElementOp3(
StateIn&s): SavableState(s) {}
151 virtual ~SCElementOp3();
152 virtual int has_collect();
153 virtual void defer_collect(
int);
154 virtual int has_side_effects();
155 virtual int has_side_effects_in_arg1();
156 virtual int has_side_effects_in_arg2();
176class SCElementScalarProduct:
public SCElementOp2 {
181 SCElementScalarProduct();
182 SCElementScalarProduct(
StateIn&);
183 ~SCElementScalarProduct();
187 void defer_collect(
int);
190 void init() { product = 0.0; }
194class SCDestructiveElementProduct:
public SCElementOp2 {
196 SCDestructiveElementProduct();
197 SCDestructiveElementProduct(
StateIn&);
198 ~SCDestructiveElementProduct();
199 int has_side_effects();
204class SCElementScale:
public SCElementOp {
208 SCElementScale(
double a);
216class SCElementRandomize:
public SCElementOp {
220 SCElementRandomize();
222 ~SCElementRandomize();
228class SCElementAssign:
public SCElementOp {
232 SCElementAssign(
double a);
240class SCElementSquareRoot:
public SCElementOp {
242 SCElementSquareRoot();
243 SCElementSquareRoot(
double a);
245 ~SCElementSquareRoot();
251class SCElementInvert:
public SCElementOp {
254 int nbelowthreshold_;
257 SCElementInvert(
double threshold = 0.0);
264 void defer_collect(
int);
267 int result() {
return nbelowthreshold_; }
271class SCElementScaleDiagonal:
public SCElementOp {
273 double scale_diagonal;
275 SCElementScaleDiagonal(
double a);
276 SCElementScaleDiagonal(
StateIn&);
277 ~SCElementScaleDiagonal();
283class SCElementShiftDiagonal:
public SCElementOp {
285 double shift_diagonal;
287 SCElementShiftDiagonal(
double a);
288 SCElementShiftDiagonal(
StateIn&);
289 ~SCElementShiftDiagonal();
295class SCElementMaxAbs:
public SCElementOp {
306 void defer_collect(
int);
313class SCElementMinAbs:
public SCElementOp {
319 SCElementMinAbs(
double rinit);
325 void defer_collect(
int);
332class SCElementSumAbs:
public SCElementOp {
343 void defer_collect(
int);
347 void init() { r = 0.0; }
364 void defer_collect(
int);
368 void init() { r_ = 0.0; }
371class SCElementDot:
public SCElementOp {
379 SCElementDot(
double**a,
double**b,
int length);
384class SCElementAccumulateSCMatrix:
public SCElementOp {
388 SCElementAccumulateSCMatrix(
SCMatrix *);
393class SCElementAccumulateSymmSCMatrix:
public SCElementOp {
402class SCElementAccumulateDiagSCMatrix:
public SCElementOp {
411class SCElementAccumulateSCVector:
public SCElementOp {
415 SCElementAccumulateSCVector(
SCVector *);
The SymmSCMatrix class is the abstract base class for diagonal double valued matrices.
Definition abstract.h:503
A template class that maintains references counts.
Definition ref.h:332
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
int has_side_effects()
By default this returns nonzero.
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
int has_side_effects()
By default this returns nonzero.
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
int has_side_effects()
By default this returns nonzero.
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
int has_side_effects()
By default this returns nonzero.
int has_side_effects()
By default this returns nonzero.
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
int has_side_effects()
By default this returns nonzero.
void collect(const Ref< SCElementOp > &)
Multithreaded use of cloneable SCElementOp objects requires that data from cloned objects be collecte...
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
int has_side_effects()
By default this returns nonzero.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
SCElementKNorm(double k=2.0)
by default compute 2-norm
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void collect(const Ref< SCElementOp > &)
Multithreaded use of cloneable SCElementOp objects requires that data from cloned objects be collecte...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void collect(const Ref< SCElementOp > &)
Multithreaded use of cloneable SCElementOp objects requires that data from cloned objects be collecte...
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
void collect(const Ref< SCElementOp > &)
Multithreaded use of cloneable SCElementOp objects requires that data from cloned objects be collecte...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
virtual Ref< SCElementOp > clone()
Returns a clone of this object.
virtual int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
virtual void process_spec_rect(SCMatrixRectBlock *)
Matrices should call these members when the type of block is known.
virtual void collect(const Ref< SCElementOp > &)
Multithreaded use of cloneable SCElementOp objects requires that data from cloned objects be collecte...
virtual bool cloneable()
Returns true if this SCElementOp supports the cloneable member.
void process_base(SCMatrixBlock *block)
Lazy matrix implementors can call this member when the type of block specialization is unknown.
virtual int has_side_effects()
By default this returns nonzero.
virtual bool threadsafe()
Returns true if this SCElementOp is threadsafe.
virtual void process(SCMatrixBlockIter &)=0
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
int has_side_effects()
By default this returns nonzero.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
int has_side_effects()
By default this returns nonzero.
int has_side_effects()
By default this returns nonzero.
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
int has_side_effects()
By default this returns nonzero.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
int has_side_effects()
By default this returns nonzero.
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void collect(const Ref< SCElementOp > &)
Multithreaded use of cloneable SCElementOp objects requires that data from cloned objects be collecte...
The SCMatrixBlockIter class is used to described iterates that loop through the elements in a block.
Definition blkiter.h:50
SCMatrixBlock is the base clase for all types of blocks that comprise matrices and vectors.
Definition block.h:45
The SCMatrixDiagBlock describes a diagonal piece of a matrix.
Definition block.h:322
The SCMatrixDiagSubBlock describes a diagonal subblock of a matrix.
Definition block.h:355
The SCMatrixLTriBlock describes a triangular piece of a matrix.
Definition block.h:257
The SCMatrixLTriSubBlock describes a triangular subblock of a matrix.
Definition block.h:292
The SCMatrixRectBlock describes a rectangular piece of a matrix.
Definition block.h:187
The SCMatrixRectSubBlock describes a rectangular piece of a matrix.
Definition block.h:223
The SCMatrix class is the abstract base class for general double valued n by m matrices.
Definition abstract.h:195
The SCVectorSimpleBlock describes a piece of a vector.
Definition block.h:127
The SCVectorSimpleSubBlock describes a subblock of a vector.
Definition block.h:158
The SCVector class is the abstract base class for double valued vectors.
Definition abstract.h:97
Restores objects that derive from SavableState.
Definition statein.h:70
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