genericIO
hypercube.h
1 #ifndef HYPERCUBE_H
2 #define HYPERCUBE_H 1
3 #include<axis.h>
4 #include<memory>
5 #include <vector>
6 #include <sstream>
7 namespace SEP{
8 class hypercube{
9 
10  public:
11  hypercube(){}
12  hypercube(const hypercube &hyper);
13  hypercube(const std::shared_ptr<hypercube>& hyper);
14  hypercube(const SEP::axis &a1){ std::vector<SEP::axis> as; as.push_back(a1); setAxes(as);}
15  hypercube(const SEP::axis &a1,SEP::axis &a2){
16  std::vector<SEP::axis> as; as.push_back(a1); as.push_back(a2) ;setAxes(as);
17  }
18  hypercube(const SEP::axis &a1,SEP::axis &a2,SEP::axis &a3){
19  std::vector<SEP::axis> as; as.push_back(a1); as.push_back(a2) ;
20  as.push_back(a3);
21  setAxes(as);
22  }
23  hypercube(const std::vector<SEP::axis>&axes);
24  void setAxes(const std::vector<SEP::axis>& axes) ;
25  void setAxis(const int idim, const SEP::axis &ax);
26  SEP::axis getAxis(int idim) const;
27  long long getN123() const {return n123;}
28  void infoStream(std::stringstream &x);
29  std::vector<int> getNs() const;
30  void shrinkDimension(const int nmax){
31  axes.resize(nmax);
32  }
33 
34  void addAxis(axis & a){
35  axes.push_back(a);
36  }
37  void deallocate(){
38  axes.clear();
39  }
40  ~hypercube(){
41  this->deallocate();
42  }
43 
44  void initNd(const std::vector<SEP::axis>& axes);
45  std::vector<SEP::axis> returnAxes(const int nmax) const;
46  int getNdim() const {return axes.size();}
47  int getNdimG1() const;
48  std::vector<SEP::axis> getAxes() const;
49  std::vector<SEP::axis> getAxes(const int nmin)const;
50  bool sameSize(const hypercube &other) const;
51  bool sameSize(const std::shared_ptr<hypercube>&other) const;
52 
53  protected:
54  long long n123;
55  std::vector<SEP::axis> axes;
56 
57 };
58 
59 }
60 #endif
61 
Definition: hypercube.h:8
Definition: axis.h:10
Definition: axis.h:8