Num2DArray Class Template Reference

A 2D array data type for numerical data. More...

#include <Num2DArray.h>

Inheritance diagram for Num2DArray::

Simple2DArray Basic2DArray List of all members.

Public Methods

 Num2DArray ()
 Empty constructor.

 Num2DArray (const BasicArray< T > &array, const int nrows=1, const EnumDataOwned own=DataNotOwned)
 Constructor that initializes the 2D array using a given array. More...

 Num2DArray (const int nrows, const int ncols, T *d=((T *) 0), const EnumDataOwned own=DataNotOwned)
 Constructor that initializes the 2D array using a given array. More...

 Num2DArray (const int nrows, const int ncols, const BasicArray< T > &array, const EnumDataOwned own=DataNotOwned)
 Constructor that initializes the 2D array using a given array. More...

 Num2DArray (const Num2DArray &array)
 Copy constructor.

Num2DArray< T > & operator= (const Num2DArray< T > &array)
 Copies the array object by constructing a new Num2DArray.

Num2DArray< T > & operator= (const T &array)
 Set all elements of the array to val.

void plus (const Num2DArray< T > &x, const Num2DArray< T > &y)
 Sets the array equal to the pair-wise value x + y.

void minus (const Num2DArray< T > &x, const Num2DArray< T > &y)
 Sets the array equal to the pair-wise value x - y.

void times (const Num2DArray< T > &x, const Num2DArray< T > &y)
 Sets the array equal to the pair-wise value x * y.

void divide (const Num2DArray< T > &x, const Num2DArray< T > &y)
 Sets the array equal to the pair-wise value x / y.

void plus (const Num2DArray< T > &x, const NumArray< T > &y)
 Row-wise operations to set i-th row equal to x[i] + y.

void minus (const Num2DArray< T > &x, const NumArray< T > &y)
 Row-wise operations to set i-th row equal to x[i] - y.

void times (const Num2DArray< T > &x, const NumArray< T > &y)
 Row-wise operations to set i-th row equal to x[i] * y.

void divide (const Num2DArray< T > &x, const NumArray< T > &y)
 Row-wise operations to set i-th row equal to x[i] / y.

void plus (const Num2DArray< T > &x, const T &z)
 Element-wise operations to add the value z.

void minus (const Num2DArray< T > &x, const T &z)
 Element-wise operations to subtract the value z.

void times (const Num2DArray< T > &x, const T &z)
 Element-wise operations to multiply the value z.

void divide (const Num2DArray< T > &x, const T &z)
 Element-wise operations to divide the value z.

Num2DArray< T > operator- ()
 Changes the sign of elements in the array.

Num2DArray< T > & operator+= (const Num2DArray< T > &x)
 Adds the value of x element-wise to the current array.

Num2DArray< T > & operator-= (const Num2DArray< T > &x)
 Subtracts the value of x element-wise to the current array.

Num2DArray< T > & operator *= (const Num2DArray< T > &x)
 Multiplies the value of x element-wise to the current array.

Num2DArray< T > & operator/= (const Num2DArray< T > &x)
 Divides the value of x element-wise to the current array.

Num2DArray< T > & operator+= (const NumArray< T > &y)
 Adds element-wise to the rows of the current-array.

Num2DArray< T > & operator-= (const NumArray< T > &y)
 Subtracts element-wise to the rows of the current-array.

Num2DArray< T > & operator *= (const NumArray< T > &y)
 Multiplies element-wise to the rows of the current-array.

Num2DArray< T > & operator/= (const NumArray< T > &y)
 Divides element-wise to the rows of the current-array.

Num2DArray< T > & operator+= (const T &z)
 Adds z to the elements of the current array.

Num2DArray< T > & operator-= (const T &z)
 Subtracts z to the elements of the current array.

Num2DArray< T > & operator *= (const T &z)
 Multiplies z to the elements of the current array.

Num2DArray< T > & operator/= (const T &z)
 Divides z to the elements of the current array.


Friends

void matmult (Num2DArray< T > &res, const Num2DArray< T > &, const Num2DArray< T > &)
void matmult (NumArray< T > &res, const Num2DArray< T > &, const NumArray< T > &)
void matmult (NumArray< T > &res, const NumArray< T > &, const Num2DArray< T > &)
Num2DArray< T > operator% (const Num2DArray< T > &, const Num2DArray< T > &)
NumArray< T > operator% (const Num2DArray< T > &, const NumArray< T > &)
NumArray< T > operator% (const NumArray< T > &, const Num2DArray< T > &)

Detailed Description

template<class T>
class Num2DArray< T >

A 2D array data type for numerical data.

Num2DArray extends the definition of Simple2DArray to include numerical array operations.


Constructor & Destructor Documentation

template<class T>
Num2DArray< T >::Num2DArray const BasicArray< T > &    array,
const int    nrows = 1,
const EnumDataOwned    own = DataNotOwned
[inline]
 

Constructor that initializes the 2D array using a given array.

The 2D array only constructs the array of pointers, which point into the data owned by the array object.

template<class T>
Num2DArray< T >::Num2DArray const int    nrows,
const int    ncols,
T *    d = ((T*)0),
const EnumDataOwned    own = DataNotOwned
[inline]
 

Constructor that initializes the 2D array using a given array.

The 2D array only constructs the array of pointers, which point into the data owned by the d object.

template<class T>
Num2DArray< T >::Num2DArray const int    nrows,
const int    ncols,
const BasicArray< T > &    array,
const EnumDataOwned    own = DataNotOwned
[inline]
 

Constructor that initializes the 2D array using a given array.

The 2D array only constructs the array of pointers, which point into the data owned by the array object.


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