SourcePro® API Reference Guide

 
List of all members | Public Types | Public Member Functions | Friends | Related Functions
RWMathArray< T > Class Template Reference

A templatized arbitrary dimension array class. More...

#include <rw/math/mtharray.h>

Inherits RWArrayView.

Public Types

typedef RWMathArrayConstIterator< T > const_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef RWMathArrayIterator< T > iterator
 
typedef rw_numeric_traits< T >::mathFunType mathFunType
 
typedef rw_numeric_traits< T >::mathFunType2 mathFunType2
 
typedef rw_numeric_traits< T >::norm_type norm_type
 
typedef rw_numeric_traits< T >::promote_type promote_type
 
typedef std::reverse_iterator< iteratorreverse_iterator
 

Public Member Functions

 RWMathArray ()
 
 RWMathArray (const RWIntVec &n, RWUninitialized, Storage storage=COLUMN_MAJOR)
 
 RWMathArray (size_t m, size_t n, size_t o, RWUninitialized)
 
 RWMathArray (size_t m, size_t n, size_t o, size_t p, RWUninitialized)
 
 RWMathArray (const RWIntVec &vec, RWTRand< RWRandGenerator > &r, Storage s=COLUMN_MAJOR)
 
 RWMathArray (size_t m, size_t n, size_t o, RWTRand< RWRandGenerator > &r)
 
 RWMathArray (size_t m, size_t n, size_t o, size_t p, RWTRand< RWRandGenerator > &r)
 
 RWMathArray (const RWIntVec &vec, T val)
 
 RWMathArray (size_t m, size_t n, size_t o, T val)
 
 RWMathArray (size_t m, size_t n, size_t o, size_t p, T val)
 
 RWMathArray (const char *s)
 
 RWMathArray (const RWMathArray< T > &a)
 
 RWMathArray (const T *dat, const RWIntVec &n)
 
 RWMathArray (const T *dat, size_t m, size_t n, size_t o)
 
 RWMathArray (const T *dat, size_t m, size_t n, size_t o, size_t p)
 
 RWMathArray (const RWMathVec< T > &vec, const RWIntVec &n)
 
 RWMathArray (const RWMathVec< T > &vec, size_t m, size_t n, size_t o)
 
 RWMathArray (const RWMathVec< T > &vec, size_t m, size_t n, size_t o, size_t p)
 
 RWMathArray (const RWMathVec< T > &)
 
 RWMathArray (const RWGenMat< T > &)
 
 RWMathArray (const RWMathArray< double > &re, const RWMathArray< double > &im)
 
RWMathArray< T > apply (mathFunType f) const
 
RWMathArray< norm_typeapply2 (mathFunType2 f) const
 
iterator begin ()
 
const_iterator begin () const
 
size_t binaryStoreSize () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
RWMathArray< T > copy () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
T * data ()
 
const T * data () const
 
RWMathArray< T > deepCopy () const
 
void deepenShallowCopy ()
 
size_t dimension () const
 
iterator end ()
 
const_iterator end () const
 
RWIntVec length () const
 
int length (int i) const
 
 operator RWMathArray< promote_type > ()
 
bool operator!= (const RWMathArray< T > &v) const
 
T & operator() (const RWIntVec &i)
 
operator() (const RWIntVec &i) const
 
T & operator() (int i, int j, int k)
 
operator() (int i, int j, int k) const
 
T & operator() (int i, int j, int k, int l)
 
operator() (int i, int j, int k, int l) const
 
RWMathVec< T > operator() (const RWSlice &i, int j, int k)
 
const RWMathVec< T > operator() (const RWSlice &i, int j, int k) const
 
RWMathVec< T > operator() (int i, const RWSlice &j, int k)
 
const RWMathVec< T > operator() (int i, const RWSlice &j, int k) const
 
RWMathVec< T > operator() (int i, int j, const RWSlice &k)
 
const RWMathVec< T > operator() (int i, int j, const RWSlice &k) const
 
RWMathVec< T > operator() (const RWSlice &i, int j, int k, int l)
 
const RWMathVec< T > operator() (const RWSlice &i, int j, int k, int l) const
 
RWMathVec< T > operator() (int i, const RWSlice &j, int k, int l)
 
const RWMathVec< T > operator() (int i, const RWSlice &j, int k, int l) const
 
RWMathVec< T > operator() (int i, int j, const RWSlice &k, int l)
 
const RWMathVec< T > operator() (int i, int j, const RWSlice &k, int l) const
 
RWMathVec< T > operator() (int i, int j, int k, const RWSlice &l)
 
const RWMathVec< T > operator() (int i, int j, int k, const RWSlice &l) const
 
RWGenMat< T > operator() (int i, const RWSlice &j, const RWSlice &k)
 
const RWGenMat< T > operator() (int i, const RWSlice &j, const RWSlice &k) const
 
RWGenMat< T > operator() (const RWSlice &i, int j, const RWSlice &k)
 
const RWGenMat< T > operator() (const RWSlice &i, int j, const RWSlice &k) const
 
RWGenMat< T > operator() (const RWSlice &i, const RWSlice &j, int k)
 
const RWGenMat< T > operator() (const RWSlice &i, const RWSlice &j, int k) const
 
RWGenMat< T > operator() (int i, int j, const RWSlice &k, const RWSlice &l)
 
const RWGenMat< T > operator() (int i, int j, const RWSlice &k, const RWSlice &l) const
 
RWGenMat< T > operator() (int i, const RWSlice &j, int k, const RWSlice &l)
 
const RWGenMat< T > operator() (int i, const RWSlice &j, int k, const RWSlice &l) const
 
RWGenMat< T > operator() (int i, const RWSlice &j, const RWSlice &k, int l)
 
const RWGenMat< T > operator() (int i, const RWSlice &j, const RWSlice &k, int l) const
 
RWGenMat< T > operator() (const RWSlice &i, int j, int k, const RWSlice &l)
 
const RWGenMat< T > operator() (const RWSlice &i, int j, int k, const RWSlice &l) const
 
RWGenMat< T > operator() (const RWSlice &i, int j, const RWSlice &k, int l)
 
const RWGenMat< T > operator() (const RWSlice &i, int j, const RWSlice &k, int l) const
 
RWGenMat< T > operator() (const RWSlice &i, const RWSlice &j, int k, int l)
 
const RWGenMat< T > operator() (const RWSlice &i, const RWSlice &j, int k, int l) const
 
RWMathArray< T > operator() (const RWSlice &i, const RWSlice &j, const RWSlice &k)
 
const RWMathArray< T > operator() (const RWSlice &i, const RWSlice &j, const RWSlice &k) const
 
RWMathArray< T > operator() (int i, const RWSlice &j, const RWSlice &k, const RWSlice &l)
 
const RWMathArray< T > operator() (int i, const RWSlice &j, const RWSlice &k, const RWSlice &l) const
 
RWMathArray< T > operator() (const RWSlice &i, int j, const RWSlice &k, const RWSlice &l)
 
const RWMathArray< T > operator() (const RWSlice &i, int j, const RWSlice &k, const RWSlice &l) const
 
RWMathArray< T > operator() (const RWSlice &i, const RWSlice &j, int k, const RWSlice &l)
 
const RWMathArray< T > operator() (const RWSlice &i, const RWSlice &j, int k, const RWSlice &l) const
 
RWMathArray< T > operator() (const RWSlice &i, const RWSlice &j, const RWSlice &k, int l)
 
const RWMathArray< T > operator() (const RWSlice &i, const RWSlice &j, const RWSlice &k, int l) const
 
RWMathArray< T > operator() (const RWSlice &i, const RWSlice &j, const RWSlice &k, const RWSlice &l)
 
const RWMathArray< T > operator() (const RWSlice &i, const RWSlice &j, const RWSlice &k, const RWSlice &l) const
 
RWMathArray< T > & operator*= (const T &s)
 
RWMathArray< T > & operator*= (const RWMathArray< T > &v)
 
RWMathArray< T > & operator++ ()
 
void operator++ (int)
 
RWMathArray< T > & operator+= (const T &s)
 
RWMathArray< T > & operator+= (const RWMathArray< T > &v)
 
RWMathArray< T > & operator-- ()
 
void operator-- (int)
 
RWMathArray< T > & operator-= (const T &s)
 
RWMathArray< T > & operator-= (const RWMathArray< T > &v)
 
RWMathArray< T > & operator/= (const T &s)
 
RWMathArray< T > & operator/= (const RWMathArray< T > &v)
 
RWMathArray< T > & operator= (const RWMathArray< T > &v)
 
RWMathArray< T > & operator= (const T &s)
 
bool operator== (const RWMathArray< T > &v) const
 
T & operator[] (const RWIntVec &i)
 
operator[] (const RWIntVec &i) const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
RWMathArray< T > & reference (const RWMathArray< T > &v)
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
void reshape (const RWIntVec &v, Storage storage=COLUMN_MAJOR)
 
void reshape (size_t m, size_t n, size_t o, Storage storage=COLUMN_MAJOR)
 
void reshape (size_t m, size_t n, size_t o, size_t p, Storage storage=COLUMN_MAJOR)
 
void resize (const RWIntVec &v, Storage storage=COLUMN_MAJOR)
 
void resize (size_t m, size_t n, size_t o, Storage storage=COLUMN_MAJOR)
 
void resize (size_t m, size_t n, size_t o, size_t p, Storage storage=COLUMN_MAJOR)
 
void restoreFrom (RWFile &)
 
void restoreFrom (RWvistream &)
 
void saveOn (RWFile &) const
 
void saveOn (RWvostream &) const
 
RWMathArray< T > slice (const RWIntVec &start, const RWIntVec &lgt, const RWGenMat< int > &strider) const
 

Friends

RWMathArray< double > imag (const RWMathArray< DComplex > &)
 
RWMathArray< double > real (const RWMathArray< DComplex > &)
 

Related Functions

(Note that these are not member functions.)

RWMathArray< double > abs (const RWMathArray< double > &)
 
RWMathArray< float > abs (const RWMathArray< float > &)
 
RWMathArray< int > abs (const RWMathArray< int > &)
 
RWMathArray< double > abs (const RWMathArray< DComplex > &)
 
RWMathArray< signed char > abs (const RWMathArray< signed char > &)
 
template<class T >
RWMathArray< T > acos (const RWMathArray< T > &x)
 
RWMathArray< double > arg (const RWMathArray< DComplex > &v)
 
template<class T >
RWMathArray< T > asin (const RWMathArray< T > &x)
 
template<class T >
RWMathArray< T > atan (const RWMathArray< T > &x)
 
template<class T >
RWMathArray< T > atan2 (const RWMathArray< T > &x, const RWMathArray< T > &y)
 
template<class T >
RWMathArray< T > ceil (const RWMathArray< T > &x)
 
RWMathArray< DComplexconj (const RWMathArray< DComplex > &v)
 
template<class T >
RWMathArray< T > cos (const RWMathArray< T > &x)
 
template<class T >
RWMathArray< T > cosh (const RWMathArray< T > &x)
 
template<class T >
RWMathArray< T > exp (const RWMathArray< T > &x)
 
template<class T >
RWMathArray< T > floor (const RWMathArray< T > &x)
 
double frobNorm (const RWMathArray< double > &v)
 
float frobNorm (const RWMathArray< float > &v)
 
double frobNorm (const RWMathArray< DComplex > &v)
 
template<class T >
RWMathArray< T > log (const RWMathArray< T > &x)
 
template<class T >
RWMathArray< T > log10 (const RWMathArray< T > &x)
 
template<class T >
RWIntVec maxIndex (const RWMathArray< T > &)
 
double maxNorm (const RWMathArray< double > &v)
 
float maxNorm (const RWMathArray< float > &v)
 
double maxNorm (const RWMathArray< DComplex > &v)
 
template<class T >
maxValue (const RWMathArray< T > &)
 
template<class T >
mean (const RWMathArray< T > &V)
 
template<class T >
RWIntVec minIndex (const RWMathArray< T > &)
 
template<class T >
minValue (const RWMathArray< T > &)
 
RWMathArray< double > norm (const RWMathArray< DComplex > &)
 
template<class T >
RWMathArray< T > operator* (const RWMathArray< T > &u, const RWMathArray< T > &v)
 
template<class T >
RWMathArray< T > operator* (const RWMathArray< T > &u, const T &s)
 
template<class T >
RWMathArray< T > operator* (const T &s, const RWMathArray< T > &v)
 
template<class T >
RWMathArray< T > operator+ (const RWMathArray< T > &u)
 
template<class T >
RWMathArray< T > operator+ (const RWMathArray< T > &u, const RWMathArray< T > &v)
 
template<class T >
RWMathArray< T > operator+ (const RWMathArray< T > &u, const T &s)
 
template<class T >
RWMathArray< T > operator+ (const T &s, const RWMathArray< T > &v)
 
template<class T >
RWMathArray< T > operator- (const RWMathArray< T > &u)
 
template<class T >
RWMathArray< T > operator- (const RWMathArray< T > &u, const RWMathArray< T > &v)
 
template<class T >
RWMathArray< T > operator- (const T &s, const RWMathArray< T > &v)
 
template<class T >
RWMathArray< T > operator- (const RWMathArray< T > &u, const T &s)
 
template<class T >
RWMathArray< T > operator/ (const RWMathArray< T > &u, const RWMathArray< T > &v)
 
template<class T >
RWMathArray< T > operator/ (const T &s, const RWMathArray< T > &v)
 
template<class T >
RWMathArray< T > operator/ (const RWMathArray< T > &u, const T &s)
 
template<class T >
RWMathArray< T > pow (const RWMathArray< T > &x, const RWMathArray< T > &y)
 
template<class T >
RWMathArray< T > pow (const RWMathArray< T > &x, T y)
 
template<class T >
RWMathArray< T > pow (T x, const RWMathArray< T > &y)
 
template<class T >
RWMathArray< T > sin (const RWMathArray< T > &V)
 
template<class T >
RWMathArray< T > sinh (const RWMathArray< T > &V)
 
template<class T >
RWMathArray< T > sqrt (const RWMathArray< T > &V)
 
template<class T >
RWMathArray< T > tan (const RWMathArray< T > &x)
 
template<class T >
RWMathArray< T > tanh (const RWMathArray< T > &x)
 
RWMathArray< signed char > toChar (const RWMathArray< int > &v)
 
RWMathArray< float > toFloat (const RWMathArray< double > &v)
 
template<class T >
RWGenMat< T > toGenMat (const RWMathArray< T > &)
 
RWMathArray< int > toInt (const RWMathArray< double > &v)
 
RWMathArray< int > toInt (const RWMathArray< float > &v)
 
template<class T >
toScalar (const RWMathArray< T > &)
 
template<class T >
RWMathVec< T > toVec (const RWMathArray< T > &)
 

Detailed Description

template<class T>
class RWMathArray< T >

Class RWMathArray is a templatized arbitrary dimension array class.

Synopsis
#include <rw/math/mtharray.h>
Example
#include <rw/math/mtharray.h>
int main()
{
RWMathArray<DComplex> B(5,5,5,5,reUninitialized);
// Set a plane of data to 5 + 2i
A(RWAll,0,RWAll) = DComplex(5,2);
}
See also
RWConvertMathArray

Member Typedef Documentation

template<class T>
typedef RWMathArrayConstIterator<T> RWMathArray< T >::const_iterator

A type that provides a const random-access iterator over the elements in the container.

template<class T>
typedef std::reverse_iterator<const_iterator> RWMathArray< T >::const_reverse_iterator

A type that provides a const random-access, reverse-order iterator over the elements in the container.

template<class T>
typedef RWMathArrayIterator<T> RWMathArray< T >::iterator

A type that provides a random-access iterator over the elements in the container.

template<class T>
typedef rw_numeric_traits<T>::mathFunType RWMathArray< T >::mathFunType

Typedef for the function pointer used in the method apply(). For more information, see rw_numeric_traits<T>::mathFunType.

template<class T>
typedef rw_numeric_traits<T>::mathFunType2 RWMathArray< T >::mathFunType2

Typedef for the function pointer used in the method apply2(). For more information, see rw_numeric_traits<T>::mathFunType2.

template<class T>
typedef rw_numeric_traits<T>::norm_type RWMathArray< T >::norm_type

Typedef for the usual return type of numerical norm-like functions. For more information, see rw_numeric_traits<T>::norm_type.

template<class T>
typedef rw_numeric_traits<T>::promote_type RWMathArray< T >::promote_type

Typedef for the promotion type. For more information, see rw_numeric_traits<T>::promote_type.

template<class T>
typedef std::reverse_iterator<iterator> RWMathArray< T >::reverse_iterator

A type that provides a random-access, reverse-order iterator over the elements in the container.

Constructor & Destructor Documentation

template<class T>
RWMathArray< T >::RWMathArray ( )

Constructs a 0-dimensional array, useful for declaring vectors of arrays. Like any other array, this array can subsequently be reshaped or resized (see member functions reshape() and resize()). Note that since this is a 0-dimensional (not 0 length) array, and since by definition a 0-dimensional array is a scalar, the array has one element of data.

template<class T>
RWMathArray< T >::RWMathArray ( const RWIntVec n,
RWUninitialized  ,
Storage  storage = COLUMN_MAJOR 
)
inline

Constructs an uninitialized array with a specified size. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions. The RWUninitialized type is an enumeration type with only one value, rwUninitialized. The rwUninitialized argument is used to distinguish the last dimension size from an initial value.

template<class T>
RWMathArray< T >::RWMathArray ( size_t  m,
size_t  n,
size_t  o,
RWUninitialized   
)

Constructs an uninitialized array with a specified size. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions. The RWUninitialized type is an enumeration type with only one value, rwUninitialized. The rwUninitialized argument is used to distinguish the last dimension size from an initial value.

template<class T>
RWMathArray< T >::RWMathArray ( size_t  m,
size_t  n,
size_t  o,
size_t  p,
RWUninitialized   
)

Constructs an uninitialized array with a specified size. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions. The RWUninitialized type is an enumeration type with only one value, rwUninitialized. The rwUninitialized argument is used to distinguish the last dimension size from an initial value.

template<class T>
RWMathArray< T >::RWMathArray ( const RWIntVec vec,
RWTRand< RWRandGenerator > &  r,
Storage  s = COLUMN_MAJOR 
)

Constructs an array with a specified size initialized with random numbers generated by r. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( size_t  m,
size_t  n,
size_t  o,
RWTRand< RWRandGenerator > &  r 
)

Constructs an array with a specified size initialized with random numbers generated by r. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( size_t  m,
size_t  n,
size_t  o,
size_t  p,
RWTRand< RWRandGenerator > &  r 
)

Constructs an array with a specified size initialized with random numbers generated by r. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( const RWIntVec vec,
val 
)

Constructs an array with a specified size. Each element in the array is initialized to val. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( size_t  m,
size_t  n,
size_t  o,
val 
)

Constructs an array with a specified size. Each element in the array is initialized to val. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( size_t  m,
size_t  n,
size_t  o,
size_t  p,
val 
)

Constructs an array with a specified size. Each element in the array is initialized to val. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( const char *  s)

Constructs an array from the null terminated character string s. The format of the character string is the same as that expected by the global operator operator>> described in this entry.

template<class T>
RWMathArray< T >::RWMathArray ( const RWMathArray< T > &  a)
inline

Copy constructor. The new array and the old array both view the same data.

template<class T>
RWMathArray< T >::RWMathArray ( const T *  dat,
const RWIntVec n 
)

Constructs an array with a specified size using the data in the vector dat as initial data. A copy of dat is made. The vector dat must have at least as many elements as the array. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( const T *  dat,
size_t  m,
size_t  n,
size_t  o 
)

Constructs an array with a specified size using the data in the vector dat as initial data. A copy of dat is made. The vector dat must have at least as many elements as the array. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( const T *  dat,
size_t  m,
size_t  n,
size_t  o,
size_t  p 
)

Constructs an array with a specified size using the data in the vector dat as initial data. A copy of dat is made. The vector dat must have at least as many elements as the array. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( const RWMathVec< T > &  vec,
const RWIntVec n 
)

Constructs an array using the data in the vector vec. The array is a new view of the same data as vec, so no copy of the data is made. The vector vec must have the same number of elements as the array. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( const RWMathVec< T > &  vec,
size_t  m,
size_t  n,
size_t  o 
)

Constructs an array using the data in the vector vec. The array is a new view of the same data as vec, so no copy of the data is made. The vector vec must have the same number of elements as the array. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( const RWMathVec< T > &  vec,
size_t  m,
size_t  n,
size_t  o,
size_t  p 
)

Constructs an array using the data in the vector vec. The array is a new view of the same data as vec, so no copy of the data is made. The vector vec must have the same number of elements as the array. The constructor taking an integer vector is useful for constructing arrays with more than four dimensions.

template<class T>
RWMathArray< T >::RWMathArray ( const RWMathVec< T > &  )

Constructs a 1-dimensional or 2-dimensional array from a vector or matrix. The resulting array is an alternate view of the same data. This constructor is most often used implicitly by the compiler to pass vectors or matrices to subroutines written to operate on arrays of arbitrary dimension. This allows you to write one subroutine suitable for vectors, matrices, or arrays.

template<class T>
RWMathArray< T >::RWMathArray ( const RWGenMat< T > &  )

Constructs a 1-dimensional or 2-dimensional array from a vector or matrix. The resulting array is an alternate view of the same data. This constructor is most often used implicitly by the compiler to pass vectors or matrices to subroutines written to operate on arrays of arbitrary dimension. This allows you to write one subroutine suitable for vectors, matrices, or arrays.

template<class T>
RWMathArray< T >::RWMathArray ( const RWMathArray< double > &  re,
const RWMathArray< double > &  im 
)

Constructs a complex array from the double precision arrays re and im, with the real part of the array equal to re and the imaginary part equal to im. A new copy of the data is made.

Member Function Documentation

template<class T>
RWMathArray<T> RWMathArray< T >::apply ( mathFunType  f) const
inline

Returns the result of applying the passed function to every element in the array. A function of type RWMathArray<T>::mathFunType takes and returns a T.

template<class T>
RWMathArray<norm_type> RWMathArray< T >::apply2 ( mathFunType2  f) const

Returns the result of applying the passed function to every element in the array. The function of type RWMathArray<T>::mathFunType2 takes a T and returns an RWMathArray<T>::norm_type. See class rw_numeric_traits for a description of RWMathArray<T>::norm_type.

template<class T>
iterator RWMathArray< T >::begin ( )
inline

Returns an iterator pointing to the first element of self.

template<class T>
const_iterator RWMathArray< T >::begin ( ) const
inline

Returns an iterator pointing to the first element of self.

template<class T>
size_t RWMathArray< T >::binaryStoreSize ( ) const

Returns the number of bytes required to store the array to an RWFile using member function saveOn(RWFile&).

template<class T>
const_iterator RWMathArray< T >::cbegin ( ) const
inline

Returns an iterator pointing to the first element of self.

template<class T>
const_iterator RWMathArray< T >::cend ( ) const
inline

Returns an iterator pointing to one element past the last element of self.

template<class T>
RWMathArray<T> RWMathArray< T >::copy ( ) const

Returns a copy with distinct instance variables.

template<class T>
const_reverse_iterator RWMathArray< T >::crbegin ( ) const
inline

Returns an iterator pointing to the last element of self.

template<class T>
const_reverse_iterator RWMathArray< T >::crend ( ) const
inline

Returns an iterator pointing to one element past the first element of self.

template<class T>
T* RWMathArray< T >::data ( void  )
inline

Returns a pointer to the start of an array's data. Should be used with care, as this accesses the array's data directly.

template<class T>
const T* RWMathArray< T >::data ( void  ) const
inline

Returns a pointer to the start of an array's data. Should be used with care, as this accesses the array's data directly.

template<class T>
RWMathArray<T> RWMathArray< T >::deepCopy ( ) const

Alias for copy().

template<class T>
void RWMathArray< T >::deepenShallowCopy ( )

When invoked for an array, guarantees that there is only one reference to that object and that its data are in contiguous memory.

template<class T>
size_t RWMathArray< T >::dimension ( ) const
inline

Returns the number of dimensions of the array.

template<class T>
iterator RWMathArray< T >::end ( )
inline

Returns an iterator pointing to one element past the last element of self.

template<class T>
const_iterator RWMathArray< T >::end ( ) const
inline

Returns an iterator pointing to one element past the last element of self.

template<class T>
RWIntVec RWMathArray< T >::length ( ) const
inline

Returns the number of entries in a dimension of the array, returning all the dimension lengths at once.

template<class T>
int RWMathArray< T >::length ( int  i) const
inline

Returns the size of the indicated dimension.

template<class T>
RWMathArray< T >::operator RWMathArray< promote_type > ( )
inline

Implicit conversion operator to rw_numeric_traits<T>::promote_type.

template<class T>
bool RWMathArray< T >::operator!= ( const RWMathArray< T > &  v) const

Returns true if self and the argument are equivalent (or not equivalent). To be equivalent, they must have the same number of rows as well as columns, and each element in self must equal the corresponding element in the argument.

template<class T >
T & RWMathArray< T >::operator() ( const RWIntVec i)
inline

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a reference to the element indexed by i.

template<class T >
T RWMathArray< T >::operator() ( const RWIntVec i) const
inline

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns the element indexed by i.

template<class T >
T & RWMathArray< T >::operator() ( int  i,
int  j,
int  k 
)
inline

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a reference to the element at (i th, j th, k th) position of the array.

template<class T >
T RWMathArray< T >::operator() ( int  i,
int  j,
int  k 
) const
inline

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns the element at (i th, j th, k th) position of the array.

template<class T >
T & RWMathArray< T >::operator() ( int  i,
int  j,
int  k,
int  l 
)
inline

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a reference to the element at (i th, j th, k th, l th) position of the array.

template<class T >
T RWMathArray< T >::operator() ( int  i,
int  j,
int  k,
int  l 
) const
inline

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns the element at (i th, j th, k th, l th) position of the array.

template<class T>
RWMathVec<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
int  k 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathVec that contains the elements at (i th, j th, k th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathVec<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
int  k 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathVec that contains the elements at (i th, j th, k th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathVec<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
int  k 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathVec that contains the elements at (i th, j th, k th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathVec<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
int  k 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathVec that contains the elements at (i th, j th, k th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathVec<T> RWMathArray< T >::operator() ( int  i,
int  j,
const RWSlice k 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathVec that contains the elements at (i th, j th, k th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathVec<T> RWMathArray< T >::operator() ( int  i,
int  j,
const RWSlice k 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathVec that contains the elements at (i th, j th, k th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathVec<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
int  k,
int  l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathVec that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathVec<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
int  k,
int  l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathVec that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathVec<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
int  k,
int  l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathVec that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathVec<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
int  k,
int  l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathVec that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathVec<T> RWMathArray< T >::operator() ( int  i,
int  j,
const RWSlice k,
int  l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathVec that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathVec<T> RWMathArray< T >::operator() ( int  i,
int  j,
const RWSlice k,
int  l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathVec that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathVec<T> RWMathArray< T >::operator() ( int  i,
int  j,
int  k,
const RWSlice l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathVec that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathVec<T> RWMathArray< T >::operator() ( int  i,
int  j,
int  k,
const RWSlice l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathVec that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathVec being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
const RWSlice k 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
const RWSlice k 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
const RWSlice k 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
const RWSlice k 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
int  k 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
int  k 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( int  i,
int  j,
const RWSlice k,
const RWSlice l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( int  i,
int  j,
const RWSlice k,
const RWSlice l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
int  k,
const RWSlice l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
int  k,
const RWSlice l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
const RWSlice k,
int  l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
const RWSlice k,
int  l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
int  k,
const RWSlice l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
int  k,
const RWSlice l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
const RWSlice k,
int  l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
const RWSlice k,
int  l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
int  k,
int  l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWGenMat<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
int  k,
int  l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWGenMat that contains the elements at (i th, j th, k th, l th) position of the array. The RWGenMat being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
const RWSlice k 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathArray that contains the elements at (i th, j th, k th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
const RWSlice k 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathArray that contains the elements at (i th, j th, k th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathArray<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
const RWSlice k,
const RWSlice l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathArray<T> RWMathArray< T >::operator() ( int  i,
const RWSlice j,
const RWSlice k,
const RWSlice l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
const RWSlice k,
const RWSlice l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
int  j,
const RWSlice k,
const RWSlice l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
int  k,
const RWSlice l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
int  k,
const RWSlice l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
const RWSlice k,
int  l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
const RWSlice k,
int  l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
const RWSlice k,
const RWSlice l 
)

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a non-const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
const RWMathArray<T> RWMathArray< T >::operator() ( const RWSlice i,
const RWSlice j,
const RWSlice k,
const RWSlice l 
) const

Subscripting operator for the array, with optional bounds checking. Bounds checking is enabled by defining the preprocessor macro RWBOUNDS_CHECK before including the header file. Returns a const RWMathArray that contains the elements at (i th, j th, k th, l th) position of the array. The RWMathArray being returned is a new view of the same data as the array being subscripted.

template<class T>
RWMathArray<T>& RWMathArray< T >::operator*= ( const T &  s)

Assignment by multiplication operator with conventional meaning. The expression u *= v implies \(u_{i} = u_{i} * s\)

template<class T>
RWMathArray<T>& RWMathArray< T >::operator*= ( const RWMathArray< T > &  v)

Assignment by multiplication operator with conventional meaning. The expression u *= v implies \(u_{i} = u_{i} * v_{i}\) The RWMathArray objects must conform, that is, have the same dimensions.

template<class T>
RWMathArray<T>& RWMathArray< T >::operator++ ( )

Increments or decrements each element of self. The functions taking an integer parameter are invoked if the operator is used as a postfix operator.

template<class T>
void RWMathArray< T >::operator++ ( int  )
inline

Increments or decrements each element of self. The functions taking an integer parameter are invoked if the operator is used as a postfix operator.

template<class T>
RWMathArray<T>& RWMathArray< T >::operator+= ( const T &  s)

Assignment by addition operator with conventional meaning. The expression u += s implies \(u_{i} = u_{i} + s\)

template<class T>
RWMathArray<T>& RWMathArray< T >::operator+= ( const RWMathArray< T > &  v)

Assignment by addition operator with conventional meaning. The expression u += v implies \(u_{i} = u_{i} + v_{i}\) The RWMathArray objects must conform, that is, have the same dimensions.

template<class T>
RWMathArray<T>& RWMathArray< T >::operator-- ( )

Increments or decrements each element of self. The functions taking an integer parameter are invoked if the operator is used as a postfix operator.

template<class T>
void RWMathArray< T >::operator-- ( int  )
inline

Increments or decrements each element of self. The functions taking an integer parameter are invoked if the operator is used as a postfix operator.

template<class T>
RWMathArray<T>& RWMathArray< T >::operator-= ( const T &  s)
inline

Assignment by subtraction operator with conventional meaning. The expression u -= v implies \(u_{i} = u_{i} - s\)

template<class T>
RWMathArray<T>& RWMathArray< T >::operator-= ( const RWMathArray< T > &  v)

Assignment by subtraction operator with conventional meaning. The expression u -= v implies \(u_{i} = u_{i} - v_{i}\) The RWMathArray objects must conform, that is, have the same dimensions.

template<class T>
RWMathArray<T>& RWMathArray< T >::operator/= ( const T &  s)

Assignment by division operator with conventional meaning. The expression u /= v implies \(u_{i} = u_{i} / s\)

template<class T>
RWMathArray<T>& RWMathArray< T >::operator/= ( const RWMathArray< T > &  v)

Assignment by division operator with conventional meaning. The expression u /= v implies u_{i} = u_{i} / v_{i} The RWMathArray objects must conform, that is, have the same dimensions.

template<class T>
RWMathArray<T>& RWMathArray< T >::operator= ( const RWMathArray< T > &  v)

Assignment operator with conventional meaning. The expression u = v implies \(u_{i} = v_{i}\) The RWMathArray objects must conform, that is, have the same dimensions.

template<class T>
RWMathArray<T>& RWMathArray< T >::operator= ( const T &  s)

Assignment operator with conventional meaning. The expression u = s implies \(u_{i} = s\).

template<class T>
bool RWMathArray< T >::operator== ( const RWMathArray< T > &  v) const

Returns true if self and the argument are equivalent (or not equivalent). To be equivalent, they must have the same number of rows as well as columns, and each element in self must equal the corresponding element in the argument.

template<class T >
T & RWMathArray< T >::operator[] ( const RWIntVec i)
inline

Subscripting operator for the array, with bounds checking. Returns a reference to the element indexed by i.

template<class T >
T RWMathArray< T >::operator[] ( const RWIntVec i) const
inline

Subscripting operator for the array, with bounds checking. Returns the element indexed by i.

template<class T>
reverse_iterator RWMathArray< T >::rbegin ( )
inline

Returns an iterator pointing to the last element of self.

template<class T>
const_reverse_iterator RWMathArray< T >::rbegin ( ) const
inline

Returns an iterator pointing to the last element of self.

template<class T>
RWMathArray<T>& RWMathArray< T >::reference ( const RWMathArray< T > &  v)

Makes self a view of data in v. The view currently associated with the array is lost.

template<class T>
reverse_iterator RWMathArray< T >::rend ( )
inline

Returns an iterator pointing to one element past the first element of self.

template<class T>
const_reverse_iterator RWMathArray< T >::rend ( ) const
inline

Returns an iterator pointing to one element past the first element of self.

template<class T>
void RWMathArray< T >::reshape ( const RWIntVec v,
Storage  storage = COLUMN_MAJOR 
)

Changes the size of the array. After reshaping, the contents of the array are undefined; that is, they can be and probably will be garbage.

template<class T>
void RWMathArray< T >::reshape ( size_t  m,
size_t  n,
size_t  o,
Storage  storage = COLUMN_MAJOR 
)

Changes the size of the array. After reshaping, the contents of the array are undefined; that is, they can be and probably will be garbage.

template<class T>
void RWMathArray< T >::reshape ( size_t  m,
size_t  n,
size_t  o,
size_t  p,
Storage  storage = COLUMN_MAJOR 
)

Changes the size of the array. After reshaping, the contents of the array are undefined; that is, they can be and probably will be garbage.

template<class T>
void RWMathArray< T >::resize ( const RWIntVec v,
Storage  storage = COLUMN_MAJOR 
)

Changes the size of the array, adding 0s or truncating as necessary.

template<class T>
void RWMathArray< T >::resize ( size_t  m,
size_t  n,
size_t  o,
Storage  storage = COLUMN_MAJOR 
)

Changes the size of the array, adding 0s or truncating as necessary.

template<class T>
void RWMathArray< T >::resize ( size_t  m,
size_t  n,
size_t  o,
size_t  p,
Storage  storage = COLUMN_MAJOR 
)

Changes the size of the array, adding 0s or truncating as necessary.

template<class T>
void RWMathArray< T >::restoreFrom ( RWFile )

Restores self from a RWFile. To use this function with a user-defined type, the corresponding operator>> must be defined:

template<class T>
void RWMathArray< T >::restoreFrom ( RWvistream )

Restores self from a virtual stream. To use this function with a user-defined type, the corresponding operator>> must be defined:

template<class T>
void RWMathArray< T >::saveOn ( RWFile ) const

Stores self in a binary format to an RWFile. To use these functions with a user-defined type, the corresponding operator<< must be defined:

template<class T>
void RWMathArray< T >::saveOn ( RWvostream ) const

Stores self to a RWvostream. To use these functions with a user-defined type, the corresponding operator<< must be defined:

template<class T>
RWMathArray<T> RWMathArray< T >::slice ( const RWIntVec start,
const RWIntVec lgt,
const RWGenMat< int > &  strider 
) const

Returns an array that views a slice of the array. The slice begins at element start and is of size lgt. The increment between successive elements in the slice's jth dimension is given by the jth column of the matrix strider. For 3-dimensional and 4-dimensional arrays, most useful slices can be more simply constructed using subscripting.

Friends And Related Function Documentation

template<class T>
RWMathArray< double > abs ( const RWMathArray< double > &  )
related

Returns the absolute values of each element.

Example
#include <rw/math/mtharray.h>
#include <iostream>
const double adata[] = {1.2,2.4,-1.2,0.8,-4.5};
int main() {
RWMathArray<double> a(adata,5, 1, 1);
std::cout << b;
return 0;
}

Program Output:

5x1x1 [
1.2
2.4
1.2
0.8
4.5
]
template<class T>
RWMathArray< float > abs ( const RWMathArray< float > &  )
related

Returns the absolute values of each element.

Example
#include <rw/math/mtharray.h>
#include <iostream>
const double adata[] = {1.2,2.4,-1.2,0.8,-4.5};
int main() {
RWMathArray<double> a(adata,5, 1, 1);
std::cout << b;
return 0;
}

Program Output:

5x1x1 [
1.2
2.4
1.2
0.8
4.5
]

See the example in abs(const RWMathArray<double>&).

template<class T>
RWMathArray< int > abs ( const RWMathArray< int > &  )
related

Returns the absolute values of each element.

Example
#include <rw/math/mtharray.h>
#include <iostream>
const double adata[] = {1.2,2.4,-1.2,0.8,-4.5};
int main() {
RWMathArray<double> a(adata,5, 1, 1);
std::cout << b;
return 0;
}

Program Output:

5x1x1 [
1.2
2.4
1.2
0.8
4.5
]

See the example in abs(const RWMathArray<double>&).

template<class T>
RWMathArray< double > abs ( const RWMathArray< DComplex > &  )
related

Returns the absolute values of each element.

Example
#include <rw/math/mtharray.h>
#include <iostream>
const double adata[] = {1.2,2.4,-1.2,0.8,-4.5};
int main() {
RWMathArray<double> a(adata,5, 1, 1);
std::cout << b;
return 0;
}

Program Output:

5x1x1 [
1.2
2.4
1.2
0.8
4.5
]

See the example in abs(const RWMathArray<double>&).

Note
The absolute value of a complex number is of type double. Therefore, if abs() is invoked for class RWMathArray<DComplex>, a vector of class RWMathArray<double> is returned.
template<class T>
RWMathArray< signed char > abs ( const RWMathArray< signed char > &  )
related

Returns the absolute values of each element.

Example
#include <rw/math/mtharray.h>
#include <iostream>
const double adata[] = {1.2,2.4,-1.2,0.8,-4.5};
int main() {
RWMathArray<double> a(adata,5, 1, 1);
std::cout << b;
return 0;
}

Program Output:

5x1x1 [
1.2
2.4
1.2
0.8
4.5
]

See the example in abs(const RWMathArray<double>&).

template<class T >
RWMathArray< T > acos ( const RWMathArray< T > &  x)
related

Returns arc cosines y such that \(y_{i} = cos^{-1} (x_{i})\). The yi(in radians) are in the range \(0 < y_{i} \leq \pi\), for elements xi with absolute values \(|x_{i}| \leq 1\).

template<class T>
RWMathArray< double > arg ( const RWMathArray< DComplex > &  v)
related

Returns the arguments ai (in radians) of x in the range \(-\pi < a_{i} \leq \pi\), where \(a_{i} = tan^{-1}[Im(x_{i})/Re(x_{i})]\). Multiple valued functions of complex arguments, such as sqrt() and log(), are therefore constrained to their principle value.

template<class T >
RWMathArray< T > asin ( const RWMathArray< T > &  x)
related

Takes x as an argument and returns arc sines y such that \(y_{i} = sin^{-1} (x_{i})\). The yi(in radians) are in the range \(-\pi/2 < y_{i} \leq \pi/2\) , for elements xi with absolute values \(|x_{i}| \leq 1\).

template<class T >
RWMathArray< T > atan ( const RWMathArray< T > &  x)
related

Takes x and returns y of arc tangents (in radians), such that \(y_{i} = tan^{-1}x_{i}\), where \(-\pi/2 < y_{i} \leq \pi/2\).

At least one of the arguments xi or yi must be nonzero.

template<class T >
RWMathArray< T > atan2 ( const RWMathArray< T > &  x,
const RWMathArray< T > &  y 
)
related

Takes two arguments and returns quadrant correct arc tangents z (in radians), such that \(z_{i} = tan^{-1} ( x_{i}/y_{i})\). For each element i, the expression \(atan2(x_{i}, y_{i})\) is mathematically equivalent to:

\[ tan^{-1}\left(\frac{x_i}{y_i}\right) \]

At least one of the arguments xi or yi must be nonzero.

template<class T >
RWMathArray< T > ceil ( const RWMathArray< T > &  x)
related

Takes x as an argument and returns y such that yi corresponds to the next integer greater than or equal to xi. For example, if x = [ -1.3, 4.3, 7.9] then y = [ -1, 5, 8].

template<class T>
RWMathArray< DComplex > conj ( const RWMathArray< DComplex > &  v)
related

Takes complex x as an argument and returns the complex conjugates x*. For example, if xi = (2.3, 1.4), then xi* = (2.3, -1.4).

template<class T >
RWMathArray< T > cos ( const RWMathArray< T > &  x)
related

Takes x as an argument and returns y such that \(y_{i} = cos(x_{i})\). The xi are in radians. For complex arguments, the complex cosine is returned.

template<class T >
RWMathArray< T > cosh ( const RWMathArray< T > &  x)
related

Takes x as an argument and returns hyperbolic cosines y such that \(y_{i} = cosh(x_{i})\). For complex arguments, the complex hyperbolic cosine is returned.

template<class T >
RWMathArray< T > exp ( const RWMathArray< T > &  x)
related

Takes an argument x and returns y such that:

\[ y_i = e^{x_i} \]

If class T is complex, the complex exponential is returned.

template<class T >
RWMathArray< T > floor ( const RWMathArray< T > &  x)
related

Takes x as an argument and returns y such that yi corresponds to the largest integer less than or equal to xi. For example, if x = [ 1.3, 4.4, -3.2], then y = [ 1, 4, -4].

template<class T>
double frobNorm ( const RWMathArray< double > &  v)
related

Computes the Frobenius norm, which is the square root of the sum of squares of its entries. For a vector, the formula is:

\[ \left \| A \right \|_{\text{Frob}} = \sqrt{\sum_{i_{0}=0}^{M_{0}-1} \sum_{i_{n-1}=0}^{M_{n-1}-1} \left | \text{a}_{i_{o}...i_{n-1}} \right |^2} \]

template<class T>
float frobNorm ( const RWMathArray< float > &  v)
related

Computes the Frobenius norm, which is the square root of the sum of squares of its entries. For a vector, the formula is:

\[ \left \| A \right \|_{\text{Frob}} = \sqrt{\sum_{i_{0}=0}^{M_{0}-1} \sum_{i_{n-1}=0}^{M_{n-1}-1} \left | \text{a}_{i_{o}...i_{n-1}} \right |^2} \]

template<class T>
double frobNorm ( const RWMathArray< DComplex > &  v)
related

Computes the Frobenius norm, which is the square root of the sum of squares of its entries. For a vector, the formula is:

\[ \left \| A \right \|_{\text{Frob}} = \sqrt{\sum_{i_{0}=0}^{M_{0}-1} \sum_{i_{n-1}=0}^{M_{n-1}-1} \left | \text{a}_{i_{o}...i_{n-1}} \right |^2} \]

template<class T>
RWMathArray< double > imag ( const RWMathArray< DComplex > &  )
friend

Takes complex x as an argument and returns y containing the imaginary parts \(y_{i} = Im(x_{i})\). With most versions of complex, the results can be used as an l-value:

RWMathArray<DComplex> v(3,3,3, DComplex(3,0)); // (0, 0), (0, 0), ...
imag(v) = 1.0; // (0, 1), (0, 1), ...
template<class T >
RWMathArray< T > log ( const RWMathArray< T > &  x)
related

Takes x as an argument and returns natural logarithms y such that \(y_{i}=log(x_{i})\). The arguments x i must not be 0. For complex arguments, the principal value of the complex natural logarithm is returned.

template<class T >
RWMathArray< T > log10 ( const RWMathArray< T > &  x)
related

Takes x as an argument and returns base 10 logarithms y such that \(y_{i}=log_{10}(x_{i})\). The arguments x i must not be 0.

template<class T >
RWIntVec maxIndex ( const RWMathArray< T > &  )
related

Return the index of the maximum element of the vector. If instead you want the maximum value use function maxValue().

template<class T>
double maxNorm ( const RWMathArray< double > &  v)
related

Returns the value of the element with largest absolute value. Note that this is not a norm in the mathematical sense of the word.

template<class T>
float maxNorm ( const RWMathArray< float > &  v)
related

Returns the value of the element with largest absolute value. Note that this is not a norm in the mathematical sense of the word.

template<class T>
double maxNorm ( const RWMathArray< DComplex > &  v)
related

Returns the value of the element with largest absolute value. Note that this is not a norm in the mathematical sense of the word.

template<class T >
T maxValue ( const RWMathArray< T > &  )
related

Return the maximum value.

template<class T >
T mean ( const RWMathArray< T > &  V)
related

Takes a RWMathArray an argument and returns <x>, the mean value, where:

\[ \langle x \rangle = \frac{1}{n}\sum_{i=0}^{n-1}x_i \]

For example, if x = [1, 4, 3, 4], then <x> = 3.

template<class T >
RWIntVec minIndex ( const RWMathArray< T > &  )
related

Return the index of the minimum element of the vector. If instead you want the minimum value use function minValue().

template<class T >
T minValue ( const RWMathArray< T > &  )
related

Return the minimum value.

template<class T>
RWMathArray< double > norm ( const RWMathArray< DComplex > &  )
related

Takes complex x as an argument and returns real y containing the norm:

\[ y_{i} = [Re(x_{i})]^{2} + [Im(x_{i})]^{2} \]

template<class T >
RWMathArray< T > operator* ( const RWMathArray< T > &  u,
const RWMathArray< T > &  v 
)
related

Multiplication operator, with conventional meaning, applied element-by-element. For matrices u, v, and w, the expression w = u * v implies \(w_{i} = u_{i} * v_{i}\). Therefore, operator*() implies an element-by-element multiply, not the inner product. The arrays must conform, that is, have the same dimensions, or an exception with value RWMATH_NMATCH occurs.

template<class T >
RWMathArray< T > operator* ( const RWMathArray< T > &  u,
const T &  s 
)
related

Multiplication operator, with conventional meaning, applied element-by-element. For matrices u, w, and scaler s, the expression w = u * s implies \(w_{i} = u_{i} * s\).

template<class T >
RWMathArray< T > operator* ( const T &  s,
const RWMathArray< T > &  v 
)
related

Multiplication operator, with conventional meaning, applied element-by-element. For matrices v, w, and scaler s, the expression w = s * v implies \(w_{i} = s * v_{i}\).

template<class T >
RWMathArray< T > operator+ ( const RWMathArray< T > &  u)
related

Unary plus operator, with conventional meaning, applied element-by-element. For matrix u, and w, the expression w = +u implies \(w_{i} = +u_{i}\).

template<class T >
RWMathArray< T > operator+ ( const RWMathArray< T > &  u,
const RWMathArray< T > &  v 
)
related

Addition operator, with conventional meaning, applied element-by-element. For matrices u, v, and w, the expression w = u + v implies \(w_{i} = u_{i} + v_{i}\). The arrays must conform, that is, have the same dimensions, or an exception with value RWMATH_NMATCH occurs.

template<class T >
RWMathArray< T > operator+ ( const RWMathArray< T > &  u,
const T &  s 
)
related

Addition operator, with conventional meaning, applied element-by-element. For matrices u, w, and scaler s, the expression w = u + s implies \(w_{i} = u_{i} + s\).

template<class T >
RWMathArray< T > operator+ ( const T &  s,
const RWMathArray< T > &  v 
)
related

Addition operator, with conventional meaning, applied element-by-element. For matrices v, w, and scaler s, the expression w = s + v implies \(w_{i} = s + v_{i}\).

template<class T >
RWMathArray< T > operator- ( const RWMathArray< T > &  u)
related

Unary minus operator, with conventional meaning, applied element-by-element. For matrix u, and w, the expression w = -u implies \(w_{i} = -u_{i}\).

template<class T >
RWMathArray< T > operator- ( const RWMathArray< T > &  u,
const RWMathArray< T > &  v 
)
related

Subtraction operator, with conventional meaning, applied element-by-element. For matrices u, v, and w, the expression w = u - v implies \(w_{i} = u_{i} - v_{i}\). The arrays must conform, that is, have the same dimensions, or an exception with value RWMATH_NMATCH occurs.

template<class T >
RWMathArray< T > operator- ( const T &  s,
const RWMathArray< T > &  v 
)
related

Subtraction operator, with conventional meaning, applied element-by-element. For matrices v, w, and scaler s, the expression w = s - v implies \(w_{i} = s - v_{i}\).

template<class T >
RWMathArray< T > operator- ( const RWMathArray< T > &  u,
const T &  s 
)
related

Subtraction operator, with conventional meaning, applied element-by-element. For matrices u, w, and scaler s, the expression w = u - s implies \(w_{i} = u_{i} - s\).

template<class T >
RWMathArray< T > operator/ ( const RWMathArray< T > &  u,
const RWMathArray< T > &  v 
)
related

Division operator, with conventional meaning, applied element-by-element. For matrices u, v, and w, the expression w = u / v implies \(w_{i} = u_{i} / v_{i}\). The arrays must conform, that is, have the same dimensions, or an exception with value RWMATH_NMATCH occurs.

template<class T >
RWMathArray< T > operator/ ( const T &  s,
const RWMathArray< T > &  v 
)
related

Division operator, with conventional meaning, applied element-by-element. For matrices v, w, and scaler s, the expression w = s / v implies \(w_{i} = s / v_{i}\).

template<class T >
RWMathArray< T > operator/ ( const RWMathArray< T > &  u,
const T &  s 
)
related

Division operator, with conventional meaning, applied element-by-element. For matrices u, w, and scaler s, the expression w = u / s implies \(w_{i} = u_{i} / s\).

template<class T >
RWMathArray< T > pow ( const RWMathArray< T > &  x,
const RWMathArray< T > &  y 
)
related

The function pow() takes two arguments: pow( x, y ).

Returns z such that:

\[ z_i = (x_i)^{y_i} \]

If the number of elements in x does not match the number of elements in y, an exception with value RWMATH_MNMATCH will occur.

template<class T >
RWMathArray< T > pow ( const RWMathArray< T > &  x,
y 
)
related

The function pow() takes two arguments: pow( x, y ).

Returns z such that:

\[ z_i = (x_i)^{y} \]

template<class T >
RWMathArray< T > pow ( x,
const RWMathArray< T > &  y 
)
related

The function pow() takes two arguments: pow( x, y ).

Returns z such that:

\[ z_i = (x)^{y_i} \]

template<class T>
RWMathArray< double > real ( const RWMathArray< DComplex > &  )
friend

Takes a complex argument x and returns real y containing the real part \(y_{i}=Re(x_{i})\). With most versions of complex, the results can be used as an l-value:

RWMathArray<DComplex> v(5,5,5,0); // (0, 0), (0, 0), ...
real(v) = 1.0; // (1, 0), (1, 0), ...
template<class T >
RWMathArray< T > sin ( const RWMathArray< T > &  V)
related

The function sin() takes x as an argument and returns y such that \(y_{i} = sin(x_{i})\). The xi are in radians. For complex classes, the complex sine is returned.

template<class T >
RWMathArray< T > sinh ( const RWMathArray< T > &  V)
related

The function sinh() takes x as an argument and returns y such that \(y_{i} = sinh(x_{i})\). For complex classes, the complex hyperbolic sine is returned.

template<class T >
RWMathArray< T > sqrt ( const RWMathArray< T > &  V)
related

The square root function. Takes x as an argument and returns y such that \(y_{i} = (x_{i})^{1/2}\). For complex classes, the principal value of the complex square root is returned.

template<class T >
RWMathArray< T > tan ( const RWMathArray< T > &  x)
related

The function tan() takes argument x> and returns y such that \(y_{i} = tan(x_{i})\).

template<class T >
RWMathArray< T > tanh ( const RWMathArray< T > &  x)
related

The function tanh() takes argument x and returns y such that \(y_{i} = tanh(x_{i})\).

template<class T>
RWMathArray< signed char > toChar ( const RWMathArray< int > &  v)
related

Converts an RWMathArray<int> instance into a corresponding RWMathArray<signed char> instance. Note that this is a narrowing operation; high order bits are removed.

See also
RWConvertMathArray
template<class T>
RWMathArray< float > toFloat ( const RWMathArray< double > &  v)
related

Converts an RWMathArray<double> instance into a corresponding RWMathArray<float> instance. Note that this is a narrowing operation; high order bits are removed.

See also
RWConvertMathArray
template<class T >
RWGenMat< T > toGenMat ( const RWMathArray< T > &  )
related

Converts a 2-dimensional array into a corresponding general matrix class. The array must actually have 2 dimensions or a runtime error occurs. The newly constructed matrix is a new view of the same data as the array; a copy of the data is not made.

template<class T>
RWMathArray< int > toInt ( const RWMathArray< double > &  v)
related

Converts an RWMathArray<double> instance into a corresponding RWMathArray<int> instance. Note that truncation occurs.

See also
RWConvertMathArray
template<class T>
RWMathArray< int > toInt ( const RWMathArray< float > &  v)
related

Converts an RWMathArray<float> instance into a corresponding RWMathArray<int> instance. Note that truncation occurs.

See also
RWConvertMathArray
template<class T >
T toScalar ( const RWMathArray< T > &  )
related

Converts a 0-dimensional array into a scalar. The array must actually have 0 dimensions or a runtime error occurs.

template<class T >
RWMathVec< T > toVec ( const RWMathArray< T > &  )
related

Converts a 1-dimensional array into a corresponding RWMathVec. The array must actually have 1 dimension or a runtime error occurs. The newly constructed vector is a new view of the same data as the array; a copy of the data is not made.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.