cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Friends | List of all members
vctDynamicNArray< _elementType, _dimension > Class Template Reference

An nArray object of dynamic size. More...

#include <vctDynamicNArray.h>

Inheritance diagram for vctDynamicNArray< _elementType, _dimension >:
vctDynamicNArrayBase< vctDynamicNArrayOwner< _elementType, _dimension >, _elementType, _dimension > vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension > vctReturnDynamicNArray< _elementType, _dimension >

Public Types

typedef vctDynamicNArrayBase
< vctDynamicNArrayOwner
< _elementType, _dimension >
, _elementType, _dimension > 
BaseType
 
typedef vctDynamicNArray
< _elementType, _dimension > 
ThisType
 
- Public Types inherited from vctDynamicNArrayBase< vctDynamicNArrayOwner< _elementType, _dimension >, _elementType, _dimension >
enum  
 
typedef vctDynamicNArrayBase ThisType
 
typedef
vctDynamicConstNArrayBase
< vctDynamicNArrayOwner
< _elementType, _dimension >
, _elementType, _dimension > 
BaseType
 
typedef vctDynamicNArrayOwner
< _elementType, _dimension > 
OwnerType
 
typedef OwnerType::iterator iterator
 
typedef OwnerType::const_iterator const_iterator
 
typedef OwnerType::reverse_iterator reverse_iterator
 
typedef
OwnerType::const_reverse_iterator 
const_reverse_iterator
 
typedef
BaseType::ConstSubarrayRefType 
ConstSubarrayRefType
 
typedef BaseType::SubarrayRefType SubarrayRefType
 
typedef
BaseType::ConstPermutationRefType 
ConstPermutationRefType
 
typedef
BaseType::PermutationRefType 
PermutationRefType
 
typedef BaseType::SlicesTypes SlicesTypes
 
typedef BaseType::ConstSliceRefType ConstSliceRefType
 
typedef BaseType::SliceRefType SliceRefType
 
- Public Types inherited from vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >
enum  { DIMENSION = OwnerType::DIMENSION }
 
typedef
vctDynamicConstNArrayBase
< _nArrayOwnerType,
_elementType, _dimension > 
ThisType
 
typedef _nArrayOwnerType OwnerType
 
typedef vctReturnDynamicNArray
< value_type, DIMENSION
NArrayValueType
 
typedef vctDynamicNArray
< value_type, DIMENSION
NArrayReturnType
 
typedef cmnTypeTraits< value_type > TypeTraits
 
typedef TypeTraits::BoolType BoolType
 
typedef vctReturnDynamicNArray
< BoolType, DIMENSION
BoolNArrayReturnType
 
typedef OwnerType::iterator iterator
 
typedef OwnerType::const_iterator const_iterator
 
typedef OwnerType::reverse_iterator reverse_iterator
 
typedef
OwnerType::const_reverse_iterator 
const_reverse_iterator
 
typedef
vctDynamicConstNArrayRef
< value_type, DIMENSION
ConstSubarrayRefType
 
typedef vctDynamicNArrayRef
< value_type, DIMENSION
SubarrayRefType
 
typedef
vctDynamicConstNArrayRef
< value_type, DIMENSION
ConstPermutationRefType
 
typedef vctDynamicNArrayRef
< value_type, DIMENSION
PermutationRefType
 
typedef vctDynamicNArrayTypes
< DIMENSION >::template
SlicesTypes< _elementType > 
SlicesTypes
 
typedef
SlicesTypes::ConstSliceRefType 
ConstSliceRefType
 
typedef SlicesTypes::SliceRefType SliceRefType
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
 VCT_NARRAY_TRAITS_TYPEDEFS (_dimension)
 
 vctDynamicNArray ()
 
 vctDynamicNArray (const nsize_type &sizes)
 
 vctDynamicNArray (const nsize_type &sizes, value_type value)
 
 vctDynamicNArray (const vctReturnDynamicNArray< value_type, _dimension > &otherNArray)
 
template<class _otherNArrayOwnerType , typename _otherNArrayElementType >
 vctDynamicNArray (const vctDynamicConstNArrayBase< _otherNArrayOwnerType, _otherNArrayElementType, _dimension > &otherNArray)
 
template<class __nArrayOwnerType , typename __elementType >
ThisTypeoperator= (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, _dimension > &otherNArray)
 
ThisTypeoperator= (const ThisType &otherNArray)
 
ThisTypeoperator= (const vctReturnDynamicNArray< value_type, _dimension > &otherNArray)
 
ThisTypeoperator= (const value_type &value)
 
template<class __nArrayOwnerType , typename __elementType >
ThisTypeForceAssign (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, _dimension > &other)
 
template<class _elementType , vct::size_type _dimension>
 vctDynamicNArray (const vctReturnDynamicNArray< _elementType, _dimension > &other)
 
template<class _elementType , vct::size_type _dimension>
vctDynamicNArray< _elementType,
_dimension > & 
operator= (const vctReturnDynamicNArray< _elementType, _dimension > &other)
 
 vctDynamicNArray (const ThisType &otherNArray)
 
template<class _otherNArrayOwnerType >
 vctDynamicNArray (const vctDynamicConstNArrayBase< _otherNArrayOwnerType, value_type, _dimension > &otherNArray)
 
void SetSize (const nsize_type &sizes)
 
- Public Member Functions inherited from vctDynamicNArrayBase< vctDynamicNArrayOwner< _elementType, _dimension >, _elementType, _dimension >
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
 VCT_NARRAY_TRAITS_TYPEDEFS (_dimension)
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
reverse_iterator rbegin (void)
 
const_reverse_iterator rbegin (void) const
 
reverse_iterator rend (void)
 
const_reverse_iterator rend (void) const
 
const OwnerTypeOwner (void) const
 
OwnerTypeOwner (void)
 
pointer Pointer (const nsize_type &indices)
 
const_pointer Pointer (const nsize_type &indices) const
 
pointer Pointer (void)
 
const_pointer Pointer (void) const
 
reference at (size_type metaIndex) throw (std::out_of_range)
 
const_reference at (size_type metaIndex) const throw (std::out_of_range)
 
reference at (const nsize_type &coordinates) throw (std::out_of_range)
 
const_reference at (const nsize_type &coordinates) const throw (std::out_of_range)
 
reference operator() (const nsize_type &coordinates) throw (std::out_of_range)
 
const_reference operator() (const nsize_type &coordinates) const throw (std::out_of_range)
 
reference Element (const nsize_type &coordinates)
 
const_reference Element (const nsize_type &coordinates) const
 
SubarrayRefType Subarray (const nsize_type &startPosition, const nsize_type &lengths)
 
ConstSubarrayRefType Subarray (const nsize_type &startPosition, const nsize_type &lengths) const
 
PermutationRefType Permutation (const ndimension_type &dimensions)
 
ConstPermutationRefType Permutation (const ndimension_type &dimensions) const
 
SliceRefType Slice (dimension_type dimension, size_type index) throw (std::runtime_error, std::out_of_range)
 
ConstSliceRefType Slice (dimension_type dimension, size_type index) const throw (std::runtime_error, std::out_of_range)
 
SliceRefType operator[] (size_type index)
 
ConstSliceRefType operator[] (size_type index) const
 
value_type SetAll (const value_type value)
 
bool Zeros (void)
 
ThisTypeAssign (const value_type *elements)
 
ThisTypeForceAssign (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
 
ThisTypeAddProductOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeAddElementwiseProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
 
ThisTypeAssign (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &other)
 
ThisTypeAssign (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
 
ThisTypeoperator= (const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, DIMENSION > &other)
 
bool FastCopyOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source, bool performSafetyChecks=true) throw (std::runtime_error)
 
ThisTypeSumOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
 
ThisTypeDifferenceOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
 
ThisTypeElementwiseProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
 
ThisTypeElementwiseRatioOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
 
ThisTypeElementwiseMinOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
 
ThisTypeElementwiseMaxOf (const vctDynamicConstNArrayBase< __nArrayOwnerType1, value_type, DIMENSION > &nArray1, const vctDynamicConstNArrayBase< __nArrayOwnerType2, value_type, DIMENSION > &nArray2)
 
ThisTypeAdd (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeSubtract (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeElementwiseMultiply (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeElementwiseDivide (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeElementwiseMin (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeElementwiseMax (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeoperator+= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeoperator-= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeSumOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
 
ThisTypeDifferenceOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
 
ThisTypeProductOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
 
ThisTypeRatioOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type scalar)
 
ThisTypeClippedAboveOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type lowerBound)
 
ThisTypeClippedBelowOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray, const value_type upperBound)
 
ThisTypeSumOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
 
ThisTypeDifferenceOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
 
ThisTypeProductOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
 
ThisTypeRatioOf (const value_type scalar, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
 
ThisTypeClippedAboveOf (const value_type upperBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
 
ThisTypeClippedBelowOf (const value_type lowerBound, const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &nArray)
 
ThisTypeAdd (const value_type scalar)
 
ThisTypeSubtract (const value_type scalar)
 
ThisTypeoperator+= (const value_type scalar)
 
ThisTypeoperator-= (const value_type scalar)
 
ThisTypeMultiply (const value_type scalar)
 
ThisTypeDivide (const value_type scalar)
 
ThisTypeClipAbove (const value_type upperBound)
 
ThisTypeClipBelow (const value_type lowerBound)
 
ThisTypeoperator*= (const value_type scalar)
 
ThisTypeoperator/= (const value_type scalar)
 
ThisTypeAbsOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeNegationOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeFloorOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeCeilOf (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray)
 
ThisTypeAbsSelf (void)
 
ThisTypeNegationSelf (void)
 
ThisTypeFloorSelf (void)
 
ThisTypeCeilSelf (void)
 
- Public Member Functions inherited from vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
 VCT_NARRAY_TRAITS_TYPEDEFS (_dimension)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
const_reverse_iterator rbegin (void) const
 
const_reverse_iterator rend (void) const
 
size_type size (void) const
 
const nsize_type & sizes (void) const
 
size_type size (dimension_type dimension) const
 
const nstride_type & strides (void) const
 
difference_type stride (dimension_type dimension) const
 
dimension_type dimension (void) const
 
bool empty (void) const
 
bool ValidDimension (dimension_type dimension) const
 
bool ValidDimensionIndex (dimension_type dimensionIndex) const
 
bool ValidIndex (size_type index) const
 
bool ValidIndex (const nsize_type &indices) const
 
bool ValidIndex (dimension_type dimension, size_type index) const
 
const_reference at (size_type metaIndex) const throw (std::out_of_range)
 
const_reference at (const nsize_type &coordinates) const throw (std::out_of_range)
 
const_reference operator() (const nsize_type &coordinates) const throw (std::out_of_range)
 
const OwnerTypeOwner (void) const
 
const_pointer Pointer (void) const
 
const_pointer Pointer (const nsize_type &indices) const
 
const_reference Element (const nsize_type &coordinates) const
 
ConstSubarrayRefType Subarray (const nsize_type &startPosition, const nsize_type &lengths) const
 
ConstPermutationRefType Permutation (const ndimension_type &dimensions) const
 
ConstSliceRefType Slice (dimension_type dimension, size_type index) const throw (std::runtime_error, std::out_of_range)
 
ConstSliceRefType operator[] (size_type index) const
 
template<class __nArrayOwnerType >
bool FastCopyCompatible (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &source) const
 
std::string ToString (void)
 
void ToStream (std::ostream &outputStream) const
 
value_type SumOfElements (void) const
 
value_type ProductOfElements (void) const
 
value_type NormSquare (void) const
 
NormType Norm (void) const
 
value_type L1Norm (void) const
 
value_type LinfNorm (void) const
 
value_type MaxElement (void) const
 
value_type MinElement (void) const
 
value_type MaxAbsElement (void) const
 
value_type MinAbsElement (void) const
 
void MinAndMaxElement (value_type &minElement, value_type &maxElement) const
 
bool IsPositive (void) const
 
bool IsNonNegative (void) const
 
bool IsNonPositive (void) const
 
bool IsNegative (void) const
 
bool All (void) const
 
bool Any (void) const
 
bool IsFinite (void) const
 
bool HasNaN (void) const
 
bool IsCompact (void) const
 
template<class __nArrayOwnerType >
bool Equal (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
bool operator== (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
bool AlmostEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray, value_type tolerance) const
 
template<class __nArrayOwnerType >
bool AlmostEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
bool NotEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
bool operator!= (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
bool Lesser (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
bool LesserOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
bool Greater (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
bool GreaterOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
BoolNArrayReturnType ElementwiseEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
BoolNArrayReturnType ElementwiseNotEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
BoolNArrayReturnType ElementwiseLesser (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
BoolNArrayReturnType ElementwiseLesserOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
BoolNArrayReturnType ElementwiseGreater (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
template<class __nArrayOwnerType >
BoolNArrayReturnType ElementwiseGreaterOrEqual (const vctDynamicConstNArrayBase< __nArrayOwnerType, value_type, DIMENSION > &otherNArray) const
 
bool Equal (const value_type &scalar) const
 
bool operator== (const value_type &scalar) const
 
bool NotEqual (const value_type &scalar) const
 
bool operator!= (const value_type &scalar) const
 
bool Lesser (const value_type &scalar) const
 
bool LesserOrEqual (const value_type &scalar) const
 
bool Greater (const value_type &scalar) const
 
bool GreaterOrEqual (const value_type &scalar) const
 
BoolNArrayReturnType ElementwiseEqual (const value_type &scalar) const
 
BoolNArrayReturnType ElementwiseNotEqual (const value_type &scalar) const
 
BoolNArrayReturnType ElementwiseLesser (const value_type &scalar) const
 
BoolNArrayReturnType ElementwiseLesserOrEqual (const value_type &scalar) const
 
BoolNArrayReturnType ElementwiseGreater (const value_type &scalar) const
 
BoolNArrayReturnType ElementwiseGreaterOrEqual (const value_type &scalar) const
 
NArrayReturnType Abs (void) const
 
NArrayReturnType Negation (void) const
 
NArrayReturnType Floor (void) const
 
NArrayReturnType Ceil (void) const
 

Friends

class vctReturnDynamicNArray< _elementType, _dimension >
 

Additional Inherited Members

- Protected Member Functions inherited from vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >
void ThrowUnlessValidDimensionIndex (dimension_type dimensionIndex) const throw (std::out_of_range)
 
void ThrowUnlessValidIndex (size_type index) const throw (std::out_of_range)
 
void ThrowUnlessValidIndex (const nsize_type &indices) const throw (std::out_of_range)
 
void ThrowUnlessValidIndex (dimension_type dimension, size_type index) const throw (std::out_of_range)
 
- Protected Attributes inherited from vctDynamicConstNArrayBase< _nArrayOwnerType, _elementType, _dimension >
OwnerType NArray
 

Detailed Description

template<class _elementType, vct::size_type _dimension>
class vctDynamicNArray< _elementType, _dimension >

An nArray object of dynamic size.

This class defines a nArray object of dynamic size with memory allocation.

The algebraic operations are mostly inherited from the base classes vctDynamicNArrayBase and vctDynamicConstNArrayBase. Here, we will briefly describe the specific properties of vctDynamicNArray, with a few usage examples.

  1. The class is templated by its element type, that is, the nArray element. Normally, the element should be an arithmetic type, that is, support all the standard arithmetic operations: +, -, *, /, =, ==, <, >, <=, >=, ...
  2. The class is templated by dimension, i.e. for a vector-like nArray the dimension would be 1, 2 for a matrix-like nArray, 3 for a volume, ...
  3. The types nsize_type, nindex_type and nstride_type are defined within the scope of the nArray classes and used in their interfaces to set the sizes, access elements or manipulate the layout.
  4. The class uses dynamically allocated memory, and, more importantly, owns the memory. That is, a vctDynamicNArray object automatically frees the allocated memory it owns when it is destroyed.
  5. To allocate the memory, use one of the following operations.
    // define a typical element type and a couple of useful other types
    typedef double ElementType;
    enum {DIMENSION = 3};
    typedef typename ArrayType::nsize_type SizeType;
    // constructor allocation, empty array
    ArrayType a1;
    // Create an empty nArray and later allocate memory.
    ArrayType a2;
    a2.SetSize(SizeType(5, 7, 8));
    vctRandom(a2, ElementType(0), ElementType(10));
    // Create an nArray of some size and change it later.
    // This operation does not preserve any elements in the resized
    // nArray
    ArrayType a3(SizeType(7, 8, 9));
    a3.SetSize(a2.sizes());
    vctRandom(a3, ElementType(-10), ElementType(0));
    // Store an algebraic result to a new nArray. In this case,
    // memory is allocated by the algebraic operation, and then
    // attached to the nArray object.
    ArrayType a4 = a3 - a2;
  6. NArray assignment can be facilitated through the Assign method (defined in the base class) or as follows.
    // Initialize all elements to the same value
    ArrayType a5(a3.sizes(), 2.0);
    // Assign one matrix to another.
    nArrayInt.Assign(a5); // preferred syntax
    nArrayInt = a5; // same operation

A few more notes.

Parameters
_elementTypethe type of an element in the nArray.
_dimensionthe dimension the multi-dimensional array.
See Also
vctDynamicNArrayBase vctDynamicConstNArrayBase

Member Typedef Documentation

template<class _elementType, vct::size_type _dimension>
typedef vctDynamicNArrayBase<vctDynamicNArrayOwner<_elementType, _dimension>, _elementType, _dimension> vctDynamicNArray< _elementType, _dimension >::BaseType
template<class _elementType, vct::size_type _dimension>
typedef vctDynamicNArray<_elementType, _dimension> vctDynamicNArray< _elementType, _dimension >::ThisType

Constructor & Destructor Documentation

template<class _elementType, vct::size_type _dimension>
vctDynamicNArray< _elementType, _dimension >::vctDynamicNArray ( )
inline

Default constructor. Initialize an empty nArray.

template<class _elementType, vct::size_type _dimension>
vctDynamicNArray< _elementType, _dimension >::vctDynamicNArray ( const nsize_type &  sizes)
inline

Constructor: Create an nArray of the specified sizes. Elements initialized with default constructor.

template<class _elementType, vct::size_type _dimension>
vctDynamicNArray< _elementType, _dimension >::vctDynamicNArray ( const nsize_type &  sizes,
value_type  value 
)
inline

Constructor: Create an nArray of the specified size and assign all elements a specific value.

template<class _elementType, vct::size_type _dimension>
vctDynamicNArray< _elementType, _dimension >::vctDynamicNArray ( const vctReturnDynamicNArray< value_type, _dimension > &  otherNArray)

Special copy constructor: Take ownership of the data of a temporary nArray object of type vctReturnDynamicNArray. Disown the other nArray.

template<class _elementType, vct::size_type _dimension>
vctDynamicNArray< _elementType, _dimension >::vctDynamicNArray ( const ThisType otherNArray)
inline

Copy constructor: Allocate memory to store a copy of the other nArray, and copy the elements of the other nArray to this nArray.

template<class _elementType, vct::size_type _dimension>
template<class _otherNArrayOwnerType >
vctDynamicNArray< _elementType, _dimension >::vctDynamicNArray ( const vctDynamicConstNArrayBase< _otherNArrayOwnerType, value_type, _dimension > &  otherNArray)
inline
template<class _elementType, vct::size_type _dimension>
template<class _otherNArrayOwnerType , typename _otherNArrayElementType >
vctDynamicNArray< _elementType, _dimension >::vctDynamicNArray ( const vctDynamicConstNArrayBase< _otherNArrayOwnerType, _otherNArrayElementType, _dimension > &  otherNArray)
inlineexplicit

Copy constructor: Allocate memory and copy all the elements from the other nArray. This constructor can also be used for type conversions.

template<class _elementType, vct::size_type _dimension>
template<class _elementType , vct::size_type _dimension>
vctDynamicNArray< _elementType, _dimension >::vctDynamicNArray ( const vctReturnDynamicNArray< _elementType, _dimension > &  other)

Member Function Documentation

template<class _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType , typename __elementType >
ThisType& vctDynamicNArray< _elementType, _dimension >::ForceAssign ( const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, _dimension > &  other)
inline
template<class _elementType, vct::size_type _dimension>
template<class __nArrayOwnerType , typename __elementType >
ThisType& vctDynamicNArray< _elementType, _dimension >::operator= ( const vctDynamicConstNArrayBase< __nArrayOwnerType, __elementType, _dimension > &  otherNArray)
inline

Assignment from an nArray to this nArray. The operation discards the old memory allocated for this nArray and allocates new memory the size of the input nArray. Then the elements of the input nArray are copied into this nArray.

template<class _elementType, vct::size_type _dimension>
ThisType& vctDynamicNArray< _elementType, _dimension >::operator= ( const ThisType otherNArray)
inline

Equals operator: Assignment from a vctDynamicNArray to this nArray (also a vctDynamicNArray). The operation discards the old memory allocated for this nArray and allocates new memory the size of the input vctDynamicNArray. Then the elements of the input vctDynamicNArray are copied into this nArray.

template<class _elementType, vct::size_type _dimension>
ThisType& vctDynamicNArray< _elementType, _dimension >::operator= ( const vctReturnDynamicNArray< value_type, _dimension > &  otherNArray)

Assignment from a transitional vctReturnDynamicNArray to a vctDynamicNArray variable. This specialized operation does not perform any element copy. Instead it transfers ownership of the data from the other nArray to this nArray, and disowns the other nArray. The right hand side operand must be a temporary object returned, e.g., from a function or overloaded operator.

Todo:
This operator needs some revisions.
template<class _elementType, vct::size_type _dimension>
ThisType& vctDynamicNArray< _elementType, _dimension >::operator= ( const value_type &  value)
inline

Assignment of a scalar to all elements. See also SetAll.

template<class _elementType, vct::size_type _dimension>
template<class _elementType , vct::size_type _dimension>
vctDynamicNArray<_elementType, _dimension>& vctDynamicNArray< _elementType, _dimension >::operator= ( const vctReturnDynamicNArray< _elementType, _dimension > &  other)
template<class _elementType, vct::size_type _dimension>
void vctDynamicNArray< _elementType, _dimension >::SetSize ( const nsize_type &  sizes)
inline

Destructive size change. Change the size to the specified size. Discard all of the old values.

template<class _elementType, vct::size_type _dimension>
vctDynamicNArray< _elementType, _dimension >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType  )
template<class _elementType, vct::size_type _dimension>
vctDynamicNArray< _elementType, _dimension >::VCT_NARRAY_TRAITS_TYPEDEFS ( _dimension  )

Friends And Related Function Documentation

template<class _elementType, vct::size_type _dimension>
friend class vctReturnDynamicNArray< _elementType, _dimension >
friend

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