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

#include <itkArray2D.h>

Detailed Description

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

Array2D class representing a 2D array.

This class derives from the vnl_matrix<> class.

The class is templated over the type of the elements.

Template parameters for class Array2D:

Definition at line 42 of file 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 &)=default
 
 Array2D (const VnlMatrixType &matrix)
 
 Array2D (Self &&array) noexcept
 
 Array2D (unsigned int numberOfRows, unsigned int numberOfCols)
 
 Array2D (unsigned int numberOfRows, unsigned int numberOfCols, const TValue &initialValue)
 
void Fill (TValue const &v)
 
const TValue & GetElement (SizeValueType row, SizeValueType col) const
 
Selfoperator= (const Self &)=default
 
Selfoperator= (const VnlMatrixType &matrix)
 
void SetElement (SizeValueType row, SizeValueType col, const TValue &value)
 
void SetSize (unsigned int m, unsigned int n)
 
 ~Array2D () override=default
 
Selfoperator= (Self &&array) noexcept
 

Member Typedef Documentation

◆ Self

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

Definition at line 47 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 46 of file itkArray2D.h.

◆ VnlMatrixType

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

Definition at line 48 of file itkArray2D.h.

Constructor & Destructor Documentation

◆ Array2D() [1/6]

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

Default-constructor. Creates a matrix of size zero (0 rows and 0 columns).

◆ Array2D() [2/6]

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

Constructs a matrix of the specified number of rows and columns.

◆ Array2D() [3/6]

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

Constructs a matrix of the specified number of rows and columns, with each element having the specified initial value.

◆ Array2D() [4/6]

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

Copy-constructor.

◆ Array2D() [5/6]

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

Move-constructor.

Note
This move-constructor is noexcept, even while the move-constructor of its base class (vnl_matrix) is not noexcept, because unlike vnl_matrix, Array2D always manages its own memory.

Definition at line 66 of file itkArray2D.h.

◆ Array2D() [6/6]

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

Converting constructor. Implicitly converts the specified matrix to an Array2D.

◆ ~Array2D()

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

Destructor.

Member Function Documentation

◆ Fill()

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

Definition at line 96 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 103 of file itkArray2D.h.

◆ operator=() [1/3]

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

Copy-assignment operator.

◆ operator=() [2/3]

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

Assigns the specified matrix to an Array2D.

◆ operator=() [3/3]

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

Move-assignment operator.

Note
This move-assignment operator is noexcept, even while the move-assignment operator of its base class (vnl_matrix) is not noexcept, because unlike vnl_matrix, Array2D always manages its own memory.

Definition at line 83 of file itkArray2D.h.

◆ SetElement()

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

Set one element

Definition at line 110 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.

Referenced by itk::IdentityTransform< TParametersValueType, VDimension >::ComputeJacobianWithRespectToParameters().


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