29 #define sm2v(i, j, size) ((i)*(size)-((i)-1)*(i)/2+(j)-(i)) 42 data = size > 0 ?
new T[size * (size + 1) / 2]() : NULL;
51 T &
at(
const size_t i,
const size_t j) {
58 T
at(
const size_t i,
const size_t j)
const {
64 T &
at(
const size_t i) {
70 T
at(
const size_t i)
const {
77 T *
vectat(
const size_t i,
const size_t j) {
#define sm2v(i, j, size)
map a 2D square matrix coorinate pair (i, j) into a 1D array coordinate; size denotes the size of the...
Definition: symmatrix.h:29
size_t size
Definition: symmatrix.h:87
T * vectat(const size_t i, const size_t j)
return the pointer to the element at position ( i, j ) of the array representing the matrix...
Definition: symmatrix.h:77
T at(const size_t i) const
return the element at position i of the array representing the matrix for right-hand operation...
Definition: symmatrix.h:70
T * data
Definition: symmatrix.h:86
Definition: symmatrix.h:35
T at(const size_t i, const size_t j) const
return the element at position ( i, j ) for right-hand operation.
Definition: symmatrix.h:58
SymMatrix(size_t size)
default constructor: allocate an array of size size*(size+1)/2.
Definition: symmatrix.h:40
T & at(const size_t i, const size_t j)
return the element at position ( i, j ) for left-hand operation.
Definition: symmatrix.h:51
T & at(const size_t i)
return the element at position i of the array representing the matrix for left-hand operation...
Definition: symmatrix.h:64
size_t get_size() const
return matrix size.
Definition: symmatrix.h:82
~SymMatrix()
Definition: symmatrix.h:44