12template <
typename Real,
int NumRows,
int NumCols>
13class LexicoArray2<true, Real, NumRows, NumCols>
16 inline LexicoArray2(Real* matrix);
18 inline int GetNumRows()
const;
19 inline int GetNumCols()
const;
20 inline Real& operator()(
int r,
int c);
21 inline Real
const& operator()(
int r,
int c)
const;
27template <
typename Real,
int NumRows,
int NumCols>
28class LexicoArray2<false, Real, NumRows, NumCols>
31 inline LexicoArray2(Real* matrix);
33 inline int GetNumRows()
const;
34 inline int GetNumCols()
const;
35 inline Real& operator()(
int r,
int c);
36 inline Real
const& operator()(
int r,
int c)
const;
43template <
typename Real>
inline
44LexicoArray2<true, Real>::LexicoArray2(
int numRows,
int numCols, Real* matrix)
52template <
typename Real>
inline
53int LexicoArray2<true, Real>::GetNumRows()
const
58template <
typename Real>
inline
59int LexicoArray2<true, Real>::GetNumCols()
const
64template <
typename Real>
inline
65Real& LexicoArray2<true, Real>::operator()(
int r,
int c)
67 return mMatrix[c + mNumCols*r];
70template <
typename Real>
inline
71Real
const& LexicoArray2<true, Real>::operator()(
int r,
int c)
const
73 return mMatrix[c + mNumCols*r];
78template <
typename Real>
inline
79LexicoArray2<false, Real>::LexicoArray2(
int numRows,
int numCols, Real* matrix)
87template <
typename Real>
inline
88int LexicoArray2<false, Real>::GetNumRows()
const
93template <
typename Real>
inline
94int LexicoArray2<false, Real>::GetNumCols()
const
99template <
typename Real>
inline
100Real& LexicoArray2<false, Real>::operator()(
int r,
int c)
102 return mMatrix[r + mNumRows*c];
105template <
typename Real>
inline
106Real
const& LexicoArray2<false, Real>::operator()(
int r,
int c)
const
108 return mMatrix[r + mNumRows*c];
113template <
typename Real,
int NumRows,
int NumCols>
inline
114LexicoArray2<true, Real, NumRows, NumCols>::LexicoArray2(Real* matrix)
120template <
typename Real,
int NumRows,
int NumCols>
inline
121int LexicoArray2<true, Real, NumRows, NumCols>::GetNumRows()
const
126template <
typename Real,
int NumRows,
int NumCols>
inline
127int LexicoArray2<true, Real, NumRows, NumCols>::GetNumCols()
const
132template <
typename Real,
int NumRows,
int NumCols>
inline
133Real& LexicoArray2<true, Real, NumRows, NumCols>::operator()(
int r,
int c)
135 return mMatrix[c + NumCols*r];
138template <
typename Real,
int NumRows,
int NumCols>
inline
139Real
const& LexicoArray2<true, Real, NumRows, NumCols>::operator()(
int r,
int c)
const
141 return mMatrix[c + NumCols*r];
146template <
typename Real,
int NumRows,
int NumCols>
inline
147LexicoArray2<false, Real, NumRows, NumCols>::LexicoArray2(Real* matrix)
153template <
typename Real,
int NumRows,
int NumCols>
inline
154int LexicoArray2<false, Real, NumRows, NumCols>::GetNumRows()
const
159template <
typename Real,
int NumRows,
int NumCols>
inline
160int LexicoArray2<false, Real, NumRows, NumCols>::GetNumCols()
const
165template <
typename Real,
int NumRows,
int NumCols>
inline
166Real& LexicoArray2<false, Real, NumRows, NumCols>::operator()(
int r,
int c)
168 return mMatrix[r + NumRows*c];
171template <
typename Real,
int NumRows,
int NumCols>
inline
172Real
const& LexicoArray2<false, Real, NumRows, NumCols>::operator()(
int r,
int c)
const
174 return mMatrix[r + NumRows*c];