SyTen
syten::OffsetDenseTensorImpl::OffsetDenseTensor< rank, Scalar > Struct Template Reference

Implementation for syten::OffsetDenseTensor. More...

#include <offset.h>

+ Collaboration diagram for syten::OffsetDenseTensorImpl::OffsetDenseTensor< rank, Scalar >:

Public Types

typedef std::array< Index, rankCoord
 A set of indices uniquely describing one element. More...
 

Public Member Functions

Scalar * begin ()
 Pointer to start of data array. More...
 
const Scalar * begin () const
 Pointer to start of const array. More...
 
const Scalar * cbegin () const
 Pointer to start of const array. More...
 
const Scalar * cend () const
 Pointer one past the end of const array. More...
 
Index dim (Index which) const
 Return the size of the which-th dimension, 1-indexed. More...
 
Scalar * end ()
 Pointer one past the end of array. More...
 
const Scalar * end () const
 Pointer one past the end of const array. More...
 
DynArray< Scalar > & get_data ()
 Returns a writeable reference to the private data member. More...
 
DynArray< Scalar > const & get_data () const
 Returns a const reference to the private data member. More...
 
Index getCoordinate (Coord coordinates) const
 Given a set of indices coordinates, return the associated linear coordinate. More...
 
 OffsetDenseTensor ()=default
 Default ctor. More...
 
 OffsetDenseTensor (Coord dims_, Size ioffset_, Size foffset_, DynArray< Scalar > &&data_)
 Ctor stealing a DynArray from another place. More...
 
 OffsetDenseTensor (Coord dims_, Size ioffset_, Size foffset_, Init do_init_=Init::Yes)
 Ctor with possibility to request calloc()-based memory allocation for the contained array. More...
 
 OffsetDenseTensor (OffsetDenseTensor &&other)
 move ctor More...
 
 OffsetDenseTensor (OffsetDenseTensor const &other)
 copy ctor More...
 
 operator DenseTensor< rank, Scalar > () const
 conversion operator to a standard dense tensor More...
 
OffsetDenseTensoroperator= (OffsetDenseTensor &&other)
 move assignment operator More...
 
OffsetDenseTensoroperator= (OffsetDenseTensor const &other)
 copy assignment operator More...
 
Scalar const & operator[] (Coord coordinates) const
 Return the element at specified coordinate, viewed over the full tensor. More...
 
Scalar & operator[] (Size sz)
 Return the element at specified index position of the data array (i.e., offset by ioffset as compared to the function above). More...
 
Scalar const & operator[] (Size sz) const
 Return the element at specified index position of the data array (i.e., offset by ioffset as compared to the function above). More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int in_version)
 Boost serialisation support. More...
 
Size size () const
 Returns the number of stored elements. More...
 

Public Attributes

Coord dims
 Dimensions of the tensor. More...
 
Size foffset
 Number of final zeros. More...
 
Size ioffset
 Number of leading zero. More...
 

Static Public Attributes

static constexpr unsigned int version = 3
 Bump this if any of the above change. More...
 

Private Attributes

DynArray< Scalar > data
 Stored data elements. More...
 
Scalar const zero = 0.
 Constant reference to a zero element. More...
 

Detailed Description

template<Rank rank, typename Scalar = SDef>
struct syten::OffsetDenseTensorImpl::OffsetDenseTensor< rank, Scalar >

Implementation for syten::OffsetDenseTensor.


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