ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/math/RectMatrix.hpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/math/RectMatrix.hpp (file contents):
Revision 1630 by tim, Thu Oct 21 21:31:39 2004 UTC vs.
Revision 1644 by tim, Mon Oct 25 22:46:19 2004 UTC

# 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];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines