NUMCXX  0.13.20181108
Numerical library for small projects and teaching purposes
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
numcxx::TArray2< T > Class Template Reference

Description

template<typename T>
class numcxx::TArray2< T >

Two-dimensional array class.

Instances of this class can be created in various ways. The preferred construction of empty array goes like this:

std::shared_ptr<numcxx::TArray2<double>> pA=numcxx::TArray2<double>::create(n,m)

As a derived class from numcxx::TArray<T> it is merely a facade to the content in the base class.

An alias numcxx::DArray2 for numcxx::TArray2<double> is available from numcxx.h.

Definition at line 31 of file tarray2.hxx.

+ Inheritance diagram for numcxx::TArray2< T >:
+ Collaboration diagram for numcxx::TArray2< T >:

Public Types

typedef T value_type
 

Public Member Functions

 TArray2 (index n0, index n1)
 Construct an empty 2D array. More...
 
 TArray2 (index n0, index n1, T *data, std::function< void(T *p)> deleter)
 Construct a 2D array from data pointer. More...
 
 TArray2 (index n0, index n1, T *data, std::shared_ptr< void > datamanager)
 Construct a 2D array from data pointer. More...
 
 TArray2 (const std::initializer_list< std::initializer_list< T >> &il)
 Construct 2D Array from std::initializer list. More...
 
 TArray2 (const TArray2< T > &A)
 Copy constructor. More...
 
TArray2< T > & operator= (const TArray2< T > &expr)
 Assignment operator. More...
 
 TArray2 ()
 
std::shared_ptr< TArray2< T > > copy () const
 Create a copy of the array. More...
 
std::shared_ptr< TArray2< T > > clone () const
 Create a clone of the array. More...
 
item (index i0, index i1)
 Element read access. More...
 
void itemset (index i0, index i1, T x)
 Element write access. More...
 
std::shared_ptr< TArray1< T > > const __getitem__ (index i0)
 Getter routine for access from python. More...
 
bool is_matrix ()
 
T & operator() (const index i0)
 Access operator for 1D arrays. More...
 
const T & operator() (const index i0) const
 
T & operator() (const index i0, const index i1)
 Access operator for 2D arrays. More...
 
const T & operator() (const index i0, const index i1) const
 
index ndim () const
 Obtain tensor dimension of array. More...
 
size_t size () const
 Obtain size of array. More...
 
index shape (const index dim) const
 Obtain shape of array for given dimension. More...
 
template<typename VAL >
void operator+= (const VAL &a)
 Add value to all elements. More...
 
template<typename VAL >
void operator-= (const VAL &a)
 Subtract value from all elements. More...
 
template<typename VAL >
void operator*= (const VAL &a)
 Multiply all elements by value. More...
 
template<typename VAL >
void operator/= (const VAL &a)
 Divide each element by value. More...
 
T & operator[] (const index i)
 Alternative access operator for 1D arrays. More...
 
const T & operator[] (const index i) const
 Const reference to entry for use in expression templates. More...
 
T * data () const
 Obtain C-pointer of data array. More...
 
void resize (size_t n)
 Resize array. More...
 
void savetxt (std::ostream &s) const
 

Static Public Member Functions

static std::shared_ptr< TArray2< T > > create (index n0, index n1)
 Construct empty 2D Array. More...
 
static std::shared_ptr< TArray2< T > > create (const std::initializer_list< std::initializer_list< T >> &il)
 Construct 2D Array from std::initializer list. More...
 
static void operate (std::function< void(T &a, T &b)> f, TArray< T > &A, TArray< T > &B)
 Binary operation on arrays. More...
 
static void operate (std::function< void(T &a, T &b, T &c)> f, TArray< T > &A, TArray< T > &B, TArray< T > &C)
 Ternary operation on arrays. More...
 

Protected Member Functions

void _assert_square () const
 Check if all shapes are the same. More...
 
index _idx (index i0) const
 1D Array index calculation with optional bounds check. More...
 
index _idx (index i0, index i1) const
 2D Array index calculation with optional bounds check. More...
 
index _idx (index i0, index i1, index i2) const
 3D Array index calculation with optional bounds check. More...
 
void _nullify ()
 Nullify contents of array (for move constructors) More...
 
void _setshape (index shape0)
 Set shape of 1D array (for move constructors) More...
 

Protected Attributes

std::function< void(T *p)> _deleter =nullptr
 Deleter method. More...
 
std::shared_ptr< void > _datamanager =nullptr
 Data manager. More...
 
T * _data =nullptr
 Data pointer. More...
 

Member Typedef Documentation

template<typename T>
typedef T numcxx::TArray< T >::value_type
inherited

Definition at line 30 of file tarray.hxx.

Constructor & Destructor Documentation

template<typename T>
numcxx::TArray2< T >::TArray2 ( index  n0,
index  n1 
)
inline

Construct an empty 2D array.

Parameters
n0Number of rows
n1Number of columns

Definition at line 44 of file tarray2.hxx.

44 :TArray<T>(n0,n1) {};
template<typename T>
numcxx::TArray2< T >::TArray2 ( index  n0,
index  n1,
T *  data,
std::function< void(T *p)>  deleter 
)
inline

Construct a 2D array from data pointer.

Parameters
n0Number of rows
n1Number of columns
dataPointer to data.
deleterDeleter method,
See also
TArray<T>::_deleter

Definition at line 52 of file tarray2.hxx.

52 :TArray<T>(n0,n1,data,deleter){};
T * data() const
Obtain C-pointer of data array.
Definition: tarray.hxx:128
template<typename T>
numcxx::TArray2< T >::TArray2 ( index  n0,
index  n1,
T *  data,
std::shared_ptr< void >  datamanager 
)
inline

Construct a 2D array from data pointer.

Parameters
n0Number of rows
n1Number of columns
dataPointer to data.
deleterDeleter method.
See also
TArray<T>::_datamanager

Definition at line 62 of file tarray2.hxx.

62 :TArray<T>(n0,n1,data,datamanager) {};
T * data() const
Obtain C-pointer of data array.
Definition: tarray.hxx:128
template<typename T>
numcxx::TArray2< T >::TArray2 ( const std::initializer_list< std::initializer_list< T >> &  il)
inline

Construct 2D Array from std::initializer list.

Definition at line 66 of file tarray2.hxx.

66 :TArray<T>(il){};
template<typename T>
numcxx::TArray2< T >::TArray2 ( const TArray2< T > &  A)
inline

Copy constructor.

Definition at line 70 of file tarray2.hxx.

70 :TArray2<T>(A.shape(0),A.shape(1)){assign(*this,A);}
TArray< T > & assign(TArray< T > &A, const EXPR &expr, const EXPR *x=0)
Definition: tarray.ixx:35

+ Here is the call graph for this function:

template<typename T>
numcxx::TArray2< T >::TArray2 ( )
inline

Definition at line 77 of file tarray2.hxx.

77 :TArray<T>(){};;

Member Function Documentation

template<typename T>
TArray2<T>& numcxx::TArray2< T >::operator= ( const TArray2< T > &  expr)
inline

Assignment operator.

Definition at line 74 of file tarray2.hxx.

74 { return static_cast<TArray2<T>&>(assign(*this,expr));}
TArray< T > & assign(TArray< T > &A, const EXPR &expr, const EXPR *x=0)
Definition: tarray.ixx:35

+ Here is the call graph for this function:

template<typename T>
static std::shared_ptr<TArray2 <T> > numcxx::TArray2< T >::create ( index  n0,
index  n1 
)
inlinestatic

Construct empty 2D Array.

Mainly for access from python

Definition at line 83 of file tarray2.hxx.

83 { return std::make_shared<TArray2 <T> >(n0,n1);}
template<typename T>
static std::shared_ptr<TArray2 <T> > numcxx::TArray2< T >::create ( const std::initializer_list< std::initializer_list< T >> &  il)
inlinestatic

Construct 2D Array from std::initializer list.

Definition at line 87 of file tarray2.hxx.

87 { return std::make_shared<TArray2 <T> >(il);}
template<typename T>
std::shared_ptr<TArray2 <T> > numcxx::TArray2< T >::copy ( ) const
inline

Create a copy of the array.

Returns
Array of the same size with contents initialized to this

Definition at line 92 of file tarray2.hxx.

92 { return std::make_shared<TArray2 <T> >(*this);}
template<typename T>
std::shared_ptr<TArray2 <T> > numcxx::TArray2< T >::clone ( ) const
inline

Create a clone of the array.

Returns
Array of the same size with empty contents.

Definition at line 97 of file tarray2.hxx.

97 { return create(shape(0),shape(1));}
static std::shared_ptr< TArray2< T > > create(index n0, index n1)
Construct empty 2D Array.
Definition: tarray2.hxx:83
index shape(const index dim) const
Obtain shape of array for given dimension.
Definition: tarray.hxx:68

+ Here is the call graph for this function:

template<typename T>
T numcxx::TArray2< T >::item ( index  i0,
index  i1 
)
inline

Element read access.

Parameters
i0Row index of element to be accessed.
i1Column index of element to be accessed.
Returns
Value of element at (i0,i1)

Definition at line 106 of file tarray2.hxx.

106 { return _data[_idx(i0,i1)];};
index _idx(index i0) const
1D Array index calculation with optional bounds check.
Definition: tarray.ixx:156
T * _data
Data pointer.
Definition: tarray.hxx:186

+ Here is the call graph for this function:

template<typename T>
void numcxx::TArray2< T >::itemset ( index  i0,
index  i1,
x 
)
inline

Element write access.

Parameters
i0Row index of element to be accessed.
i1Column index of element to be accessed.
xvalue to be copied to element at index.

Definition at line 114 of file tarray2.hxx.

114 { _data[_idx(i0,i1)]=x;};
index _idx(index i0) const
1D Array index calculation with optional bounds check.
Definition: tarray.ixx:156
T * _data
Data pointer.
Definition: tarray.hxx:186

+ Here is the call graph for this function:

template<typename T>
std::shared_ptr<TArray1 <T> > const numcxx::TArray2< T >::__getitem__ ( index  i0)
inline

Getter routine for access from python.

This access is rather expensive, as it constructs a smart pointer to the row.

Parameters
i0row index of element to be accessed.
Returns
Smart pointer to i0-th row.

Definition at line 122 of file tarray2.hxx.

122 { return std::shared_ptr<TArray1<T>>(new TArray1<T>(shape(1), &_data[_idx(i0,0)], [](T*p){;}));}
index _idx(index i0) const
1D Array index calculation with optional bounds check.
Definition: tarray.ixx:156
T * _data
Data pointer.
Definition: tarray.hxx:186
index shape(const index dim) const
Obtain shape of array for given dimension.
Definition: tarray.hxx:68

+ Here is the call graph for this function:

template<typename T>
bool numcxx::TArray2< T >::is_matrix ( )
inline

Definition at line 125 of file tarray2.hxx.

125 {return false;}
template<typename T>
T& numcxx::TArray< T >::operator() ( const index  i0)
inlineinherited

Access operator for 1D arrays.

Parameters
i0Index of element to be accessed.
Returns
Reference to element to be accessed.

Definition at line 36 of file tarray.hxx.

36 { return _data[_idx(i0)];};
index _idx(index i0) const
1D Array index calculation with optional bounds check.
Definition: tarray.ixx:156
T * _data
Data pointer.
Definition: tarray.hxx:186

+ Here is the call graph for this function:

template<typename T>
const T& numcxx::TArray< T >::operator() ( const index  i0) const
inlineinherited

Definition at line 37 of file tarray.hxx.

37 { return _data[_idx(i0)];};
index _idx(index i0) const
1D Array index calculation with optional bounds check.
Definition: tarray.ixx:156
T * _data
Data pointer.
Definition: tarray.hxx:186

+ Here is the call graph for this function:

template<typename T>
T& numcxx::TArray< T >::operator() ( const index  i0,
const index  i1 
)
inlineinherited

Access operator for 2D arrays.

Parameters
i0Row index of element to be accessed.
i0Column index of element to be accessed.
Returns
Reference to element to be accessed.

Definition at line 44 of file tarray.hxx.

44 { return _data[_idx(i0,i1)];};
index _idx(index i0) const
1D Array index calculation with optional bounds check.
Definition: tarray.ixx:156
T * _data
Data pointer.
Definition: tarray.hxx:186

+ Here is the call graph for this function:

template<typename T>
const T& numcxx::TArray< T >::operator() ( const index  i0,
const index  i1 
) const
inlineinherited

Definition at line 45 of file tarray.hxx.

45 { return _data[_idx(i0,i1)];};
index _idx(index i0) const
1D Array index calculation with optional bounds check.
Definition: tarray.ixx:156
T * _data
Data pointer.
Definition: tarray.hxx:186

+ Here is the call graph for this function:

template<typename T>
index numcxx::TArray< T >::ndim ( ) const
inlineinherited

Obtain tensor dimension of array.

Tensor dimension is 1 for vectors, 2 for matrices.

Returns
Dimension.

Definition at line 52 of file tarray.hxx.

52 {return _ndim;}
const index _ndim
Tensor dimension.
Definition: tarray.hxx:143
template<typename T>
size_t numcxx::TArray< T >::size ( ) const
inlineinherited

Obtain size of array.

This ist the overall number of elements in the array

Returns
Size.
Examples:
11-numcxx-ref.cxx, 12-numcxx-sharedptr.cxx, 44-transient-heat-fe.cxx, and 45-convdiff1d.cxx.

Definition at line 58 of file tarray.hxx.

58 { return _size;}
size_t _size
Size of array.
Definition: tarray.hxx:146
template<typename T>
index numcxx::TArray< T >::shape ( const index  dim) const
inlineinherited

Obtain shape of array for given dimension.

For 1D arrays, shape(0) is equivalent to the size For 2D arrays, shape(0) is the number of rows and shape(1) the number of columns. This corresponds to the "row major" storage format.

Parameters
dimTensor dimension.
Returns
Number of elements in given dimension.

Definition at line 68 of file tarray.hxx.

68 {return _shape[dim];}
index _shape[3]
Shape vector.
Definition: tarray.hxx:149
template<typename T>
template<typename VAL >
void numcxx::TArray< T >::operator+= ( const VAL &  a)
inlineinherited

Add value to all elements.

Parameters
aSummand for each element.

Definition at line 74 of file tarray.hxx.

74 {xadd(*this,a);}
void xadd(TArray< T > &A, const EXPR &expr, const EXPR *x=0)
Definition: tarray.ixx:54

+ Here is the call graph for this function:

template<typename T>
template<typename VAL >
void numcxx::TArray< T >::operator-= ( const VAL &  a)
inlineinherited

Subtract value from all elements.

Parameters
aValue to be subracted from each element.

Definition at line 80 of file tarray.hxx.

80 {xsub(*this,a);}
void xsub(TArray< T > &A, const EXPR &expr, const EXPR *x=0)
Definition: tarray.ixx:73

+ Here is the call graph for this function:

template<typename T>
template<typename VAL >
void numcxx::TArray< T >::operator*= ( const VAL &  a)
inlineinherited

Multiply all elements by value.

Parameters
aMultiplicator for each element.

Definition at line 87 of file tarray.hxx.

87 {xmul(*this,a);}
void xmul(TArray< T > &A, const EXPR &expr, const EXPR *x=0)
Definition: tarray.ixx:92

+ Here is the call graph for this function:

template<typename T>
template<typename VAL >
void numcxx::TArray< T >::operator/= ( const VAL &  a)
inlineinherited

Divide each element by value.

Parameters
aDivisor for each element.

Definition at line 94 of file tarray.hxx.

94 {xdiv(*this,a);}
void xdiv(TArray< T > &A, const EXPR &expr, const EXPR *x=0)
Definition: tarray.ixx:111

+ Here is the call graph for this function:

template<typename T >
void numcxx::TArray< T >::operate ( std::function< void(T &a, T &b)>  f,
TArray< T > &  A,
TArray< T > &  B 
)
inlinestaticinherited

Binary operation on arrays.

Parameters
fFunction performing operation for each index.
AFirst array argument.
BSecond array argument.

Definition at line 314 of file tarray.ixx.

315  {
316  for(index i=0;i<A._size;i++) f(A._data[i],B._data[i]);
317  }
unsigned int index
Definition: numcxx.hxx:21
double B(double x)
template<typename T >
void numcxx::TArray< T >::operate ( std::function< void(T &a, T &b, T &c)>  f,
TArray< T > &  A,
TArray< T > &  B,
TArray< T > &  C 
)
inlinestaticinherited

Ternary operation on arrays.

Parameters
fFunction performing operation for each index.
AFirst array argument.
BSecond array argument.
CThird array argument.

Definition at line 320 of file tarray.ixx.

321  {
322  for(index i=0;i<A._size;i++) f(A._data[i],B._data[i],C._data[i]);
323  }
unsigned int index
Definition: numcxx.hxx:21
double B(double x)
template<typename T>
T& numcxx::TArray< T >::operator[] ( const index  i)
inlineinherited

Alternative access operator for 1D arrays.

Definition at line 115 of file tarray.hxx.

115 { return _data[i];}
T * _data
Data pointer.
Definition: tarray.hxx:186
template<typename T>
const T& numcxx::TArray< T >::operator[] ( const index  i) const
inlineinherited

Const reference to entry for use in expression templates.

Definition at line 118 of file tarray.hxx.

118 { return _data[i];};
T * _data
Data pointer.
Definition: tarray.hxx:186
template<typename T>
T* numcxx::TArray< T >::data ( ) const
inlineinherited

Obtain C-pointer of data array.

Returns
Address of C-Array managed by the class which holds the data

Definition at line 128 of file tarray.hxx.

128 { return _data;}
T * _data
Data pointer.
Definition: tarray.hxx:186

+ Here is the call graph for this function:

template<typename T >
void numcxx::TArray< T >::resize ( size_t  n)
inlineinherited

Resize array.

Definition at line 282 of file tarray.ixx.

283  {
284  if (_size==n) return;
285 
286  if (_ndim>1)
287  {
288  char errormsg[80];
289  snprintf(errormsg,80,"numcxx::TArray::resize: unable to resize 2D Array to 1D.\n");
290  throw std::runtime_error(errormsg);
291  }
292 
293  if (_datamanager==nullptr)
294  {
295  _deleter(_data);
296  _data=(T*)malloc(sizeof(T)*n);
297  if (_data==nullptr) throw std::runtime_error("numcxx: TArray::resize(): Memory allocation failed");
298  _deleter=[](T*p){free(p);};
299  _size=n;
300  _shape[0]=n;
301  _shape[1]=0;
302  }
303  else
304  {
305  char errormsg[80];
306  snprintf(errormsg,80,"numcxx::TArray::resize: unable to resize - data managed by different object.\n");
307  throw std::runtime_error(errormsg);
308  }
309  }
index _shape[3]
Shape vector.
Definition: tarray.hxx:149
std::function< void(T *p)> _deleter
Deleter method.
Definition: tarray.hxx:172
size_t _size
Size of array.
Definition: tarray.hxx:146
T * _data
Data pointer.
Definition: tarray.hxx:186
std::shared_ptr< void > _datamanager
Data manager.
Definition: tarray.hxx:183
const index _ndim
Tensor dimension.
Definition: tarray.hxx:143
template<typename T >
void numcxx::TArray< T >::savetxt ( std::ostream &  s) const
inlineinherited

Definition at line 351 of file tarray.ixx.

352  {
353  if (ndim()==1)
354  for (index i=0;i<size();i++) s << _data[i] << std::endl << std::flush;
355  else
356  {
357  for (index i=0;i<shape(0);i++)
358  {
359  for (index j=0;j<shape(1);j++)
360  s << _data[_idx(i,j)] << " ";
361  s<< std::endl;
362  }
363  s << std::flush;
364  }
365  }
index _idx(index i0) const
1D Array index calculation with optional bounds check.
Definition: tarray.ixx:156
size_t size() const
Obtain size of array.
Definition: tarray.hxx:58
unsigned int index
Definition: numcxx.hxx:21
index ndim() const
Obtain tensor dimension of array.
Definition: tarray.hxx:52
T * _data
Data pointer.
Definition: tarray.hxx:186
index shape(const index dim) const
Obtain shape of array for given dimension.
Definition: tarray.hxx:68

+ Here is the call graph for this function:

template<typename T >
void numcxx::TArray< T >::_assert_square ( ) const
inlineprotectedinherited

Check if all shapes are the same.

Throw an exception on error

Definition at line 145 of file tarray.ixx.

146  {
147  if (_ndim!=2 || _shape[0]!=_shape[1])
148  {
149  char errormsg[80];
150  snprintf(errormsg,80,"numcxx::TArray::_assert_square: unexpected non-equal array dimensions\n");
151  throw std::length_error(errormsg);
152  }
153  }
index _shape[3]
Shape vector.
Definition: tarray.hxx:149
const index _ndim
Tensor dimension.
Definition: tarray.hxx:143
template<typename T >
index numcxx::TArray< T >::_idx ( index  i0) const
inlineprotectedinherited

1D Array index calculation with optional bounds check.

Definition at line 156 of file tarray.ixx.

157  {
158 #ifdef NUMCXX_CHECK_BOUNDS
159  _check_bounds(0,1,i0);
160 #endif
161  return i0;
162  }
void _check_bounds(index acc_dim, index acc_ndim, index acc_idx) const
Bounds checker.
Definition: tarray.ixx:128

+ Here is the call graph for this function:

template<typename T >
index numcxx::TArray< T >::_idx ( index  i0,
index  i1 
) const
inlineprotectedinherited

2D Array index calculation with optional bounds check.

Definition at line 165 of file tarray.ixx.

166  {
167 #ifdef NUMCXX_CHECK_BOUNDS
168  _check_bounds(0,2,i0);
169  _check_bounds(1,2,i1);
170 #endif
171  return i0*_shape[1]+i1;
172  }
index _shape[3]
Shape vector.
Definition: tarray.hxx:149
void _check_bounds(index acc_dim, index acc_ndim, index acc_idx) const
Bounds checker.
Definition: tarray.ixx:128

+ Here is the call graph for this function:

template<typename T >
index numcxx::TArray< T >::_idx ( index  i0,
index  i1,
index  i2 
) const
inlineprotectedinherited

3D Array index calculation with optional bounds check.

Definition at line 175 of file tarray.ixx.

176  {
177 #ifdef NUMCXX_CHECK_BOUNDS
178  _check_bounds(0,3,i0);
179  _check_bounds(1,3,i1);
180  _check_bounds(2,3,i2);
181 #endif
182  return (i0*_shape[0]+i1)*_shape[1]+i2;
183  }
index _shape[3]
Shape vector.
Definition: tarray.hxx:149
void _check_bounds(index acc_dim, index acc_ndim, index acc_idx) const
Bounds checker.
Definition: tarray.ixx:128

+ Here is the call graph for this function:

template<typename T >
void numcxx::TArray< T >::_nullify ( )
inlineprotectedinherited

Nullify contents of array (for move constructors)

Definition at line 254 of file tarray.ixx.

255  {
256  _shape[0]=0;
257  _shape[1]=0;
258  _shape[2]=0;
259  _size=0;
260  _deleter=[](T*p){;};
261  _datamanager=nullptr;
262  _data=nullptr;
263  }
index _shape[3]
Shape vector.
Definition: tarray.hxx:149
std::function< void(T *p)> _deleter
Deleter method.
Definition: tarray.hxx:172
size_t _size
Size of array.
Definition: tarray.hxx:146
T * _data
Data pointer.
Definition: tarray.hxx:186
std::shared_ptr< void > _datamanager
Data manager.
Definition: tarray.hxx:183
template<typename T >
void numcxx::TArray< T >::_setshape ( index  shape0)
inlineprotectedinherited

Set shape of 1D array (for move constructors)

Definition at line 266 of file tarray.ixx.

267  {
268  if (_ndim!=1)
269  {
270  char errormsg[80];
271  snprintf(errormsg,80,"numcxx::TArray::resize: unable to set 1D shape for 2D array.\n");
272  throw std::runtime_error(errormsg);
273  }
274  _shape[0]=shape0;
275  _shape[1]=0;
276  _shape[2]=0;
277  _size=shape0;
278  }
index _shape[3]
Shape vector.
Definition: tarray.hxx:149
size_t _size
Size of array.
Definition: tarray.hxx:146
const index _ndim
Tensor dimension.
Definition: tarray.hxx:143

Member Data Documentation

template<typename T>
std::function<void(T*p)> numcxx::TArray< T >::_deleter =nullptr
protectedinherited

Deleter method.

This is the proper method to be used to destroy the data pointer in the array if data manager is null. Depending on the way it was constructed, it may do nothing, free the memory, delete[] the memory, or something else.

Definition at line 172 of file tarray.hxx.

template<typename T>
std::shared_ptr<void> numcxx::TArray< T >::_datamanager =nullptr
protectedinherited

Data manager.

Smart pointer to some other object managing the data pointer. If it is not nullptr, the deleter is not called and the memory corresponding to the data pointer is freed when the object behind the data manager is destroyed.

An example in case is the use of shared_ptr<vector> v as datamanager and v->data() as data pointer

Definition at line 183 of file tarray.hxx.

template<typename T>
T* numcxx::TArray< T >::_data =nullptr
protectedinherited

Data pointer.

Definition at line 186 of file tarray.hxx.


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