source: ThirdParty/mpqc_open/src/lib/math/scmat/blkiter.h@ 251420

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 251420 was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 5.1 KB
Line 
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
37namespace sc {
38
39class SCMatrixRectBlock;
40class SCMatrixLTriBlock;
41class SCMatrixDiagBlock;
42class SCVectorSimpleBlock;
43
44class SCElementOp;
45class SCElementOp2;
46class SCElementOp3;
47
48/** The SCMatrixBlockIter class is used to described iterates that
49 loop through the elements in a block. */
50class SCMatrixBlockIter {
51 public:
52 SCMatrixBlockIter() {}
53 virtual ~SCMatrixBlockIter();
54 /// Returns the row index.
55 virtual int i() = 0;
56 /// Returns the column index.
57 virtual int j() = 0;
58 /// Set the current element to val.
59 virtual void set(double val) = 0;
60 /// Add val to the current element.
61 virtual void accum(double val);
62 /// Return the value of the current element.
63 virtual double get() = 0;
64 /// Return nonzero if there are more elements.
65 virtual operator int() = 0;
66 /// Move to the next element.
67 virtual void operator++() = 0; // prefix ++
68 void operator++(int) { operator++(); }
69 /// Start the iteration over.
70 virtual void reset() = 0;
71};
72
73class SCMatrixRectBlockIter: public SCMatrixBlockIter {
74 private:
75 SCMatrixRectBlock* block;
76 int i_;
77 int block_index;
78 int j_;
79 public:
80 SCMatrixRectBlockIter(SCMatrixRectBlock*);
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
91class SCMatrixRectSubBlockIter: public SCMatrixBlockIter {
92 private:
93 SCMatrixRectSubBlock* block;
94 int i_;
95 int block_index;
96 int j_;
97 public:
98 SCMatrixRectSubBlockIter(SCMatrixRectSubBlock*);
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
109class SCMatrixLTriBlockIter: public SCMatrixBlockIter {
110 private:
111 SCMatrixLTriBlock* block;
112 int block_index;
113 int i_;
114 int j_;
115 public:
116 SCMatrixLTriBlockIter(SCMatrixLTriBlock*);
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
127class SCMatrixLTriSubBlockIter: public SCMatrixBlockIter {
128 private:
129 SCMatrixLTriSubBlock* block;
130 int block_index;
131 int i_;
132 int j_;
133 public:
134 SCMatrixLTriSubBlockIter(SCMatrixLTriSubBlock*);
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
145class SCMatrixDiagBlockIter: public SCMatrixBlockIter {
146 private:
147 SCMatrixDiagBlock* block;
148 int block_index;
149 int i_;
150 public:
151 SCMatrixDiagBlockIter(SCMatrixDiagBlock*);
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
162class SCMatrixDiagSubBlockIter: public SCMatrixBlockIter {
163 private:
164 SCMatrixDiagSubBlock* block;
165 int block_index;
166 int i_;
167 public:
168 SCMatrixDiagSubBlockIter(SCMatrixDiagSubBlock*);
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
179class SCVectorSimpleBlockIter: public SCMatrixBlockIter {
180 private:
181 SCVectorSimpleBlock* block;
182 int block_index;
183 int i_;
184 public:
185 SCVectorSimpleBlockIter(SCVectorSimpleBlock*);
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
196class SCVectorSimpleSubBlockIter: public SCMatrixBlockIter {
197 private:
198 SCVectorSimpleSubBlock* block;
199 int block_index;
200 int i_;
201 public:
202 SCVectorSimpleSubBlockIter(SCVectorSimpleSubBlock*);
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:
Note: See TracBrowser for help on using the repository browser.