Turi Create
4.0
|
#include <core/generics/symmetric_2d_array.hpp>
Public Member Functions | |
symmetric_2d_array (size_t _n, const T &default_value=T()) | |
Init the 2d n x n symmetric array with default_value. | |
size_t | size () const |
Return the size of either the rows or the columns. (aka n) | |
size_t | rows () const |
Return the number of rows. (aka n) | |
size_t | cols () const |
Return the number of columns. (aka n) | |
T & | operator() (size_t i, size_t j) |
Access item (i, j) – same as (j, i) – by reference. | |
const T & | operator() (size_t i, size_t j) const |
Access item (i, j) – same as (j, i) – by const reference. | |
void | save (turi::oarchive &oarc) const |
save to disk | |
void | load (turi::iarchive &iarc) |
load from disk | |
A 2d symmetric n by n array that stores the elements in a triangular array. The amount of storage required is only n*(n+1) /
Definition at line 20 of file symmetric_2d_array.hpp.