Revision 1131 trunk/src/linad99/d4arr.hpp

d4arr.hpp (revision 1131)
43 43
 * Description not yet available.
44 44
 */
45 45
#ifndef D4ARR_HPP
46
  #define D4ARR_HPP
47
#ifndef USE_CONST
48
  #ifdef _CONST
49
    #undef _CONST
50
  #endif
51
  #define USE_CONST
52
  #define _CONST const
53
#endif
46
#define D4ARR_HPP
54 47

  
55 48
/**
56 49
 * Description not yet available.
......
131 124
    {
132 125
      return ( ((*this)(i,j,k))(l));
133 126
    }
134
    #ifdef USE_CONST
135 127
     inline const d3_array& operator()(int i) const { return t[i]; }
136 128
     inline const d3_array& operator[](int i) const { return t[i]; }
137 129
     inline const dmatrix& operator()(int i, int j) const { return ((*this)(i))(j); }
......
140 132
     {
141 133
       return (((*this)(i, j, k))(l));
142 134
     }
143
    #endif
144 135
  #else
145
    #ifdef USE_CONST
146 136
      const d3_array& operator()(int i) const;
147 137
      const d3_array& operator[](int i) const;
148 138
      const dmatrix& operator()(int i, int j) const;
149 139
      const dvector& operator()(int i, int j, int k) const;
150 140
      const double& operator()(int i, int j, int k, int l) const;
151
    #endif
152 141
    d3_array& operator ( ) (int);
153 142
    d3_array& operator [] (int);
154 143
    dmatrix& operator ( ) (int,int);
......
169 158
  int slicesize() {return (shape->slice_max-shape->slice_min+1);} // returns the number of rows
170 159
  int rowsize() {return (shape->row_max-shape->row_min+1);} // returns the number of rows
171 160
  int colsize() {return (shape->col_max-shape->col_min+1);} // returns the number of columns
172
 #ifdef USE_CONST
173 161
  int hslicemin(void) const { return (shape->hslice_min); }
174 162
  int hslicemax(void) const { return (shape->hslice_max); }
175 163
  int slicemin(void) const { return (shape->slice_min); }
......
182 170
  int slicesize() const { return (shape->slice_max-shape->slice_min + 1); } // returns the number of rows
183 171
  int rowsize() const { return (shape->row_max-shape->row_min + 1); } // returns the number of rows
184 172
  int colsize() const { return (shape->col_max-shape->col_min + 1); } // returns the number of columns
185
 #endif
186 173
  void initialize(void);
187 174
};
188 175

  
......
238 225
    {
239 226
      return ( ((*this)(i,j,k))(l));
240 227
    }
241
    #ifdef USE_CONST
242 228
     inline const dvar3_array& operator()(int i) const { return t[i]; }
243 229
     inline const dvar3_array& operator[](int i) const { return t[i]; }
244 230
     inline const dvar_matrix& operator()(int i, int j) const { return ((*this)(i))(j); }
......
247 233
     {
248 234
       return ( ((*this)(i,j,k))(l));
249 235
     }
250
    #endif
251 236
  #else
252
    #ifdef USE_CONST
253 237
      const dvar3_array& operator()(int i) const;
254 238
      const dvar3_array& operator[](int i) const;
255 239
      const dvar_matrix& operator()(int i, int j) const;
256 240
      const dvar_vector& operator()(int i, int j, int k) const;
257 241
      const prevariable operator()(int i, int j, int k, int l) const;
258
    #endif
259 242
    dvar3_array& operator ( ) (int);
260 243
    dvar3_array& operator [] (int);
261 244
    dvar_matrix& operator ( ) (int,int);
......
276 259
  int slicesize() {return (shape->slice_max-shape->slice_min+1);} // returns the number of rows
277 260
  int rowsize() {return (shape->row_max-shape->row_min+1);} // returns the number of rows
278 261
  int colsize() {return (shape->col_max-shape->col_min+1);} // returns the number of columns
279
 #ifdef USE_CONST
280 262
  int hslicemin(void) const { return (shape->hslice_min); }
281 263
  int hslicemax(void) const { return (shape->hslice_max); }
282 264
  int slicemin(void) const { return (shape->slice_min); }
......
289 271
  int slicesize() const { return (shape->slice_max-shape->slice_min + 1); } // returns the number of rows
290 272
  int rowsize() const { return (shape->row_max-shape->row_min + 1); } // returns the number of rows
291 273
  int colsize() const { return (shape->col_max-shape->col_min + 1); } // returns the number of columns
292
 #endif
293 274
  void initialize(void);
294 275
};
295 276

  

Also available in: Unified diff