7 #ifndef NUMCXX_TARRAY2_H 8 #define NUMCXX_TARRAY2_H 66 TArray2(
const std::initializer_list<std::initializer_list<T>> &il ):
TArray<T>(il){};
83 static std::shared_ptr<TArray2 <T> >
create(
index n0,
index n1) {
return std::make_shared<TArray2 <T> >(n0,n1);}
87 static std::shared_ptr<TArray2 <T> >
create(
const std::initializer_list<std::initializer_list<T>> &il) {
return std::make_shared<TArray2 <T> >(il);}
92 std::shared_ptr<TArray2 <T> >
copy()
const {
return std::make_shared<TArray2 <T> >(*this);}
std::shared_ptr< TArray2< T > > clone() const
Create a clone of the array.
TArray2(index n0, index n1, T *data, std::shared_ptr< void > datamanager)
Construct a 2D array from data pointer.
index _idx(index i0) const
1D Array index calculation with optional bounds check.
TArray is the common template base class for arrays and dense matrices of the numcxx project...
static std::shared_ptr< TArray2< T > > create(index n0, index n1)
Construct empty 2D Array.
TArray2< T > & operator=(const TArray2< T > &expr)
Assignment operator.
TArray2(index n0, index n1)
Construct an empty 2D array.
T item(index i0, index i1)
Element read access.
TArray2(index n0, index n1, T *data, std::function< void(T *p)> deleter)
Construct a 2D array from data pointer.
One dimensional array class.
TArray2(const std::initializer_list< std::initializer_list< T >> &il)
Construct 2D Array from std::initializer list.
TArray2(const TArray2< T > &A)
Copy constructor.
void itemset(index i0, index i1, T x)
Element write access.
TArray< T > & assign(TArray< T > &A, const EXPR &expr, const EXPR *x=0)
index shape(const index dim) const
Obtain shape of array for given dimension.
Two-dimensional array class.
static std::shared_ptr< TArray2< T > > create(const std::initializer_list< std::initializer_list< T >> &il)
Construct 2D Array from std::initializer list.
std::shared_ptr< TArray1< T > > const __getitem__(index i0)
Getter routine for access from python.
std::shared_ptr< TArray2< T > > copy() const
Create a copy of the array.
T * data() const
Obtain C-pointer of data array.
Header for numcxx::TArray.