NurbsUtils::array2< T > Class Template Reference

#include <NurbsUtils.h>

Public Member Functions

 array2 (size_t nRows, size_t nCols, T fillValue=0.0)
 
operator() (size_t row, size_t col) const
 
T & operator() (size_t row, size_t col)
 

Private Attributes

size_t rows
 
size_t cols
 
std::vector< T > data
 

Detailed Description

template<typename T>
class NurbsUtils::array2< T >

A simple class for representing 2D runtime arrays.

Constructor & Destructor Documentation

◆ array2()

template<typename T >
NurbsUtils::array2< T >::array2 ( size_t  nRows,
size_t  nCols,
fillValue = 0.0 
)
inline
44  : rows(nRows), cols(nCols) {
45  data.resize(rows * cols, fillValue);
46  }
size_t cols
Definition: NurbsUtils.h:57
size_t rows
Definition: NurbsUtils.h:57
std::vector< T > data
Definition: NurbsUtils.h:58

References NurbsUtils::array2< T >::cols, NurbsUtils::array2< T >::data, and NurbsUtils::array2< T >::rows.

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
T& NurbsUtils::array2< T >::operator() ( size_t  row,
size_t  col 
)
inline
52  {
53  return data[row*cols + col];
54  }

References NurbsUtils::array2< T >::cols, and NurbsUtils::array2< T >::data.

◆ operator()() [2/2]

template<typename T >
T NurbsUtils::array2< T >::operator() ( size_t  row,
size_t  col 
) const
inline
48  {
49  return data[row*cols + col];
50  }

References NurbsUtils::array2< T >::cols, and NurbsUtils::array2< T >::data.

Member Data Documentation

◆ cols

template<typename T >
size_t NurbsUtils::array2< T >::cols
private

◆ data

template<typename T >
std::vector<T> NurbsUtils::array2< T >::data
private

◆ rows

template<typename T >
size_t NurbsUtils::array2< T >::rows
private

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