8 #error This class is not to be included by the user directly. Use SharedMatrixNd.h or SharedMatrixNf.h instead.
28 CONST_SHAREDMATRIXN(
unsigned rows,
unsigned cols,
unsigned leading_dim,
unsigned start, SharedResizable<REAL> data);
33 REAL norm_inf()
const;
34 unsigned rows()
const {
return _rows; }
35 unsigned columns()
const {
return _columns; }
36 unsigned leading_dim()
const {
return _ld; }
38 const REAL&
operator()(
unsigned i,
unsigned j)
const;
39 const REAL* data()
const {
return _data.get()+_start; }
42 void reset() { _data.reset(); _rows = _start = _columns = _ld = 0; }
44 #include "ConstMatrixCommon.inl"
45 #include "ConstMatrixN.inl"
48 SharedResizable<REAL> _data;
67 SHAREDMATRIXN(
unsigned rows,
unsigned cols,
unsigned leading_dim,
unsigned start, SharedResizable<REAL> data);
71 REAL norm_inf()
const;
74 unsigned rows()
const {
return _rows; }
75 unsigned columns()
const {
return _columns; }
76 unsigned leading_dim()
const {
return _ld; }
87 const REAL&
operator()(
unsigned i,
unsigned j)
const;
88 REAL* data() {
return _data.get()+_start; }
89 const REAL* data()
const {
return _data.get()+_start; }
92 void reset() { _data.reset(); _rows = _start = _columns = _ld = 0; }
94 #define XMATRIXN SHAREDMATRIXN
95 #include "XMatrixN.inl"
97 #define MATRIXX SHAREDMATRIXN
98 #include "MatrixCommon.inl"
102 SharedResizable<REAL> _data;
110 std::ostream& operator<<(std::ostream& out,
const SHAREDMATRIXN& m);
112 std::istream& operator>>(std::istream& in,
SHAREDMATRIXN& m);
const REAL & operator()(unsigned i, unsigned j) const
Accesses the given element.
Definition: SharedMatrixN.cpp:325
void reset_from(const SHAREDMATRIXN &source)
Resets this from another shared matrix.
Definition: SharedMatrixN.cpp:23
void reset_from(const CONST_SHAREDMATRIXN &source)
Resets this from another shared matrix.
Definition: SharedMatrixN.cpp:288
A generic, possibly non-square matrix.
Definition: MatrixN.h:18
SHAREDMATRIXN & resize(unsigned rows, unsigned columns, bool preserve=false)
Resizes this matrix, optionally preserving its existing elements.
Definition: SharedMatrixN.cpp:119
SHAREDMATRIXN & operator/=(REAL scalar)
Divides this matrix by a scalar in place.
Definition: SharedMatrixN.cpp:157
bool is_symmetric(REAL tolerance=(REAL)-1.0) const
Checks whether the given matrix is symmetric to the specified tolerance.
Definition: SharedMatrixN.cpp:180
A generic, possibly non-square matrix using shared data.
Definition: SharedMatrixN.h:59
void reset()
Resets the shared matrix.
Definition: SharedMatrixN.h:92
void reset()
Resets the shared matrix.
Definition: SharedMatrixN.h:42
REAL & operator()(unsigned i, unsigned j)
Accesses the given element.
Definition: SharedMatrixN.cpp:33
SHAREDMATRIXN & zero_lower_triangle()
Zeros the lower triangle of the matrix.
Definition: SharedMatrixN.cpp:217
SHAREDMATRIXN & set_zero()
Sets the matrix to the zero matrix.
Definition: SharedMatrixN.cpp:131
A generic, possibly non-square matrix using constant shared data.
Definition: SharedMatrixN.h:19
SHAREDMATRIXN & operator*=(REAL scalar)
Multiplies this matrix by another in place.
Definition: SharedMatrixN.cpp:140
SHAREDMATRIXN & negate()
Negates this matrix in place.
Definition: SharedMatrixN.cpp:174
SHAREDMATRIXN & operator=(const MATRIX3 &m)
Sets a matrix from a MATRIX3.
Definition: SharedMatrixN.cpp:53
SHAREDMATRIXN & set_identity()
Sets this matrix to the identity matrix.
Definition: SharedMatrixN.cpp:232
A 3x3 matrix that may be used for orientation, inertia tensors, etc.
Definition: Matrix3.h:20
SHAREDMATRIXN & zero_upper_triangle()
Zeros the upper triangle of the matrix.
Definition: SharedMatrixN.cpp:202