C++ main module for mmsd Package  1.0
LAP_2DView.h
Go to the documentation of this file.
1 #ifndef LAP_2DView_H
2 #define LAP_2DView_H
3 
4 
5 #include "LAP_Object.h"
6 #include "LAP_View.h"
7 
14 class LAP_2DView : public virtual LAP_Object {
15  SP_OBJECT(LAP_2DView);
16 
17 private:
18 
19 
20  LAP_View mView[2];
21 
22  // ASSOCIATIONS
23 
24 public:
25  // METHODS
26 
27  // CONSTRUCTORS
28 
30  LAP_2DView(void) {
31 
32  };
33 
34 
35 
36 
37  // DESTRUCTORS
38 
39 
42  virtual ~LAP_2DView() {
43  };
44 
45 
46 public:
47 
48  // CONSTRUCTOR
51  inline static SP::LAP_2DView New() {
52  SP::LAP_2DView p(new LAP_2DView(),LAP_2DView::Delete());
53  p->setThis(p);
54  return p;
55  };
58  inline static SP::LAP_2DView New(const tLVectorIndex& startx,
59  const tLVectorIndex& endx,
60  const tLVectorIncrement& incrementx,
61  const tLVectorIndex& starty,
62  const tLVectorIndex& endy,
63  const tLVectorIncrement& incrementy) {
64  SP::LAP_2DView p(new LAP_2DView(),LAP_2DView::Delete());
65  p->setThis(p);
66  p->setView(0,startx,endx,incrementx);
67  p->setView(1,starty,endy,incrementy);
68  return p;
69  };
70 
71  // operators get the i-th value of the vector without view
74  inline const LAP_View& operator[](const tFlag& i) const {
75  ASSERT_IN(i<2)
76  return mView[i];
77  };
80  inline LAP_View& operator[](const tFlag& i) {
81  ASSERT_IN(i<2);
82  return mView[i];
83  };
84 
85 
86  // SET methods
87 
90  inline void copy(const LAP_2DView& v) {
91  for (tFlag k=0;k<2;k++) mView[k].copy(v[k]);
92  }
93 
94 
97  inline void setView(const tFlag& k,const tLVectorIndex& start,const tLVectorIndex& end,const tLVectorIncrement& inc) {
98  mView[k].setView(start,end,inc);
99  };
102  inline void setView(const tFlag& k,const tLVectorIndex& start,const tLVectorIndex& end) {
103  mView[k].setView(start,end);
104  };
105 
106 
107 
110  inline void setLVectorIncrement(const tFlag& d,const tLVectorIncrement& inc) {
111  mView[d].setLVectorIncrement(inc);
112  };
113 
114 
117  inline const tLVectorIncrement& getIncrement(const tFlag& d) const {
118  return mView[d].getIncrement();
119  };
122  inline const tLVectorIndex& getStart(const tFlag& d) const {
123  return mView[d].getStart();
124  };
127  inline const tLVectorIndex& getEnd(const tFlag& d) const {
128  return mView[d].getEnd();
129  };
130 
133  inline tLVectorIndex getSize(const tFlag& d) const {
134  return mView[d].getSize();
135  };
136 
137  // OTHERS Methods
138 
141  virtual tString toString() const {
142  return getIdentityString()+"view_row:"+mView[0].toString()+" view_column:"+mView[1].toString();
143  }
144 
145 };
146 #endif
This class is a view of a pointer.
Definition: LAP_View.h:14
const LAP_View & operator[](const tFlag &i) const
get the value for reading only
Definition: LAP_2DView.h:74
virtual tString toString() const
turn into string
Definition: LAP_2DView.h:141
const tLVectorIndex & getStart() const
get the start index of the first element in [start,end[
Definition: LAP_View.h:130
void setView(const tLVectorIndex &start, const tLVectorIndex &end, const tLVectorIndex &inc)
set the the view the element considered are in [start,end[ with increment inc
Definition: LAP_View.h:88
LAP_2DView(void)
create an object
Definition: LAP_2DView.h:30
void setLVectorIncrement(const tLVectorIncrement &inc)
set the increment of the view
Definition: LAP_View.h:107
const tLVectorIncrement & getIncrement() const
get increment
Definition: LAP_View.h:125
LAP_View & operator[](const tFlag &i)
get the value for reading only
Definition: LAP_2DView.h:80
tString getIdentityString() const
return the identity string of the object of the form className_at_address
Definition: CORE_Object.h:136
This class is the base class of all lapack objects.
Definition: LAP_Object.h:17
void setView(const tFlag &k, const tLVectorIndex &start, const tLVectorIndex &end, const tLVectorIncrement &inc)
set the indices in direction k
Definition: LAP_2DView.h:97
void setLVectorIncrement(const tFlag &d, const tLVectorIncrement &inc)
set the index : increment in direction k
Definition: LAP_2DView.h:110
const tLVectorIndex & getStart(const tFlag &d) const
get the start index in direction k
Definition: LAP_2DView.h:122
DEFINE_SPTR(LAP_2DView)
virtual ~LAP_2DView()
destroy an object.
Definition: LAP_2DView.h:42
#define tLVectorIndex
Definition: lapack_types.h:13
const tLVectorIncrement & getIncrement(const tFlag &d) const
get increment in direction k
Definition: LAP_2DView.h:117
void setView(const tFlag &k, const tLVectorIndex &start, const tLVectorIndex &end)
set the indices in direction k
Definition: LAP_2DView.h:102
#define tString
Definition: types.h:49
const tLVectorIndex & getEnd(const tFlag &d) const
get the end index in direction k
Definition: LAP_2DView.h:127
void copy(const LAP_2DView &v)
copy
Definition: LAP_2DView.h:90
static SP::LAP_2DView New(const tLVectorIndex &startx, const tLVectorIndex &endx, const tLVectorIncrement &incrementx, const tLVectorIndex &starty, const tLVectorIndex &endy, const tLVectorIncrement &incrementy)
Definition: LAP_2DView.h:58
This class is a matrix view.
Definition: LAP_2DView.h:14
#define tLVectorIncrement
Definition: lapack_types.h:16
virtual tString toString() const
turn into string
Definition: LAP_View.h:148
const tLVectorIndex & getEnd() const
get the end index of the last element in [start,end[
Definition: LAP_View.h:135
tLVectorIndex getSize(const tFlag &d) const
Definition: LAP_2DView.h:133
tLVectorIndex getSize() const
Definition: LAP_View.h:141
static SP::LAP_2DView New()
Definition: LAP_2DView.h:51
#define ASSERT_IN(a)
Definition: types.h:96
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14