LevelS C++ support library  3.83
Public Member Functions | List of all members
arr2b< T > Class Template Reference

#include <arr.h>

Public Member Functions

 arr2b ()
 
 arr2b (tsize sz1, tsize sz2)
 
 arr2b (const arr2b &orig)
 
 ~arr2b ()
 
tsize size1 () const
 
tsize size2 () const
 
tsize size () const
 
void alloc (tsize sz1, tsize sz2)
 
void dealloc ()
 
void fill (const T &val)
 
arr2boperator= (const arr2b &orig)
 
template<typename T2 >
T * operator[] (T2 n)
 
template<typename T2 >
const T * operator[] (T2 n) const
 
T ** p0 ()
 

Detailed Description

template<typename T>
class arr2b< T >

Two-dimensional array type. An entry is located by double dereferencing, i.e. via an array of pointers. The indices start at zero.

Definition at line 511 of file arr.h.

Constructor & Destructor Documentation

◆ arr2b() [1/3]

template<typename T>
arr2b< T >::arr2b ( )
inline

Creates a zero-sized array.

Definition at line 523 of file arr.h.

◆ arr2b() [2/3]

template<typename T>
arr2b< T >::arr2b ( tsize  sz1,
tsize  sz2 
)
inline

Creates an array with the dimensions sz1 and sz2.

Definition at line 525 of file arr.h.

◆ arr2b() [3/3]

template<typename T>
arr2b< T >::arr2b ( const arr2b< T > &  orig)
inline

Creates the array as a copy of orig.

Definition at line 529 of file arr.h.

◆ ~arr2b()

template<typename T>
arr2b< T >::~arr2b ( )
inline

Frees the memory associated with the array.

Definition at line 533 of file arr.h.

Member Function Documentation

◆ size1()

template<typename T>
tsize arr2b< T >::size1 ( ) const
inline

Returns the first array dimension.

Definition at line 536 of file arr.h.

◆ size2()

template<typename T>
tsize arr2b< T >::size2 ( ) const
inline

Returns the second array dimension.

Definition at line 538 of file arr.h.

◆ size()

template<typename T>
tsize arr2b< T >::size ( ) const
inline

Returns the total array size, i.e. the product of both dimensions.

Definition at line 540 of file arr.h.

◆ alloc()

template<typename T>
void arr2b< T >::alloc ( tsize  sz1,
tsize  sz2 
)
inline

Allocates space for an array with sz1*sz2 elements. The content of the array is undefined on exit.

Definition at line 544 of file arr.h.

◆ dealloc()

template<typename T>
void arr2b< T >::dealloc ( )
inline

Deallocates the space and makes the array zero-sized.

Definition at line 553 of file arr.h.

◆ fill()

template<typename T>
void arr2b< T >::fill ( const T &  val)
inline

Sets all array elements to val.

Definition at line 556 of file arr.h.

◆ operator=()

template<typename T>
arr2b& arr2b< T >::operator= ( const arr2b< T > &  orig)
inline

Changes the array to be a copy of orig.

Definition at line 560 of file arr.h.

◆ operator[]() [1/2]

template<typename T>
template<typename T2 >
T* arr2b< T >::operator[] ( T2  n)
inline

Returns a pointer to the beginning of slice n.

Definition at line 569 of file arr.h.

◆ operator[]() [2/2]

template<typename T>
template<typename T2 >
const T* arr2b< T >::operator[] ( T2  n) const
inline

Returns a constant pointer to the beginning of slice n.

Definition at line 571 of file arr.h.

◆ p0()

template<typename T>
T** arr2b< T >::p0 ( )
inline

Returns a pointer to the beginning of the pointer array.

Definition at line 574 of file arr.h.


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

Generated on Wed Nov 13 2024 12:18:16 for LevelS C++ support library