# | Line 63 | Line 63 | namespace oopse { | |
---|---|---|
63 | data_[i][j] = s; | |
64 | } | |
65 | ||
66 | + | RectMatrix(Real* array) { |
67 | + | for (unsigned int i = 0; i < Row; i++) |
68 | + | for (unsigned int j = 0; j < Col; j++) |
69 | + | data_[i][j] = array[i * Row + j]; |
70 | + | } |
71 | + | |
72 | /** copy constructor */ | |
73 | RectMatrix(const RectMatrix<Real, Row, Col>& m) { | |
74 | *this = m; | |
# | Line 104 | Line 110 | namespace oopse { | |
110 | return data_[i][j]; | |
111 | } | |
112 | ||
113 | + | /** |
114 | + | * Copy the internal data to an array |
115 | + | * @param array the pointer of destination array |
116 | + | */ |
117 | + | void getArray(Real* array) { |
118 | + | for (unsigned int i = 0; i < Row; i++) { |
119 | + | for (unsigned int j = 0; j < Col; j++) { |
120 | + | array[i * Row + j] = data_[i][j]; |
121 | + | } |
122 | + | } |
123 | + | } |
124 | + | |
125 | + | |
126 | /** Returns the pointer of internal array */ | |
127 | Real* getArrayPointer() { | |
128 | return &data_[0][0]; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |