Tao Language for Scripting and Computing

Documentation for Tao C++ Types and Plugin
Home Page
Documents
Downloads
Licensing
MailLists
Forums
FAQ



SourceForge Logo

Support This Project
Tao C++ Types and Plugin: TcNumArray class Reference

TcNumArray Class Reference

Corresponding to TaoArrayBase. More...

#include <taoCpptype.h>

Inheritance diagram for TcNumArray:

TcBase TcByteArray TcComplexArray TcDoubleArray TcFloatArray TcIntArray TcShortArray List of all members.

Public Member Functions

int size () const
 Number of elements.

int dim () const
 Number of dimensions.

int dim (int i) const
 Size in i-th dimension.

int * getDims ()
 Get sizes in all dimensions.

int getFlatIndex (int *index)
void getMulDimIndex (int id, int *index)
void resize (int nnew)
 Resize to be a vector.

void resize (int *ds, int nd)
void reshape (int *ds, int nd)
 Reshape to a shape specified by dim size "ds" and dim number "nd".

short type () const
 Get object type.

virtual short rtti () const
void print (ostream *out=0, bool reserved=0)
 Print with default format.


Protected Member Functions

void updateDimAccum ()
 Update accumulative dimensions.

void setShape (int *ds, int nd)
 Set shape.

virtual void resizeVector (int nnew, int nold)
 To resize the data array in the subclasses.

virtual void printElement (int i, ostream *out)

Protected Attributes

int ndim
 Number of dimensions.

int * dims
 Size in each dimension.

int * dimAccum
 Accumulative dimensions, used for subindexing.


Detailed Description

Corresponding to TaoArrayBase.

The followings is a simple version of TaoNumArrays, supporting arbitary dimensions.


Member Function Documentation

int TcNumArray::getFlatIndex int *  index  )  [inline]
 

Get the flat index as in a vector given the subindices "index" as multi-dim array.

void TcNumArray::getMulDimIndex int  id,
int *  index
[inline]
 

Get multi-dim subindices given the flat index "id" as in a vector, and store them in "index".

void TcNumArray::resize int *  ds,
int  nd
[inline]
 

Resize to be an multi-dim array, with shape specified by dim size "ds" and dim number "nd".

virtual short TcNumArray::rtti  )  const [inline, virtual]
 

Get object Running Time Type Identification. It is different from type() only for numeric arrays.

Reimplemented from TcBase.

Reimplemented in TcByteArray, TcShortArray, TcIntArray, TcFloatArray, TcDoubleArray, and TcComplexArray.


The documentation for this class was generated from the following file:
Generated on Sun Apr 24 23:42:19 2005 for Tao C++ Types and Plugin by doxygen 1.3.6
This website is maintained by Fu Limin.
Copyright(C) 2004-2005, Fu Limin.
Email: fu [dot] limin [dot] tao [at] gmail [dot] com