MPQC  2.3.1
blkiter.h
1 //
2 // blkiter.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_blkiter_h
29 #define _math_scmat_blkiter_h
30 
31 #ifdef __GNUC__
32 #pragma interface
33 #endif
34 
35 #include <math/scmat/block.h>
36 
37 namespace sc {
38 
39 class SCMatrixRectBlock;
40 class SCMatrixLTriBlock;
41 class SCMatrixDiagBlock;
42 class SCVectorSimpleBlock;
43 
44 class SCElementOp;
45 class SCElementOp2;
46 class SCElementOp3;
47 
51  public:
53  virtual ~SCMatrixBlockIter();
55  virtual int i() = 0;
57  virtual int j() = 0;
59  virtual void set(double val) = 0;
61  virtual void accum(double val);
63  virtual double get() = 0;
65  virtual operator int() = 0;
67  virtual void operator++() = 0; // prefix ++
68  void operator++(int) { operator++(); }
70  virtual void reset() = 0;
71 };
72 
74  private:
75  SCMatrixRectBlock* block;
76  int i_;
77  int block_index;
78  int j_;
79  public:
81  virtual ~SCMatrixRectBlockIter();
82  int i();
83  int j();
84  double get();
85  void set(double);
86  operator int();
87  void operator++();
88  void reset();
89 };
90 
92  private:
93  SCMatrixRectSubBlock* block;
94  int i_;
95  int block_index;
96  int j_;
97  public:
99  virtual ~SCMatrixRectSubBlockIter();
100  int i();
101  int j();
102  double get();
103  void set(double);
104  operator int();
105  void operator++();
106  void reset();
107 };
108 
110  private:
111  SCMatrixLTriBlock* block;
112  int block_index;
113  int i_;
114  int j_;
115  public:
117  virtual ~SCMatrixLTriBlockIter();
118  int i();
119  int j();
120  double get();
121  void set(double);
122  operator int();
123  void operator++();
124  void reset();
125 };
126 
128  private:
129  SCMatrixLTriSubBlock* block;
130  int block_index;
131  int i_;
132  int j_;
133  public:
135  virtual ~SCMatrixLTriSubBlockIter();
136  int i();
137  int j();
138  double get();
139  void set(double);
140  operator int();
141  void operator++();
142  void reset();
143 };
144 
146  private:
147  SCMatrixDiagBlock* block;
148  int block_index;
149  int i_;
150  public:
152  virtual ~SCMatrixDiagBlockIter();
153  int i();
154  int j();
155  double get();
156  void set(double);
157  operator int();
158  void operator++();
159  void reset();
160 };
161 
163  private:
164  SCMatrixDiagSubBlock* block;
165  int block_index;
166  int i_;
167  public:
169  virtual ~SCMatrixDiagSubBlockIter();
170  int i();
171  int j();
172  double get();
173  void set(double);
174  operator int();
175  void operator++();
176  void reset();
177 };
178 
180  private:
181  SCVectorSimpleBlock* block;
182  int block_index;
183  int i_;
184  public:
186  virtual ~SCVectorSimpleBlockIter();
187  int i();
188  int j();
189  double get();
190  void set(double);
191  operator int();
192  void operator++();
193  void reset();
194 };
195 
197  private:
198  SCVectorSimpleSubBlock* block;
199  int block_index;
200  int i_;
201  public:
203  virtual ~SCVectorSimpleSubBlockIter();
204  int i();
205  int j();
206  double get();
207  void set(double);
208  operator int();
209  void operator++();
210  void reset();
211 };
212 
213 }
214 
215 #endif
216 
217 // Local Variables:
218 // mode: c++
219 // c-file-style: "CLJ"
220 // End:
The SCMatrixBlockIter class is used to described iterates that loop through the elements in a block.
Definition: blkiter.h:50
virtual void set(double val)=0
Set the current element to val.
virtual int j()=0
Returns the column index.
virtual int i()=0
Returns the row index.
virtual void operator++()=0
Move to the next element.
virtual void reset()=0
Start the iteration over.
virtual void accum(double val)
Add val to the current element.
virtual double get()=0
Return the value of the current element.
Definition: blkiter.h:145
int i()
Returns the row index.
void operator++()
Move to the next element.
void reset()
Start the iteration over.
void set(double)
Set the current element to val.
double get()
Return the value of the current element.
int j()
Returns the column index.
The SCMatrixDiagBlock describes a diagonal piece of a matrix.
Definition: block.h:322
Definition: blkiter.h:162
void reset()
Start the iteration over.
void set(double)
Set the current element to val.
int j()
Returns the column index.
void operator++()
Move to the next element.
int i()
Returns the row index.
double get()
Return the value of the current element.
The SCMatrixDiagSubBlock describes a diagonal subblock of a matrix.
Definition: block.h:355
Definition: blkiter.h:109
void operator++()
Move to the next element.
void reset()
Start the iteration over.
void set(double)
Set the current element to val.
int i()
Returns the row index.
int j()
Returns the column index.
double get()
Return the value of the current element.
The SCMatrixLTriBlock describes a triangular piece of a matrix.
Definition: block.h:257
Definition: blkiter.h:127
void operator++()
Move to the next element.
double get()
Return the value of the current element.
int i()
Returns the row index.
void set(double)
Set the current element to val.
int j()
Returns the column index.
void reset()
Start the iteration over.
The SCMatrixLTriSubBlock describes a triangular subblock of a matrix.
Definition: block.h:292
Definition: blkiter.h:73
double get()
Return the value of the current element.
int i()
Returns the row index.
int j()
Returns the column index.
void set(double)
Set the current element to val.
void reset()
Start the iteration over.
void operator++()
Move to the next element.
The SCMatrixRectBlock describes a rectangular piece of a matrix.
Definition: block.h:187
Definition: blkiter.h:91
void set(double)
Set the current element to val.
int i()
Returns the row index.
int j()
Returns the column index.
double get()
Return the value of the current element.
void operator++()
Move to the next element.
void reset()
Start the iteration over.
The SCMatrixRectSubBlock describes a rectangular piece of a matrix.
Definition: block.h:223
Definition: blkiter.h:179
int i()
Returns the row index.
void set(double)
Set the current element to val.
double get()
Return the value of the current element.
void reset()
Start the iteration over.
void operator++()
Move to the next element.
int j()
Returns the column index.
The SCVectorSimpleBlock describes a piece of a vector.
Definition: block.h:127
Definition: blkiter.h:196
int j()
Returns the column index.
double get()
Return the value of the current element.
void set(double)
Set the current element to val.
void reset()
Start the iteration over.
void operator++()
Move to the next element.
int i()
Returns the row index.
The SCVectorSimpleSubBlock describes a subblock of a vector.
Definition: block.h:158

Generated at Tue Jan 26 2021 00:00:00 for MPQC 2.3.1 using the documentation package Doxygen 1.9.1.