![]()
|
blkiter.h00001 //
00002 // blkiter.h
00003 //
00004 // Copyright (C) 1996 Limit Point Systems, Inc.
00005 //
00006 // Author: Curtis Janssen <cljanss@limitpt.com>
00007 // Maintainer: LPS
00008 //
00009 // This file is part of the SC Toolkit.
00010 //
00011 // The SC Toolkit is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Library General Public License as published by
00013 // the Free Software Foundation; either version 2, or (at your option)
00014 // any later version.
00015 //
00016 // The SC Toolkit is distributed in the hope that it will be useful,
00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00019 // GNU Library General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Library General Public License
00022 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
00023 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
00024 //
00025 // The U.S. Government is granted a limited license as per AL 91-7.
00026 //
00027
00028 #ifndef _math_scmat_blkiter_h
00029 #define _math_scmat_blkiter_h
00030
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034
00035 #include <math/scmat/block.h>
00036
00037 namespace sc {
00038
00039 class SCMatrixRectBlock;
00040 class SCMatrixLTriBlock;
00041 class SCMatrixDiagBlock;
00042 class SCVectorSimpleBlock;
00043
00044 class SCElementOp;
00045 class SCElementOp2;
00046 class SCElementOp3;
00047
00050 class SCMatrixBlockIter {
00051 public:
00052 SCMatrixBlockIter() {}
00053 virtual ~SCMatrixBlockIter();
00055 virtual int i() = 0;
00057 virtual int j() = 0;
00059 virtual void set(double val) = 0;
00061 virtual void accum(double val);
00063 virtual double get() = 0;
00065 virtual operator int() = 0;
00067 virtual void operator++() = 0; // prefix ++
00068 void operator++(int) { operator++(); }
00070 virtual void reset() = 0;
00071 };
00072
00073 class SCMatrixRectBlockIter: public SCMatrixBlockIter {
00074 private:
00075 SCMatrixRectBlock* block;
00076 int i_;
00077 int block_index;
00078 int j_;
00079 public:
00080 SCMatrixRectBlockIter(SCMatrixRectBlock*);
00081 virtual ~SCMatrixRectBlockIter();
00082 int i();
00083 int j();
00084 double get();
00085 void set(double);
00086 operator int();
00087 void operator++();
00088 void reset();
00089 };
00090
00091 class SCMatrixRectSubBlockIter: public SCMatrixBlockIter {
00092 private:
00093 SCMatrixRectSubBlock* block;
00094 int i_;
00095 int block_index;
00096 int j_;
00097 public:
00098 SCMatrixRectSubBlockIter(SCMatrixRectSubBlock*);
00099 virtual ~SCMatrixRectSubBlockIter();
00100 int i();
00101 int j();
00102 double get();
00103 void set(double);
00104 operator int();
00105 void operator++();
00106 void reset();
00107 };
00108
00109 class SCMatrixLTriBlockIter: public SCMatrixBlockIter {
00110 private:
00111 SCMatrixLTriBlock* block;
00112 int block_index;
00113 int i_;
00114 int j_;
00115 public:
00116 SCMatrixLTriBlockIter(SCMatrixLTriBlock*);
00117 virtual ~SCMatrixLTriBlockIter();
00118 int i();
00119 int j();
00120 double get();
00121 void set(double);
00122 operator int();
00123 void operator++();
00124 void reset();
00125 };
00126
00127 class SCMatrixLTriSubBlockIter: public SCMatrixBlockIter {
00128 private:
00129 SCMatrixLTriSubBlock* block;
00130 int block_index;
00131 int i_;
00132 int j_;
00133 public:
00134 SCMatrixLTriSubBlockIter(SCMatrixLTriSubBlock*);
00135 virtual ~SCMatrixLTriSubBlockIter();
00136 int i();
00137 int j();
00138 double get();
00139 void set(double);
00140 operator int();
00141 void operator++();
00142 void reset();
00143 };
00144
00145 class SCMatrixDiagBlockIter: public SCMatrixBlockIter {
00146 private:
00147 SCMatrixDiagBlock* block;
00148 int block_index;
00149 int i_;
00150 public:
00151 SCMatrixDiagBlockIter(SCMatrixDiagBlock*);
00152 virtual ~SCMatrixDiagBlockIter();
00153 int i();
00154 int j();
00155 double get();
00156 void set(double);
00157 operator int();
00158 void operator++();
00159 void reset();
00160 };
00161
00162 class SCMatrixDiagSubBlockIter: public SCMatrixBlockIter {
00163 private:
00164 SCMatrixDiagSubBlock* block;
00165 int block_index;
00166 int i_;
00167 public:
00168 SCMatrixDiagSubBlockIter(SCMatrixDiagSubBlock*);
00169 virtual ~SCMatrixDiagSubBlockIter();
00170 int i();
00171 int j();
00172 double get();
00173 void set(double);
00174 operator int();
00175 void operator++();
00176 void reset();
00177 };
00178
00179 class SCVectorSimpleBlockIter: public SCMatrixBlockIter {
00180 private:
00181 SCVectorSimpleBlock* block;
00182 int block_index;
00183 int i_;
00184 public:
00185 SCVectorSimpleBlockIter(SCVectorSimpleBlock*);
00186 virtual ~SCVectorSimpleBlockIter();
00187 int i();
00188 int j();
00189 double get();
00190 void set(double);
00191 operator int();
00192 void operator++();
00193 void reset();
00194 };
00195
00196 class SCVectorSimpleSubBlockIter: public SCMatrixBlockIter {
00197 private:
00198 SCVectorSimpleSubBlock* block;
00199 int block_index;
00200 int i_;
00201 public:
00202 SCVectorSimpleSubBlockIter(SCVectorSimpleSubBlock*);
00203 virtual ~SCVectorSimpleSubBlockIter();
00204 int i();
00205 int j();
00206 double get();
00207 void set(double);
00208 operator int();
00209 void operator++();
00210 void reset();
00211 };
00212
00213 }
00214
00215 #endif
00216
00217 // Local Variables:
00218 // mode: c++
00219 // c-file-style: "CLJ"
00220 // End:
Generated at Fri Jan 10 08:14:08 2003 for MPQC 2.1.3 using the documentation package Doxygen 1.2.14. |