SyTen

◆ OffsetDenseTensor() [2/5]

template<Rank rank, typename Scalar = SDef>
syten::OffsetDenseTensorImpl::OffsetDenseTensor< rank, Scalar >::OffsetDenseTensor ( Coord  dims_,
Size  ioffset_,
Size  foffset_,
Init  do_init_ = Init::Yes 
)
inline

Ctor with possibility to request calloc()-based memory allocation for the contained array.

Pass Init::No to do so, this will be disabled if Scalar is not trivial.

Parameters
dims_dimensions of each index
do_init_initialisation request: Init::Yes uses default ctors in new[], Init::No uses calloc() if Scalar or ScalarBase<Scalar> is trivial and otherwise also new[].
ioffset_initial number of "virtual" zeros
foffset_final number of "virtual" zeros

References syten::OffsetDenseTensorImpl::OffsetDenseTensor< rank, Scalar >::data, syten::OffsetDenseTensorImpl::OffsetDenseTensor< rank, Scalar >::dims, syten::OffsetDenseTensorImpl::OffsetDenseTensor< rank, Scalar >::foffset, and syten::OffsetDenseTensorImpl::OffsetDenseTensor< rank, Scalar >::ioffset.