1 #ifndef OST_TRI_MATRIX_HH
2 #define OST_TRI_MATRIX_HH
16 data_((n*(n+1))/2, def_val), n_(n)
19 void Set(
int i,
int j,
const T& sim)
21 data_[this->GetIndex(i, j)]=sim;
24 const T&
Get(
int i,
int j)
const
26 return data_[this->GetIndex(i, j)];
31 return data_[this->GetIndex(i, j)];
36 return data_[this->GetIndex(i, j)];
48 int GetIndex(
int i,
int j)
const {
53 return ((2*n_-j+1)*j)/2+i-j;
const T & Get(int i, int j) const
TriMatrix(int n, const T &def_val=T())
triangular matrix template
std::vector< T > & Data()
T & operator()(int i, int j)
const T & operator()(int i, int j) const
void Set(int i, int j, const T &sim)