MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
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#include <math/scmat/block.h>
32
33namespace sc {
34
35class SCMatrixRectBlock;
36class SCMatrixLTriBlock;
37class SCMatrixDiagBlock;
38class SCVectorSimpleBlock;
39
40class SCElementOp;
41class SCElementOp2;
42class SCElementOp3;
43
47 public:
49 virtual ~SCMatrixBlockIter();
51 virtual int i() = 0;
53 virtual int j() = 0;
55 virtual void set(double val) = 0;
57 virtual void accum(double val);
59 virtual double get() = 0;
61 virtual operator int() = 0;
63 virtual void operator++() = 0; // prefix ++
64 void operator++(int) { operator++(); }
66 virtual void reset() = 0;
67};
68
70 private:
71 SCMatrixRectBlock* block;
72 int i_;
73 int block_index;
74 int j_;
75 public:
77 virtual ~SCMatrixRectBlockIter();
78 int i();
79 int j();
80 double get();
81 void set(double);
82 operator int();
83 void operator++();
84 void reset();
85};
86
88 private:
90 int i_;
91 int block_index;
92 int j_;
93 public:
96 int i();
97 int j();
98 double get();
99 void set(double);
100 operator int();
102 void reset();
103};
104
106 private:
107 SCMatrixLTriBlock* block;
108 int block_index;
109 int i_;
110 int j_;
111 public:
113 virtual ~SCMatrixLTriBlockIter();
114 int i();
115 int j();
116 double get();
117 void set(double);
118 operator int();
120 void reset();
121};
122
124 private:
126 int block_index;
127 int i_;
128 int j_;
129 public:
132 int i();
133 int j();
134 double get();
135 void set(double);
136 operator int();
138 void reset();
139};
140
142 private:
143 SCMatrixDiagBlock* block;
144 int block_index;
145 int i_;
146 public:
148 virtual ~SCMatrixDiagBlockIter();
149 int i();
150 int j();
151 double get();
152 void set(double);
153 operator int();
155 void reset();
156};
157
159 private:
161 int block_index;
162 int i_;
163 public:
166 int i();
167 int j();
168 double get();
169 void set(double);
170 operator int();
172 void reset();
173};
174
176 private:
177 SCVectorSimpleBlock* block;
178 int block_index;
179 int i_;
180 public:
182 virtual ~SCVectorSimpleBlockIter();
183 int i();
184 int j();
185 double get();
186 void set(double);
187 operator int();
189 void reset();
190};
191
193 private:
195 int block_index;
196 int i_;
197 public:
200 int i();
201 int j();
202 double get();
203 void set(double);
204 operator int();
206 void reset();
207};
208
209}
210
211#endif
212
213// Local Variables:
214// mode: c++
215// c-file-style: "CLJ"
216// End:
The SCMatrixBlockIter class is used to described iterates that loop through the elements in a block.
Definition blkiter.h:46
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:141
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:318
Definition blkiter.h:158
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:351
Definition blkiter.h:105
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:253
Definition blkiter.h:123
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:288
Definition blkiter.h:69
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:183
Definition blkiter.h:87
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:219
Definition blkiter.h:175
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:123
Definition blkiter.h:192
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:154
Contains all MPQC code up to version 3.
Definition mpqcin.h:14

Generated at Wed Sep 25 2024 02:45:30 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.