24 #include <tjutils/tjvector.h>
25 #include <tjutils/tjlog.h>
41 class ndim :
public STD_vector<unsigned long> {
55 ndim (
const ndim& mm) : STD_vector<unsigned long>(mm) {}
62 ndim (
const STD_string& s);
68 unsigned long dim()
const {
return size();}
74 operator STD_string ()
const;
79 friend STD_ostream&
operator << (STD_ostream& s,
const ndim& nn) {
return s << STD_string(nn);}
155 template<
class V,
class T>
class tjarray :
public V {
172 tjarray (
unsigned long n1,
unsigned long n2);
173 tjarray (
unsigned long n1,
unsigned long n2,
unsigned long n3);
174 tjarray (
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4);
175 tjarray (
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4,
unsigned long n5);
236 tjarray<V,T>&
redim (
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4);
237 tjarray<V,T>&
redim (
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4,
unsigned long n5);
273 T&
operator () (
unsigned long n1,
unsigned long n2);
274 T&
operator () (
unsigned long n1,
unsigned long n2,
unsigned long n3);
275 T&
operator () (
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4);
276 T&
operator () (
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4,
unsigned long n5);
284 const T&
operator () (
unsigned long n1,
unsigned long n2)
const;
285 const T&
operator () (
unsigned long n1,
unsigned long n2,
unsigned long n3)
const;
286 const T&
operator () (
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4)
const;
287 const T&
operator () (
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4,
unsigned long n5)
const;
294 unsigned long dim()
const;
301 unsigned long size(
unsigned long i)
const;
342 return s << ta.
get_extent() <<
"=" << ta.printbody();
356 static ndim create_extent(
unsigned long n1);
357 static ndim create_extent(
unsigned long n1,
unsigned long n2);
358 static ndim create_extent(
unsigned long n1,
unsigned long n2,
unsigned long n3);
359 static ndim create_extent(
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4);
360 static ndim create_extent(
unsigned long n1,
unsigned long n2,
unsigned long n3,
unsigned long n4,
unsigned long n5);
unsigned long total() const
unsigned long extent2index(const ndim &mm) const
bool operator!=(const ndim &nn) const
unsigned long dim() const
ndim(const STD_string &s)
ndim & add_dim(unsigned long e, bool first=false)
friend STD_ostream & operator<<(STD_ostream &s, const ndim &nn)
ndim index2extent(unsigned long index) const
bool operator==(const ndim &nn) const
ndim & reduce(unsigned long dim)
unsigned long dim() const
tjarray(const tjarray< V, T > &ta)
unsigned long length() const
unsigned int elementsize() const
T & operator()(const ndim &ii)
ndim create_index(unsigned long index) const
tjarray(unsigned long n1)
tjarray< V, T > & operator=(const tjarray< V, T > &ta)
tjarray< V, T > & assignValues(const tjarray< V, T > &ta)
unsigned long total() const
tjarray< V, T > & redim(const ndim &nn)
friend STD_ostream & operator<<(STD_ostream &s, const tjarray< V, T > &ta)
tjarray< V, T > & copy(const tjarray< V, T > &ta)
V & resize(unsigned int newsize)
unsigned long size(unsigned long i) const
tjarray< V, T > & autosize()
tjarray< V, T > & redim(unsigned long n1)
const ndim & get_extent() const
tjarray< ivector, int > iarray
tjarray< svector, STD_string > sarray
STD_string print_table(const sarray &table)
sarray parse_table(const STD_string &str)
tjarray< cvector, STD_complex > carray
tjarray< dvector, double > darray
tjarray< fvector, float > farray