Public Member Functions | Public Attributes | Protected Attributes
rtc::Array< T, K > Class Template Reference

#include <rtcArray.h>

Inheritance diagram for rtc::Array< T, K >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void addTo (const T *v, int i0=0, int vlen=-1)
 Array ()
 Array (const Vec< int, K > dim)
 Array (const Array< T, K > &a)
T & at (int i)
T & at (const Vec< int, K > ind)
const T & at (int i) const
const T & at (const Vec< int, K > ind) const
void deleteArray ()
bool equalTo (const Array< T, K > &a) const
int indexOf (Vec< int, K > ind) const
int length () const
operator() (int i) const
T & operator() (int i)
operator() (const Vec< int, K > ind) const
T & operator() (const Vec< int, K > ind)
Array< T, K > & operator= (const Array< T, K > &a)
operator[] (int i) const
T & operator[] (int i)
operator[] (const Vec< int, K > ind) const
T & operator[] (const Vec< int, K > ind)
bool read (InputHandler &ih)
void reset ()
void set (const T v)
void set (const T *v, int i0=0, int vlen=-1)
void set (const Array< T, K > &a)
void setSize (const Vec< int, K > dim_)
Vec< int, K > size () const
int size (int i) const
bool write (OutputHandler &oh) const
 ~Array ()

Public Attributes

T * x
 storage array

Protected Attributes

Vec< int, K > dim
 array dimensions
int len
 linear length of array
Vec< int, K > mul
 multipliers for computing linear index

Detailed Description

template<class T, int K>
class rtc::Array< T, K >

A K-Dimensional Array of type T

Definition at line 38 of file rtcArray.h.


Constructor & Destructor Documentation

template<class T , int K>
rtc::Array< T, K >::Array ( ) [inline]

Ctor that does no initalization.

Definition at line 106 of file rtcArray.h.

template<class T , int K>
rtc::Array< T, K >::Array ( const Vec< int, K >  dim_) [inline]

Ctor that starts with given dimensions

Parameters:
dim_are the sizes in the several dimension

Definition at line 117 of file rtcArray.h.

template<class T, int K>
rtc::Array< T, K >::Array ( const Array< T, K > &  a) [inline]

Copy Ctor

Parameters:
athe other vector

Definition at line 129 of file rtcArray.h.

template<class T , int K>
rtc::Array< T, K >::~Array ( ) [inline]

Dtor that does no initalization.

Definition at line 140 of file rtcArray.h.


Member Function Documentation

template<class T, int K>
void rtc::Array< T, K >::addTo ( const T *  v,
int  i0 = 0,
int  vlen = -1 
) [inline]

Add the values in array v to this array

Parameters:
vis the value to set the array to
i0is offset where to start copying
vlenis the number of elements to copy

Definition at line 217 of file rtcArray.h.

template<class T , int K>
T & rtc::Array< T, K >::at ( int  i) [inline]

Returns mutable reference to array element

Parameters:
iis the index list
Returns:
a reference to the array element

Definition at line 227 of file rtcArray.h.

template<class T , int K>
T & rtc::Array< T, K >::at ( const Vec< int, K >  ind) [inline]

Returns mutable reference to array element

Parameters:
indis the index list
Returns:
a reference to the array element

Definition at line 236 of file rtcArray.h.

template<class T , int K>
const T & rtc::Array< T, K >::at ( int  i) const [inline]

Returns mutable reference to array element

Parameters:
iis the index list
Returns:
a reference to the array element

Definition at line 245 of file rtcArray.h.

template<class T , int K>
const T & rtc::Array< T, K >::at ( const Vec< int, K >  ind) const [inline]

Returns mutable reference to array element

Parameters:
indis the index list
Returns:
a reference to the array element

Definition at line 254 of file rtcArray.h.

template<class T, int K>
void rtc::Array< T, K >::deleteArray ( ) [inline]

Definition at line 47 of file rtcArray.h.

template<class T, int K>
bool rtc::Array< T, K >::equalTo ( const Array< T, K > &  other) const [inline]

Compare the entire array to the passed array.

Returns:
true of all corresponding elements are the same

Definition at line 375 of file rtcArray.h.

template<class T , int K>
int rtc::Array< T, K >::indexOf ( Vec< int, K >  ind) const [inline]

Returns linear index of given array indices

Parameters:
indis the vector of indices to be converted
Returns:
the linear index in the data array x

Definition at line 467 of file rtcArray.h.

template<class T , int K>
int rtc::Array< T, K >::length ( ) const [inline]

Returns linear length of data

Returns:
integer legth of data

Reimplemented in rtc::VarMat< T >.

Definition at line 404 of file rtcArray.h.

template<class T , int K>
T rtc::Array< T, K >::operator() ( int  i) const [inline]

Returns array element

Parameters:
iis the linear index
Returns:
array element

Definition at line 298 of file rtcArray.h.

template<class T , int K>
T & rtc::Array< T, K >::operator() ( int  i) [inline]

Returns mutable reference to array element

Parameters:
iis the linear index
Returns:
a reference to the array element

Definition at line 272 of file rtcArray.h.

template<class T , int K>
T rtc::Array< T, K >::operator() ( const Vec< int, K >  ind) const [inline]

Returns array element

Parameters:
indis the index list
Returns:
array element

Definition at line 289 of file rtcArray.h.

template<class T , int K>
T & rtc::Array< T, K >::operator() ( const Vec< int, K >  ind) [inline]

Returns mutable reference to array element

Parameters:
indis the index list
Returns:
a reference to the array element

Definition at line 263 of file rtcArray.h.

template<class T, int K>
Array< T, K > & rtc::Array< T, K >::operator= ( const Array< T, K > &  a) [inline]

Set this array equal to passed array

Parameters:
athe array to replicate

Definition at line 366 of file rtcArray.h.

template<class T , int K>
T rtc::Array< T, K >::operator[] ( int  i) const [inline]

Returns array element

Parameters:
iis the linear index
Returns:
array element

Reimplemented in rtc::VarVec< T >.

Definition at line 350 of file rtcArray.h.

template<class T , int K>
T & rtc::Array< T, K >::operator[] ( int  i) [inline]

Returns mutable reference to array element

Parameters:
iis the linear index
Returns:
a reference to the array element

Reimplemented in rtc::VarVec< T >.

Definition at line 324 of file rtcArray.h.

template<class T , int K>
T rtc::Array< T, K >::operator[] ( const Vec< int, K >  ind) const [inline]

Returns array element

Parameters:
indis the index list
Returns:
array element

Definition at line 341 of file rtcArray.h.

template<class T , int K>
T & rtc::Array< T, K >::operator[] ( const Vec< int, K >  ind) [inline]

Returns mutable reference to array element

Parameters:
indis the index list
Returns:
a reference to the array element

Definition at line 315 of file rtcArray.h.

template<class T , int K>
bool rtc::Array< T, K >::read ( InputHandler ih) [inline]

Restore state from a binary stream.

Reimplemented in rtc::Image< T >, and rtc::Image< Vec3uc >.

Definition at line 422 of file rtcArray.h.

template<class T , int K>
void rtc::Array< T, K >::reset ( ) [inline]

Deletes contents of array and frees memory

Definition at line 149 of file rtcArray.h.

template<class T, int K>
void rtc::Array< T, K >::set ( const T  v) [inline]

Set the values of all the elements in the array to v

Parameters:
vis the value to set the array to

Reimplemented in rtc::VarVec< T >.

Definition at line 186 of file rtcArray.h.

template<class T, int K>
void rtc::Array< T, K >::set ( const T *  v,
int  i0 = 0,
int  vlen = -1 
) [inline]

Set the values of all the elements in the array to v

Parameters:
vis the value to set the array to
i0is offset where to start copying
vlenis the number of elements to copy

Definition at line 196 of file rtcArray.h.

template<class T, int K>
void rtc::Array< T, K >::set ( const Array< T, K > &  a) [inline]

Set this array to the passed array, value-wise

Parameters:
ais the array to duplicate

Definition at line 205 of file rtcArray.h.

template<class T , int K>
void rtc::Array< T, K >::setSize ( const Vec< int, K >  dim_) [inline]

Set the size of the array

Parameters:
dim_the sizes of the array in each dimension

Definition at line 163 of file rtcArray.h.

template<class T , int K>
Vec< int, K > rtc::Array< T, K >::size ( ) const [inline]

Returns vector of array dimensions

Returns:
Vec<int,K> of array dimension lengths

Reimplemented in rtc::VarSMat< T >, rtc::Array1< T >, and rtc::Array1< Vec4< float > >.

Definition at line 388 of file rtcArray.h.

template<class T , int K>
int rtc::Array< T, K >::size ( int  i) const [inline]

Returns vector of array dimensions

Returns:
Vec<int,K> of array dimension lengths

Definition at line 396 of file rtcArray.h.

template<class T , int K>
bool rtc::Array< T, K >::write ( OutputHandler oh) const [inline]

Write state to a binary stream.

Reimplemented in rtc::Image< T >, and rtc::Image< Vec3uc >.

Definition at line 413 of file rtcArray.h.


Member Data Documentation

template<class T, int K>
Vec<int,K> rtc::Array< T, K >::dim [protected]

array dimensions

Definition at line 88 of file rtcArray.h.

template<class T, int K>
int rtc::Array< T, K >::len [protected]

linear length of array

Definition at line 90 of file rtcArray.h.

template<class T, int K>
Vec<int,K> rtc::Array< T, K >::mul [protected]

multipliers for computing linear index

Definition at line 89 of file rtcArray.h.

template<class T, int K>
T* rtc::Array< T, K >::x

storage array

Definition at line 86 of file rtcArray.h.


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


rtc
Author(s): Benjamin Pitzer
autogenerated on Thu Jan 2 2014 11:04:54