MPQC  3.0.0-alpha
elemop.h
1 //
2 // elemop.h
3 //
4 // Copyright (C) 1996 Limit Point Systems, Inc.
5 //
6 // Author: Curtis Janssen <cljanss@limitpt.com>
7 // Maintainer: LPS
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27 
28 #ifndef _math_scmat_elemop_h
29 #define _math_scmat_elemop_h
30 
31 #include <cmath>
32 #include <stdexcept>
33 #include <functional>
34 #include <util/state/state.h>
35 #include <util/state/statein.h>
36 #include <util/state/stateout.h>
37 #include <util/group/message.h>
38 #include <math/scmat/blkiter.h>
39 #include <math/scmat/predicate.h>
40 
41 namespace sc {
42 
43 class SCMatrixBlock;
44 class SCMatrixBlockIter;
45 class SCMatrixRectBlock;
46 class SCMatrixLTriBlock;
47 class SCMatrixDiagBlock;
48 class SCVectorSimpleBlock;
49 class SCMatrixRectSubBlock;
50 class SCMatrixLTriSubBlock;
51 class SCMatrixDiagSubBlock;
52 class SCVectorSimpleSubBlock;
53 
54 class SCMatrix;
55 class SymmSCMatrix;
56 class DiagSCMatrix;
57 class SCVector;
58 
60  enum Values {AllElements = 0,
61  Columns = 1,
62  Rows = 2
63  };
64 };
65 struct SCElement {
66  typedef double value_type;
67  SCElement() : irow(null.irow), icol(null.icol), value(null.value) {}
68  SCElement(int ir, int ic, value_type v) : irow(ir), icol(ic), value(v) {}
69  int irow;
70  int icol;
71  value_type value;
72 
73  static SCElement null;
74 
75  operator value_type() const {
76  return value;
77  }
78 };
79 
83 template <class BinaryPredicate>
84 struct SCElementBinaryPredicateAdapter : public std::binary_function<SCElement, SCElement, bool> {
85  bool operator()(const sc::SCElement& a, const sc::SCElement& b) {
86  return BinaryPredicate()(a.value,b.value);
87  }
88 };
89 
94 class SCElementOp: public SavableState {
95  public:
96  SCElementOp();
98  virtual ~SCElementOp();
106  virtual int has_collect();
107  virtual void defer_collect(int);
108  virtual void collect(const Ref<MessageGrp>&);
112  virtual void collect(const Ref<SCElementOp>&);
116  virtual int has_side_effects();
117 
120  virtual bool threadsafe() const;
121 
124  virtual bool cloneable() const;
125 
129  virtual Ref<SCElementOp> clone();
130 
133  virtual void process(SCMatrixBlockIter&) = 0;
134 
139  void process_base(SCMatrixBlock*block);
140 
145  virtual void process_spec_rect(SCMatrixRectBlock*);
146  virtual void process_spec_ltri(SCMatrixLTriBlock*);
147  virtual void process_spec_diag(SCMatrixDiagBlock*);
148  virtual void process_spec_vsimp(SCVectorSimpleBlock*);
149  virtual void process_spec_rectsub(SCMatrixRectSubBlock*);
150  virtual void process_spec_ltrisub(SCMatrixLTriSubBlock*);
151  virtual void process_spec_diagsub(SCMatrixDiagSubBlock*);
152  virtual void process_spec_vsimpsub(SCVectorSimpleSubBlock*);
153 };
154 
159 class SCElementOp2: public SavableState {
160  public:
161  SCElementOp2();
163  virtual ~SCElementOp2();
164  virtual int has_collect();
165  virtual void defer_collect(int);
166  virtual int has_side_effects();
167  virtual int has_side_effects_in_arg();
168  virtual void collect(const Ref<MessageGrp>&);
169  virtual void process(SCMatrixBlockIter&,SCMatrixBlockIter&) = 0;
170  void process_base(SCMatrixBlock*,SCMatrixBlock*);
171  virtual void process_spec_rect(SCMatrixRectBlock*,SCMatrixRectBlock*);
172  virtual void process_spec_ltri(SCMatrixLTriBlock*,SCMatrixLTriBlock*);
173  virtual void process_spec_diag(SCMatrixDiagBlock*,SCMatrixDiagBlock*);
174  virtual void process_spec_vsimp(SCVectorSimpleBlock*,SCVectorSimpleBlock*);
175 };
176 
181 class SCElementOp3: public SavableState {
182  public:
183  SCElementOp3();
185  virtual ~SCElementOp3();
186  virtual int has_collect();
187  virtual void defer_collect(int);
188  virtual int has_side_effects();
189  virtual int has_side_effects_in_arg1();
190  virtual int has_side_effects_in_arg2();
191  virtual void collect(const Ref<MessageGrp>&);
192  virtual void process(SCMatrixBlockIter&,
194  SCMatrixBlockIter&) = 0;
195  void process_base(SCMatrixBlock*,SCMatrixBlock*,SCMatrixBlock*);
196  virtual void process_spec_rect(SCMatrixRectBlock*,
199  virtual void process_spec_ltri(SCMatrixLTriBlock*,
202  virtual void process_spec_diag(SCMatrixDiagBlock*,
205  virtual void process_spec_vsimp(SCVectorSimpleBlock*,
208 };
209 
214  private:
215  int deferred_;
216  double product;
217  public:
221  void save_data_state(StateOut&);
222  void process(SCMatrixBlockIter&,SCMatrixBlockIter&);
223  int has_collect();
224  void defer_collect(int);
225  void collect(const Ref<MessageGrp>&);
226  double result();
227  void init() { product = 0.0; }
228 };
229 
230 
235  public:
239  int has_side_effects();
240  void save_data_state(StateOut&);
241  void process(SCMatrixBlockIter&,SCMatrixBlockIter&);
242 };
243 
248  public:
249  SCElementDAXPY(double a);
251  ~SCElementDAXPY();
252  int has_side_effects();
253  void save_data_state(StateOut&);
254  void process(SCMatrixBlockIter&,SCMatrixBlockIter&);
255  private:
256  double a_;
257 };
258 
260  private:
261  double scale;
262  public:
263  SCElementScale(double a);
265  ~SCElementScale();
266  int has_side_effects();
267  void save_data_state(StateOut&);
268  void process(SCMatrixBlockIter&);
269 };
270 
272  private:
273  double assign;
274  public:
278  int has_side_effects();
279  void save_data_state(StateOut&);
280  void process(SCMatrixBlockIter&);
281 };
282 
284  private:
285  double assign;
286  public:
287  SCElementAssign(double a);
289  ~SCElementAssign();
290  int has_side_effects();
291  void save_data_state(StateOut&);
292  void process(SCMatrixBlockIter&);
293 };
294 
296  public:
298  SCElementSquareRoot(double a);
301  int has_side_effects();
302  void save_data_state(StateOut&);
303  void process(SCMatrixBlockIter&);
304 };
305 
307  private:
308  double threshold_;
309  int nbelowthreshold_;
310  int deferred_;
311  public:
312  SCElementInvert(double threshold = 0.0);
314  ~SCElementInvert();
315  int has_side_effects();
316  void save_data_state(StateOut&);
317  void process(SCMatrixBlockIter&);
318  int has_collect();
319  void defer_collect(int);
320  void collect(const Ref<MessageGrp>&);
321  void collect(const Ref<SCElementOp>&);
322  int result() { return nbelowthreshold_; }
323 };
324 
325 
327  private:
328  double scale_diagonal;
329  public:
330  SCElementScaleDiagonal(double a);
333  int has_side_effects();
334  void save_data_state(StateOut&);
335  void process(SCMatrixBlockIter&);
336 };
337 
339  private:
340  double shift_diagonal;
341  public:
342  SCElementShiftDiagonal(double a);
345  int has_side_effects();
346  void save_data_state(StateOut&);
347  void process(SCMatrixBlockIter&);
348 };
349 
357 template <class BinaryPredicate = std::less<double>, SCMatrixIterationRanges::Values IterationRanges = SCMatrixIterationRanges::AllElements>
359  public:
361 
362  SCElementFindExtremum(double init_value = 0.0):deferred_(0), init_value_(init_value), r(1, SCElement(0,0,init_value)) {}
364  {
365  {
366  int nchar; s.get(nchar);
367  r.resize(nchar / sizeof(SCElement));
368  char* r_char;
369  s.get(r_char);
370  s.get(init_value_);
371  memcpy(&r[0], r_char, nchar);
372  delete[] r_char;
373  }
374  s.get(deferred_);
375  }
376 
378 
380  {
381  {
382  int nchar = r.size() * sizeof(SCElement);
383  s.put(nchar);
384  s.put(init_value_);
385  s.put((char*)(&r[0]), nchar);
386  }
387  s.put(deferred_);
388  }
389 
391  for (i.reset(); i; ++i) {
392  int range;
393  switch(IterationRanges) {
394  case SCMatrixIterationRanges::AllElements: range = 0; break;
395  case SCMatrixIterationRanges::Columns: range = i.j(); break;
396  case SCMatrixIterationRanges::Rows: range = i.i(); break;
397  }
398  if (range >= r.size()) {
399  const size_t old_size = r.size();
400  r.resize(range+1);
401  for(size_t i=old_size; i<r.size(); ++i) {
402  r[i] = SCElement(0,0,init_value_);
403  }
404  }
405  double value = i.get();
406  if (Op(r[range].value, value)) {
407  r[range] = SCElement(i.i(), i.j(), i.get());
408  }
409  }
410  }
411 
412  int has_collect() { return 1; }
413  void defer_collect(int h) { deferred_=h; }
414 
415  void collect(const Ref<MessageGrp>& msg) {
416  if (!deferred_) {
417  GrpCompareReduce<SCElement, SCElementBinaryPredicateAdapter<BinaryPredicate> > reduce;
418  msg->reduce<SCElement>(&r[0], r.size(), reduce);
419  }
420  }
421  void collect(const Ref<SCElementOp>& op) {
422  throw std::runtime_error(
423  "SCElementMaxAbs::collect(const Ref<SCElementOp> &): not implemented");
424  }
425 
426  const std::vector<SCElement>& result() { return r; }
427 
428  private:
429  int deferred_;
430  double init_value_;
431  std::vector<SCElement> r;
432  BinaryPredicate Op;
433 
434  static ClassDesc class_desc_;
435 };
436 
437 template <class BinaryPredicate, SCMatrixIterationRanges::Values IterationRanges>
438 ClassDesc SCElementFindExtremum<BinaryPredicate,IterationRanges>::class_desc_(
439  typeid(this_type),
440  typeid(this_type).name(),
441  1,"public SCElementOp",
442  0, 0, sc::create<typename SCElementFindExtremum<BinaryPredicate,IterationRanges>::this_type>);
443 
445  private:
446  int deferred_;
447  double r;
448  public:
449  SCElementMaxAbs();
451  ~SCElementMaxAbs();
452  void save_data_state(StateOut&);
453  void process(SCMatrixBlockIter&);
454  int has_collect();
455  void defer_collect(int);
456  void collect(const Ref<MessageGrp>&);
457  void collect(const Ref<SCElementOp>&);
458  double result();
459 };
460 
461 
463  private:
464  int deferred_;
465  double r;
466  public:
467  // rinit must be greater than the magnitude of the smallest element
468  SCElementMinAbs(double rinit);
470  ~SCElementMinAbs();
471  void save_data_state(StateOut&);
472  void process(SCMatrixBlockIter&);
473  int has_collect();
474  void defer_collect(int);
475  void collect(const Ref<MessageGrp>&);
476  void collect(const Ref<SCElementOp>&);
477  double result();
478 };
479 
480 class SCElementSum: public SCElementOp {
481  private:
482  int deferred_;
483  double r;
484  public:
485  SCElementSum();
487  ~SCElementSum();
488  void save_data_state(StateOut&);
489  void process(SCMatrixBlockIter&);
490  int has_collect();
491  void defer_collect(int);
492  void collect(const Ref<MessageGrp>&);
493  void collect(const Ref<SCElementOp>&);
494  double result();
495  void init() { r = 0.0; }
496 };
497 
500  private:
501  int deferred_;
502  double r_; // result
503  unsigned int k_; // norm parameter
504 
505  static double _process(SCMatrixBlockIter& i, int k);
506  static double _process1(SCMatrixBlockIter& i);
507  static double _process2(SCMatrixBlockIter& i);
508 
509  public:
511  SCElementKNorm(unsigned int k = 2);
513  ~SCElementKNorm();
514  void save_data_state(StateOut&);
515  void process(SCMatrixBlockIter&);
516  int has_collect();
517  void defer_collect(int);
518  void collect(const Ref<MessageGrp>&);
519  void collect(const Ref<SCElementOp>&);
520  double result();
521  void init() { r_ = 0.0; }
522 };
523 
524 class SCElementDot: public SCElementOp {
525  private:
526  double** avects;
527  double** bvects;
528  int length;
529  public:
531  void save_data_state(StateOut&);
532  SCElementDot(double**a, double**b, int length);
533  void process(SCMatrixBlockIter&);
534  int has_side_effects();
535 };
536 
538  private:
539  SCMatrix *m;
540  public:
542  int has_side_effects();
543  void process(SCMatrixBlockIter&);
544 };
545 
547  private:
548  SymmSCMatrix *m;
549  public:
551  int has_side_effects();
552  void process(SCMatrixBlockIter&);
553 };
554 
556  private:
557  DiagSCMatrix *m;
558  public:
560  int has_side_effects();
561  void process(SCMatrixBlockIter&);
562 };
563 
565  private:
566  SCVector *m;
567  public:
569  int has_side_effects();
570  void process(SCMatrixBlockIter&);
571 };
572 
573 }
574 
575 #endif
576 
577 // Local Variables:
578 // mode: c++
579 // c-file-style: "CLJ"
580 // End:
sc::SCElementDot::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCMatrixBlockIter::j
virtual int j()=0
Returns the column index.
sc::SCElementAccumulateSCMatrix
Definition: elemop.h:537
sc::SCElementAccumulateSymmSCMatrix::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCMatrixBlock
SCMatrixBlock is the base clase for all types of blocks that comprise matrices and vectors.
Definition: block.h:41
sc::SCElementRandomize::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementOp2
The SCElementOp2 class is very similar to the SCElementOp class except that pairs of blocks are treat...
Definition: elemop.h:159
sc::SCElementMaxAbs
Definition: elemop.h:444
sc::SCElementAssign::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCVector
The SCVector class is the abstract base class for double valued vectors.
Definition: abstract.h:97
sc::SCElementDAXPY::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementScale::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementAssign
Definition: elemop.h:283
sc::SCElementSum::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementAccumulateSCVector::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCElementScaleDiagonal
Definition: elemop.h:326
mpqc::range
Definition: range.hpp:23
sc::SCMatrixBlockIter::reset
virtual void reset()=0
Start the iteration over.
sc::SCElementRandomize
Definition: elemop.h:271
sc::SCMatrixLTriBlock
The SCMatrixLTriBlock describes a triangular piece of a matrix.
Definition: block.h:253
sc::SCElementKNorm::SCElementKNorm
SCElementKNorm(unsigned int k=2)
by default compute 2-norm
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::SCElementMinAbs::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementKNorm::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementOp::threadsafe
virtual bool threadsafe() const
Returns true if this SCElementOp is threadsafe.
sc::SCMatrixRectBlock
The SCMatrixRectBlock describes a rectangular piece of a matrix.
Definition: block.h:183
sc::SCElementSquareRoot
Definition: elemop.h:295
sc::SCElementScale::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCElementMinAbs::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCMatrixIterationRanges
Definition: elemop.h:59
sc::SCMatrixLTriSubBlock
The SCMatrixLTriSubBlock describes a triangular subblock of a matrix.
Definition: block.h:288
sc::SCElementInvert::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::create
DescribedClass * create()
This is used to pass a function that make void constructor calls to the ClassDesc constructor.
Definition: class.h:102
sc::SCElementDot
Definition: elemop.h:524
sc::SCElementAssign::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementFindExtremum::save_data_state
void save_data_state(StateOut &s)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
Definition: elemop.h:379
sc::SCMatrixBlockIter::get
virtual double get()=0
Return the value of the current element.
sc::SCElement
Definition: elemop.h:65
sc::DiagSCMatrix
The SymmSCMatrix class is the abstract base class for diagonal double valued matrices.
Definition: abstract.h:551
sc::SCElementDestructiveProduct
does
Definition: elemop.h:234
sc::SCElementShiftDiagonal
Definition: elemop.h:338
sc::SCElementOp::process_spec_rect
virtual void process_spec_rect(SCMatrixRectBlock *)
Matrices should call these members when the type of block is known.
sc::SCElementFindExtremum::process
void process(SCMatrixBlockIter &i)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
Definition: elemop.h:390
sc::SCElementDot::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementOp
Objects of class SCElementOp are used to perform operations on the elements of matrices.
Definition: elemop.h:94
sc::StateIn
Definition: statein.h:79
sc::SCVectorSimpleSubBlock
The SCVectorSimpleSubBlock describes a subblock of a vector.
Definition: block.h:154
sc::SCElementSquareRoot::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementDestructiveProduct::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementSquareRoot::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCMatrixBlockIter::i
virtual int i()=0
Returns the row index.
sc::SCElementKNorm
Computes k-norm of matrix.
Definition: elemop.h:499
sc::SCElementAccumulateSCVector::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementShiftDiagonal::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCElementAccumulateDiagSCMatrix
Definition: elemop.h:555
sc::SCElementSquareRoot::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementMaxAbs::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementScaleDiagonal::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementAccumulateDiagSCMatrix::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementBinaryPredicateAdapter
Adapts a binary predicate that acts on SCElement::value_type.
Definition: elemop.h:84
sc::SCElementMaxAbs::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementAssign::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCElementOp::clone
virtual Ref< SCElementOp > clone()
Returns a clone of this object.
sc::SCElementSum::has_collect
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
sc::SCElementRandomize::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementOp::cloneable
virtual bool cloneable() const
Returns true if this SCElementOp supports the clone() member.
sc::SCElementAccumulateSCVector
Definition: elemop.h:564
sc::SCVectorSimpleBlock
The SCVectorSimpleBlock describes a piece of a vector.
Definition: block.h:123
sc::SCElementRandomize::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::StateOut
Definition: stateout.h:71
sc::SCElementAccumulateSymmSCMatrix::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCMatrixBlockIter
The SCMatrixBlockIter class is used to described iterates that loop through the elements in a block.
Definition: blkiter.h:46
sc::SCElementScale::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCMatrixDiagBlock
The SCMatrixDiagBlock describes a diagonal piece of a matrix.
Definition: block.h:318
sc::SCElementScale
Definition: elemop.h:259
sc::SCElementDot::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementMinAbs
Definition: elemop.h:462
sc::SCElementScaleDiagonal::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SymmSCMatrix
The SymmSCMatrix class is the abstract base class for symmetric double valued matrices.
Definition: abstract.h:385
sc::SCElementAccumulateSymmSCMatrix
Definition: elemop.h:546
sc::SCElementOp::has_collect
virtual int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
sc::SCElementDAXPY
does
Definition: elemop.h:247
sc::SCElementScalarProduct
evaluates
Definition: elemop.h:213
sc::SCElementAccumulateSCMatrix::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementKNorm::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementShiftDiagonal::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementFindExtremum
Searches each range in IterationRanges for element i so that there is no element j in that Range for ...
Definition: elemop.h:358
sc::SCElementSum::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCMatrix
The SCMatrix class is the abstract base class for general double valued n by m matrices.
Definition: abstract.h:195
sc::SCElementInvert
Definition: elemop.h:306
sc::SCElementFindExtremum::collect
void collect(const Ref< SCElementOp > &op)
Multithreaded use of cloneable SCElementOp objects requires that data from cloned objects be collecte...
Definition: elemop.h:421
sc::StateOut::put
virtual int put(const ClassDesc *)
Write out information about the given ClassDesc.
sc::SavableState
Base class for objects that can save/restore state.
Definition: state.h:45
sc::SCElementMinAbs::has_collect
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
sc::SCElementInvert::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCMatrixRectSubBlock
The SCMatrixRectSubBlock describes a rectangular piece of a matrix.
Definition: block.h:219
sc::SCElementOp::process
virtual void process(SCMatrixBlockIter &)=0
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementOp3
The SCElementOp3 class is very similar to the SCElementOp class except that a triplet of blocks is tr...
Definition: elemop.h:181
sc::SCElementInvert::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementScalarProduct::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::SCElementSum
Definition: elemop.h:480
sc::StateIn::get
virtual int get(const ClassDesc **)
This restores ClassDesc's.
sc::SCElementOp::process_base
void process_base(SCMatrixBlock *block)
Lazy matrix implementors can call this member when the type of block specialization is unknown.
sc::SCElementOp::has_side_effects
virtual int has_side_effects()
By default this returns nonzero.
sc::SCElementAccumulateDiagSCMatrix::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCElementScaleDiagonal::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::SCElementAccumulateSCMatrix::has_side_effects
int has_side_effects()
By default this returns nonzero.
sc::SCElementFindExtremum::has_collect
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
Definition: elemop.h:412
sc::SCElementInvert::has_collect
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
sc::SCElementShiftDiagonal::process
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
sc::SCElementMaxAbs::has_collect
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...
sc::SCMatrixDiagSubBlock
The SCMatrixDiagSubBlock describes a diagonal subblock of a matrix.
Definition: block.h:351
sc::SCElementKNorm::has_collect
int has_collect()
If duplicates of the SCElementOp exist (that is, there is more than one node), then if has_collect re...

Generated at Sun Jan 26 2020 23:24:00 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.