UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
ZdF3DMatrix< T > Class Template Reference

#include <zd_f3d_matrix.hpp>

Inheritance diagram for ZdF3DMatrix< T >:
ZdFunction3D ZdFunction3D ZdDocument ZdDocument ZdDocument ZdDocument ZqbAutoName ZqbAutoName ZqbAutoName ZqbAutoName ZqbAutoName ZqbAutoName ZqbAutoName ZqbAutoName

Public Member Functions

 ZdF3DMatrix (int nX, int nY, double pfXYInfo[4]=NULL, ZdF3DMatrixPolicy ePolicy=Z_F3DM_ALA_C)
 
 ZdF3DMatrix (const T *pArray, int nX, int nY, double pfXYInfo[4]=NULL, bool bDetached=true, ZdF3DMatrixPolicy ePolicy=Z_F3DM_ALA_C)
 
virtual ~ZdF3DMatrix ()
 
virtual void setFunc (int iX, int iY, T value)
 
virtual int countX ()
 
virtual int countY ()
 
virtual double argX (int iX)
 
virtual double argY (int iY)
 
virtual double func (int iX, int iY)
 
virtual bool isNullAll ()
 
virtual bool isNullFunc (int iX, int iY)
 
virtual double argStepX ()
 
virtual double argStepY ()
 
virtual void getArgBoundsX (double b[2])
 
virtual void getArgBoundsY (double b[2])
 
virtual void getFuncBounds (double b[2])
 
virtual int argIndexX (double x)
 
virtual int argIndexY (double y)
 
 ZdF3DMatrix (int nX, int nY, double pfXYInfo[4]=NULL, ZdF3DMatrixPolicy ePolicy=Z_F3DM_ALA_C)
 
 ZdF3DMatrix (const T *pArray, int nX, int nY, double pfXYInfo[4]=NULL, bool bDetached=true, ZdF3DMatrixPolicy ePolicy=Z_F3DM_ALA_C)
 
virtual ~ZdF3DMatrix ()
 
virtual void setFunc (int iX, int iY, T value)
 
virtual int countX ()
 
virtual int countY ()
 
virtual double argX (int iX)
 
virtual double argY (int iY)
 
virtual double func (int iX, int iY)
 
virtual bool isNullAll ()
 
virtual bool isNullFunc (int iX, int iY)
 
virtual double argStepX ()
 
virtual double argStepY ()
 
virtual void getArgBoundsX (double b[2])
 
virtual void getArgBoundsY (double b[2])
 
virtual void getFuncBounds (double b[2])
 
virtual int argIndexX (double x)
 
virtual int argIndexY (double y)
 
- Public Member Functions inherited from ZdFunction3D
 ZdFunction3D (const char *szFuncName=NULL)
 
virtual ~ZdFunction3D ()
 
virtual bool compatibleType (const char *szType) const
 
virtual void argX (std::vector< double > &vX)
 
virtual void argY (std::vector< double > &vY)
 
virtual double minArgX ()
 
virtual double maxArgX ()
 
virtual double minArgY ()
 
virtual double maxArgY ()
 
double minFunc ()
 
virtual double maxFunc ()
 
 ZdFunction3D (const char *szFuncName=NULL)
 
virtual ~ZdFunction3D ()
 
virtual bool compatibleType (const char *szType) const
 
virtual void argX (std::vector< double > &vX)
 
virtual void argY (std::vector< double > &vY)
 
virtual double minArgX ()
 
virtual double maxArgX ()
 
virtual double minArgY ()
 
virtual double maxArgY ()
 
double minFunc ()
 
virtual double maxFunc ()
 
- Public Member Functions inherited from ZdDocument
 ZdDocument (const char *szName=NULL)
 
virtual ~ZdDocument ()
 
virtual void updateViews ()
 
virtual bool isChanged ()
 
virtual void setChanges ()
 
virtual void resetChanges ()
 
 ZdDocument (const char *szName=NULL)
 
virtual ~ZdDocument ()
 
virtual void updateViews ()
 
virtual bool isChanged ()
 
virtual void setChanges ()
 
virtual void resetChanges ()
 
- Public Member Functions inherited from ZqbAutoName
 ZqbAutoName (int *pCounter, const char *szRoot, const char *szCustomName=NULL)
 
virtual ~ZqbAutoName ()
 
 ZqbAutoName (int *pCounter, const char *szRoot, const char *szCustomName=NULL)
 
virtual ~ZqbAutoName ()
 
- Public Member Functions inherited from ZqbName
 ZqbName (const char *szRoot, const char *szCustomName=NULL)
 
 ZqbName (const ZqbName &name)
 
virtual ~ZqbName ()
 
ZqbNameoperator= (const ZqbName &name)
 
virtual const char * getName () const
 
virtual const char * getType () const
 
bool hasName (const char *szString) const
 
 ZqbName (const char *szRoot, const char *szCustomName=NULL)
 
 ZqbName (const ZqbName &name)
 
virtual ~ZqbName ()
 
ZqbNameoperator= (const ZqbName &name)
 
virtual const char * getName () const
 
virtual const char * getType () const
 
bool hasName (const char *szString) const
 

Additional Inherited Members

- Protected Attributes inherited from ZdDocument
ZqbViewVector m_Views
 
- Protected Attributes inherited from ZqbName
char * m_szName
 
char * m_szRoot
 

Detailed Description

template<class T>
class ZdF3DMatrix< T >

Storage class template which implements 3D function as a matrix of arbitrary number-like items which can be casted to double numbers. Step is uniform along both X and Y dimensions.

The template parameter T should have casting to double. Any built-in numeric types match this requirement. For custom class operator double() should be implemented.

Constructor & Destructor Documentation

template<class T >
ZdF3DMatrix< T >::ZdF3DMatrix ( int  nX,
int  nY,
double  pfXYInfo[4] = NULL,
ZdF3DMatrixPolicy  ePolicy = Z_F3DM_ALA_C 
)
inline

Create 3D function interface to the matrix nX*nY of Z values where steps for X and Y are constant. Initial and step values for X and Y are passed via special array of four items:

  • pfXYinfo[0] - X[0]
  • pfXYinfo[1] - Y[0]
  • pfXYinfo[2] - X[iX+1]-X[iX]
  • pfXYinfo[3] - Y[iY+1]-Y[iY]

If pfXYInfo is NULL then {0.0, 0.0, 1.0, 1.0} vector is used instead. The matrix is detached and it's contents is zero filled.

template<class T >
ZdF3DMatrix< T >::ZdF3DMatrix ( const T *  pArray,
int  nX,
int  nY,
double  pfXYInfo[4] = NULL,
bool  bDetached = true,
ZdF3DMatrixPolicy  ePolicy = Z_F3DM_ALA_C 
)
inline

Create 3D function interface to the matrix nX*nY of Z values where steps for X and Y are constant. Initial and step values for X and Y are passed via special array of four items:

  • pfXYinfo[0] - X[0]
  • pfXYinfo[1] - Y[0]
  • pfXYinfo[2] - X[iX+1]-X[iX]
  • pfXYinfo[3] - Y[iY+1]-Y[iY]

If pfXYInfo is NULL then {0.0, 0.0, 1.0, 1.0} vector is used instead.

Depending the value of bDetached flag initial array is copied inside the object (bDetached=true) or just used during the whole lifetime of the ZdF3DMatrix object (bDetached=false). Matrix storage policy defines order of visiting X and Y coordinates in sequence of pArray items.

template<class T >
virtual ZdF3DMatrix< T >::~ZdF3DMatrix ( )
inlinevirtual

Destroy the object and release detached memory buffer.

template<class T >
ZdF3DMatrix< T >::ZdF3DMatrix ( int  nX,
int  nY,
double  pfXYInfo[4] = NULL,
ZdF3DMatrixPolicy  ePolicy = Z_F3DM_ALA_C 
)
inline

Create 3D function interface to the matrix nX*nY of Z values where steps for X and Y are constant. Initial and step values for X and Y are passed via special array of four items:

  • pfXYinfo[0] - X[0]
  • pfXYinfo[1] - Y[0]
  • pfXYinfo[2] - X[iX+1]-X[iX]
  • pfXYinfo[3] - Y[iY+1]-Y[iY]

If pfXYInfo is NULL then {0.0, 0.0, 1.0, 1.0} vector is used instead. The matrix is detached and it's contents is zero filled.

template<class T >
ZdF3DMatrix< T >::ZdF3DMatrix ( const T *  pArray,
int  nX,
int  nY,
double  pfXYInfo[4] = NULL,
bool  bDetached = true,
ZdF3DMatrixPolicy  ePolicy = Z_F3DM_ALA_C 
)
inline

Create 3D function interface to the matrix nX*nY of Z values where steps for X and Y are constant. Initial and step values for X and Y are passed via special array of four items:

  • pfXYinfo[0] - X[0]
  • pfXYinfo[1] - Y[0]
  • pfXYinfo[2] - X[iX+1]-X[iX]
  • pfXYinfo[3] - Y[iY+1]-Y[iY]

If pfXYInfo is NULL then {0.0, 0.0, 1.0, 1.0} vector is used instead.

Depending the value of bDetached flag initial array is copied inside the object (bDetached=true) or just used during the whole lifetime of the ZdF3DMatrix object (bDetached=false). Matrix storage policy defines order of visiting X and Y coordinates in sequence of pArray items.

template<class T >
virtual ZdF3DMatrix< T >::~ZdF3DMatrix ( )
inlinevirtual

Destroy the object and release detached memory buffer.

Member Function Documentation

template<class T >
virtual int ZdF3DMatrix< T >::argIndexX ( double  x)
inlinevirtual

Return index of X argument the most close to given value. Complexity of default implementation is O(N) where N is number of points.

Reimplemented from ZdFunction3D.

template<class T >
virtual int ZdF3DMatrix< T >::argIndexX ( double  x)
inlinevirtual

Return index of X argument the most close to given value. Complexity of default implementation is O(N) where N is number of points.

Reimplemented from ZdFunction3D.

template<class T >
virtual int ZdF3DMatrix< T >::argIndexY ( double  y)
inlinevirtual

Return index of Y argument the most close to given value. Complexity of default implementation is O(N) where N is number of points.

Reimplemented from ZdFunction3D.

template<class T >
virtual int ZdF3DMatrix< T >::argIndexY ( double  y)
inlinevirtual

Return index of Y argument the most close to given value. Complexity of default implementation is O(N) where N is number of points.

Reimplemented from ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::argStepX ( )
inlinevirtual

Return step of X argument in case argument has uniform step and 0 otherwise. Default implementation returns 0.

Reimplemented from ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::argStepX ( )
inlinevirtual

Return step of X argument in case argument has uniform step and 0 otherwise. Default implementation returns 0.

Reimplemented from ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::argStepY ( )
inlinevirtual

Return step of Y argument in case argument has uniform step and 0 otherwise. Default implementation returns 0.

Reimplemented from ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::argStepY ( )
inlinevirtual

Return step of Y argument in case argument has uniform step and 0 otherwise. Default implementation returns 0.

Reimplemented from ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::argX ( int  iX)
inlinevirtual

Get value of X argument in given point.

Implements ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::argX ( int  iX)
inlinevirtual

Get value of X argument in given point.

Implements ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::argY ( int  iY)
inlinevirtual

Get value of Y argument in given point.

Implements ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::argY ( int  iY)
inlinevirtual

Get value of Y argument in given point.

Implements ZdFunction3D.

template<class T >
virtual int ZdF3DMatrix< T >::countX ( )
inlinevirtual

Get number of X points in function definition.

Implements ZdFunction3D.

template<class T >
virtual int ZdF3DMatrix< T >::countX ( )
inlinevirtual

Get number of X points in function definition.

Implements ZdFunction3D.

template<class T >
virtual int ZdF3DMatrix< T >::countY ( )
inlinevirtual

Get number of Y points in function definition.

Implements ZdFunction3D.

template<class T >
virtual int ZdF3DMatrix< T >::countY ( )
inlinevirtual

Get number of Y points in function definition.

Implements ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::func ( int  iX,
int  iY 
)
inlinevirtual

Get value of function in given point - z=f(x,y). Returned value is undefined if function is not defined for this argument.

Implements ZdFunction3D.

template<class T >
virtual double ZdF3DMatrix< T >::func ( int  iX,
int  iY 
)
inlinevirtual

Get value of function in given point - z=f(x,y). Returned value is undefined if function is not defined for this argument.

Implements ZdFunction3D.

template<class T >
virtual void ZdF3DMatrix< T >::getArgBoundsX ( double  b[2])
inlinevirtual

Return minimum and maximum values for X argument. Default implementation calculates minimum and maximum values in cycle. If number of points is zero then {0,0} is returned.

Reimplemented from ZdFunction3D.

template<class T >
virtual void ZdF3DMatrix< T >::getArgBoundsX ( double  b[2])
inlinevirtual

Return minimum and maximum values for X argument. Default implementation calculates minimum and maximum values in cycle. If number of points is zero then {0,0} is returned.

Reimplemented from ZdFunction3D.

template<class T >
virtual void ZdF3DMatrix< T >::getArgBoundsY ( double  b[2])
inlinevirtual

Return minimum and maximum values for Y argument. Default implementation calculates minimum and maximum values in cycle. If number of points is zero then {0,0} is returned.

Reimplemented from ZdFunction3D.

template<class T >
virtual void ZdF3DMatrix< T >::getArgBoundsY ( double  b[2])
inlinevirtual

Return minimum and maximum values for Y argument. Default implementation calculates minimum and maximum values in cycle. If number of points is zero then {0,0} is returned.

Reimplemented from ZdFunction3D.

template<class T >
virtual void ZdF3DMatrix< T >::getFuncBounds ( double  b[2])
inlinevirtual

Return minimum and maximum values for function. Default implementation calculates minimum and maximum values in cycle. If number of points is zero or there is no points with defined value then {0,0} is returned.

Reimplemented from ZdFunction3D.

template<class T >
virtual void ZdF3DMatrix< T >::getFuncBounds ( double  b[2])
inlinevirtual

Return minimum and maximum values for function. Default implementation calculates minimum and maximum values in cycle. If number of points is zero or there is no points with defined value then {0,0} is returned.

Reimplemented from ZdFunction3D.

template<class T >
virtual bool ZdF3DMatrix< T >::isNullAll ( )
inlinevirtual

Return true if all function values are empty and false otherwise. Very slow implementation because it scans the whole matrix countX()*countY().

Reimplemented from ZdFunction3D.

template<class T >
virtual bool ZdF3DMatrix< T >::isNullAll ( )
inlinevirtual

Return true if all function values are empty and false otherwise. Very slow implementation because it scans the whole matrix countX()*countY().

Reimplemented from ZdFunction3D.

template<class T >
virtual bool ZdF3DMatrix< T >::isNullFunc ( int  iX,
int  iY 
)
inlinevirtual

Return false if function's value is defined and true otherwise. Returns false in default implementation.

Reimplemented from ZdFunction3D.

template<class T >
virtual bool ZdF3DMatrix< T >::isNullFunc ( int  iX,
int  iY 
)
inlinevirtual

Return false if function's value is defined and true otherwise. Returns false in default implementation.

Reimplemented from ZdFunction3D.

template<class T >
virtual void ZdF3DMatrix< T >::setFunc ( int  iX,
int  iY,
value 
)
inlinevirtual

Change function value in the cell with given indeces.

template<class T >
virtual void ZdF3DMatrix< T >::setFunc ( int  iX,
int  iY,
value 
)
inlinevirtual

Change function value in the cell with given indeces.

Member Data Documentation

template<class T >
double ZdF3DMatrix< T >::fOffset

Offset of the first items in the dimension.

template<class T >
double ZdF3DMatrix< T >::fStep

Step between items in the dimension.

template<class T >
int ZdF3DMatrix< T >::nCount

Number of items along the dimension.


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