34 const size_t headsize = Size *
sizeof(*m);
35 const size_t datasize = elements *
sizeof(*(m[0]));
37 m = (
T**)ARB_calloc<char>(headsize+datasize);
38 m[0] = (
T*)(((
char*)m)+headsize);
40 for (
size_t i=1; i<Size; i++) {
49 void set(
size_t i,
size_t j,
T val) {
if (i>j) m[i][j] = val;
else m[j][i] = val; };
52 T get(
size_t i,
size_t j)
const {
if (i>j)
return m[i][j];
else return m[j][i]; };
58 for (
size_t i=0; i<Size; i++) {
59 for (
size_t j=0; j<i; j++) {
60 if (m[i][j] > max) max = m[i][j];
66 size_t size()
const {
return Size; }
71 #error matrix.h included twice
void set(size_t i, size_t j, T val)
CONSTEXPR_INLINE long triangular_number(const long N)
symmetric_matrix(size_t Size_)
T fast_get(size_t i, size_t j) const