Turi Create  4.0
turi::symmetric_2d_array< T > Class Template Reference

#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
 

Detailed Description

template<typename T>
class turi::symmetric_2d_array< T >

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) /

  1. Individual manipulation of elements is all that is supported.

Definition at line 20 of file symmetric_2d_array.hpp.


The documentation for this class was generated from the following file: