ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | List of all members
itk::Array2D< TValue > Class Template Reference

#include <itkArray2D.h>

+ Inheritance diagram for itk::Array2D< TValue >:
+ Collaboration diagram for itk::Array2D< TValue >:

Public Types

using Self = Array2D
 
using ValueType = TValue
 
using VnlMatrixType = vnl_matrix< TValue >
 

Public Member Functions

 Array2D ()=default
 
 Array2D (const Self &array)
 
 Array2D (const VnlMatrixType &matrix)
 
 Array2D (unsigned int numberOfRows, unsigned int numberOfCols)
 
void Fill (TValue const &v)
 
const TValue & GetElement (SizeValueType row, SizeValueType col) const
 
const Selfoperator= (const Self &array)
 
const Selfoperator= (const VnlMatrixType &matrix)
 
void SetElement (SizeValueType row, SizeValueType col, const TValue &value)
 
void SetSize (unsigned int m, unsigned int n)
 
 ~Array2D () override=default
 

Detailed Description

template<typename TValue>
class itk::Array2D< TValue >

Array2D class representing a 2D array with size defined at construction time.

This class derives from the vnl_matrix<> class. Its size is assigned at construction time (run time) and can not be changed afterwards.

The class is templated over the type of the elements.

Template parameters for class Array2D:

Definition at line 45 of file itkArray2D.h.

Member Typedef Documentation

◆ Self

template<typename TValue>
using itk::Array2D< TValue >::Self = Array2D

Definition at line 50 of file itkArray2D.h.

◆ ValueType

template<typename TValue>
using itk::Array2D< TValue >::ValueType = TValue

The element type stored at each location in the Array2D.

Definition at line 49 of file itkArray2D.h.

◆ VnlMatrixType

template<typename TValue>
using itk::Array2D< TValue >::VnlMatrixType = vnl_matrix<TValue>

Definition at line 51 of file itkArray2D.h.

Constructor & Destructor Documentation

◆ Array2D() [1/4]

template<typename TValue>
itk::Array2D< TValue >::Array2D ( )
default

◆ Array2D() [2/4]

template<typename TValue>
itk::Array2D< TValue >::Array2D ( unsigned int  numberOfRows,
unsigned int  numberOfCols 
)

◆ Array2D() [3/4]

template<typename TValue>
itk::Array2D< TValue >::Array2D ( const Self array)

◆ Array2D() [4/4]

template<typename TValue>
itk::Array2D< TValue >::Array2D ( const VnlMatrixType matrix)

◆ ~Array2D()

template<typename TValue>
itk::Array2D< TValue >::~Array2D ( )
overridedefault

This destructor is not virtual for performance reasons. However, this means that subclasses cannot allocate memory.

Member Function Documentation

◆ Fill()

template<typename TValue>
void itk::Array2D< TValue >::Fill ( TValue const &  v)
inline

Definition at line 65 of file itkArray2D.h.

◆ GetElement()

template<typename TValue>
const TValue& itk::Array2D< TValue >::GetElement ( SizeValueType  row,
SizeValueType  col 
) const
inline

Get one element

Definition at line 72 of file itkArray2D.h.

◆ operator=() [1/2]

template<typename TValue>
const Self& itk::Array2D< TValue >::operator= ( const Self array)

◆ operator=() [2/2]

template<typename TValue>
const Self& itk::Array2D< TValue >::operator= ( const VnlMatrixType matrix)

◆ SetElement()

template<typename TValue>
void itk::Array2D< TValue >::SetElement ( SizeValueType  row,
SizeValueType  col,
const TValue &  value 
)
inline

Set one element

Definition at line 79 of file itkArray2D.h.

◆ SetSize()

template<typename TValue>
void itk::Array2D< TValue >::SetSize ( unsigned int  m,
unsigned int  n 
)

Destructively set the size to that given. Will lose data.


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