#include <noblitz.h>

Public Member Functions | |
| Array () | |
| Array (const Array< T, 3 > &a) | |
| ~Array () | |
| T & | operator() (const int &i, const int &j, const int &k) |
| const T & | operator() (const int &i, const int &j, const int &k) const |
| T & | operator[] (const int &i) |
| const T & | operator[] (const int &i) const |
| Array< T, 3 > | operator* (const real &d) const |
| Array< T, 3 > | operator- (const Array< T, 3 > &a) const |
| Array< T, 3 > & | operator-= (const Array< T, 3 > &a) |
| Array< T, 3 > | operator+ (const Array< T, 3 > &a) const |
| Array< T, 3 > & | operator*= (const real &d) |
| Array< T, 3 > & | operator+= (const Array< T, 3 > &a) |
| VarShape< 3 > & | shape () |
| void | resize (const int &ni, const int &nj, const int &nk) |
| const VarShape< 3 > & | shape () const |
| Array< T, 3 > & | operator= (const Array< T, 3 > &a) |
| Array< T, 3 > & | operator= (const real &d) |
Private Attributes | |
| T *** | array |
| T * | the_array |
| VarShape< 3 > | s |
Definition at line 43 of file noblitz.h.
| T& Array< T, 3 >::operator() | ( | const int & | i, | |
| const int & | j, | |||
| const int & | k | |||
| ) | [inline] |
| const T& Array< T, 3 >::operator() | ( | const int & | i, | |
| const int & | j, | |||
| const int & | k | |||
| ) | const [inline] |
| T& Array< T, 3 >::operator[] | ( | const int & | i | ) | [inline] |
| const T& Array< T, 3 >::operator[] | ( | const int & | i | ) | const [inline] |
Definition at line 101 of file noblitz.h.
00101 { 00102 assert((shape()[0]==a.shape()[0]) 00103 &&(shape()[1]==a.shape()[1]) 00104 &&(shape()[2]==a.shape()[2])); 00105 00106 Array<T,3> temp; 00107 temp.resize(shape()[0],shape()[1],shape()[2]); 00108 for (int i=0; i<shape()[0]*shape()[1]*shape()[2]; i++) { 00109 temp.the_array[i] 00110 = the_array[i] - a.the_array[i]; 00111 } 00112 return temp; 00113 }
Definition at line 115 of file noblitz.h.
00115 { 00116 assert((shape()[0]==a.shape()[0]) 00117 &&(shape()[1]==a.shape()[1]) 00118 &&(shape()[2]==a.shape()[2])); 00119 00120 for (int i=0; i<shape()[0]*shape()[1]*shape()[2]; i++){ 00121 the_array[i] -= a.the_array[i]; 00122 } 00123 return *this; 00124 }
Definition at line 126 of file noblitz.h.
00126 { 00127 assert((shape()[0]==a.shape()[0]) 00128 &&(shape()[1]==a.shape()[1]) 00129 &&(shape()[2]==a.shape()[2])); 00130 00131 Array<T,3> temp; 00132 temp.resize(shape()[0],shape()[1],shape()[2]); 00133 for (int i=0; i<shape()[0]*shape()[1]*shape()[2]; i++) { 00134 temp.the_array[i] 00135 = the_array[i] + a.the_array[i]; 00136 } 00137 return temp; 00138 }
Definition at line 148 of file noblitz.h.
00148 { 00149 assert((shape()[0]==a.shape()[0]) 00150 &&(shape()[1]==a.shape()[1]) 00151 &&(shape()[2]==a.shape()[2])); 00152 00153 for (int i=0; i<shape()[0]*shape()[1]*shape()[2]; i++) { 00154 the_array[i] += a.the_array[i]; 00155 } 00156 return *this; 00157 }
| void Array< T, 3 >::resize | ( | const int & | ni, | |
| const int & | nj, | |||
| const int & | nk | |||
| ) | [inline] |
Definition at line 163 of file noblitz.h.
00163 { 00164 if ((ni != shape()[0])&&(nj != shape()[1])&&(nk != shape()[2])) { 00165 00166 // clean memory. 00167 if (shape()[0] > 0) { 00168 for (int i=0; i<shape()[0]; i++) 00169 if (shape()[1] > 0) { 00170 delete [] array[i]; 00171 } 00172 delete [] array; 00173 delete [] the_array; 00174 } 00175 00176 shape()[0] = ni; 00177 shape()[1] = nj; 00178 shape()[2] = nk; 00179 array = new T**[ni]; 00180 00181 the_array = new T[ni*nj*nk]; 00182 00183 for (int i=0; i<ni; i++) 00184 array[i] = new T*[nj]; 00185 for (int i=0; i<ni; i++) 00186 for (int j=0; j<nj; j++) 00187 array[i][j] = &the_array[i*nj*nk + j*nk]; 00188 } 00189 }
Definition at line 195 of file noblitz.h.
00195 { 00196 00197 if (this != &a) { // if Vectors are the same one don't do anythings 00198 resize(a.shape()[0], a.shape()[1], a.shape()[2]); 00199 for (int i=0; i<a.shape()[0]*shape()[1]*shape()[2]; i++) 00200 the_array[i] = a.the_array[i]; 00201 } 00202 00203 return *this; 00204 }
1.5.6