delphi_cb
 All Classes Namespaces Files Functions Variables Macros
misc_grid.h File Reference

grid data types and associated operations More...

#include <iostream>
#include "../interface/environment.h"

Go to the source code of this file.

Classes

struct  SGrid< T >
 
struct  SGridValue< T >
 
struct  SExtrema< T >
 
struct  SDoubleGridValue
 

Functions

template<class T >
ostream & operator<< (ostream &, SGrid< T > &)
 
template<class T >
ostream & operator<< (ostream &, SGridValue< T > &)
 
template<class T >
ostream & operator<< (ostream &, SExtrema< T > &)
 
template<class T >
SGrid< T > operator+ (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
SGrid< T > operator+ (const SGrid< T > &, const T &)
 
template<class T >
SGrid< T > operator+ (const T &, const SGrid< T > &)
 
template<class T >
SGrid< T > operator- (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
SGrid< T > operator- (const SGrid< T > &, const T &)
 
template<class T >
SGrid< T > operator- (const T &, const SGrid< T > &)
 
template<class T >
SGrid< T > operator- (const SGrid< T > &)
 
template<class T >
SGrid< T > operator* (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
SGrid< T > operator* (const SGrid< T > &, const T &)
 
template<class T >
SGrid< T > operator* (const T &, const SGrid< T > &)
 
template<class T , class N >
SGrid< T > operator/ (const SGrid< N > &, const T &)
 
template<class T >
optDot (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
SGrid< T > optCross (const SGrid< T > &, const SGrid< T > &)
 
SGrid< delphi_real > optSQRT (const SGrid< delphi_real > &)
 
template<class T >
SGrid< T > optABS (const SGrid< T > &)
 
template<class T , class N >
SGrid< T > optCast (const SGrid< N > &)
 
SGrid< delphi_integer > optRound (const SGrid< delphi_real > &)
 
template<class T >
SGrid< T > optMin (const T &, const SGrid< T > &)
 
template<class T >
SGrid< T > optMin (const SGrid< T > &, const T &)
 
template<class T >
SGrid< T > optMin (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
optMin (const SGrid< T > &)
 
template<class T >
SGrid< T > optMax (const T &, const SGrid< T > &)
 
template<class T >
SGrid< T > optMax (const SGrid< T > &, const T &)
 
template<class T >
SGrid< T > optMax (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
optMax (const SGrid< T > &)
 
template<class T >
SGrid< T > optMinSign (const T &, const SGrid< T > &)
 
template<class T >
SGrid< T > optMinSign (const SGrid< T > &, const T &)
 
template<class T >
SGrid< T > optMaxSign (const T &, const SGrid< T > &)
 
template<class T >
SGrid< T > optMaxSign (const SGrid< T > &, const T &)
 
template<class T >
SGrid< T > optSubMin (const SGrid< T > &, const SGrid< T > &, const SGrid< T > &)
 
template<class T >
SGrid< T > optSubMax (const SGrid< T > &, const SGrid< T > &, const SGrid< T > &)
 
template<class T >
optSum (const SGrid< T > &)
 
template<class T >
optComp (const SGrid< T > &, const int &)
 
template<class T >
bool optORLT (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
bool optORLT (const SGrid< T > &, const T &)
 
template<class T >
bool optANDLT (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
bool optANDLT (const SGrid< T > &, const T &)
 
template<class T >
bool optORLE (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
bool optORLE (const SGrid< T > &, const T &)
 
template<class T >
bool optANDLE (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
bool optANDLE (const SGrid< T > &, const T &)
 
template<class T >
bool optORGT (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
bool optORGT (const SGrid< T > &, const T &)
 
template<class T >
bool optORGE (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
bool optORGE (const SGrid< T > &, const T &)
 
template<class T >
bool optANDGT (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
bool optANDGT (const SGrid< T > &, const T &)
 
template<class T >
bool optANDGE (const SGrid< T > &, const SGrid< T > &)
 
template<class T >
bool optANDGE (const SGrid< T > &, const T &)
 
template<class T >
bool operator!= (const SGrid< T > &, const T &)
 
template<class T >
bool operator!= (const SGrid< T > &, const SGrid< T > &)
 

Detailed Description

grid data types and associated operations

Author
Chuan Li, chuan.nosp@m.li@c.nosp@m.lemso.nosp@m.n.ed.nosp@m.u

Function Documentation

template<class T >
bool operator!= ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid not equal to (version I)

1 bool bRtVal = (fVec != fVal): vorne(a,b);
2 bool bRtVal = (iVec != iVal): ivorne(a,b)
template<class T >
bool operator!= ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid not equal to (version II)

1 bool bRtVal = (fVec1 != fVec2): vorne2(a,b);
2 bool bRtVal = (iVec1 != iVec2): ivorne2(a,b)
template<class T >
SGrid<T> operator* ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

Multiplies two variables of coord/int_coord derived type

1 SGrid <delphi_real> fVec = fVec1 * fVec2: vmult(a,b);
2 SGrid <delphi_integer> iVec = iVec1 * iVec2: ivmult(a,b)
template<class T >
SGrid<T> operator* ( const SGrid< T > &  nVector,
const T &  nValue 
)

Multiplies delphi_real/delphi_integer variable to coord/int_coord derived type

1 SGrid <delphi_real> fVec2 = fVec1 * fVal: vmult2(a,b);
2 SGrid <delphi_integer> iVec2 = iVec1 * iVal: ivmult2(a,b)
template<class T >
SGrid<T> operator* ( const T &  nValue,
const SGrid< T > &  nVector 
)

Multiplies coord/int_coord derived type to delphi_real/delphi_integer variable

1 SGrid <delphi_real> fVec2 = fVal * fVec1: vmult3(a,b);
2 SGrid <delphi_integer> iVec2 = iVal * iVec1: ivmult3(a,b)
template<class T >
SGrid<T> operator+ ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

Adds two variables of coord/int_coord derived type

1 SGrid <delphi_real> fVec = fVec1 + fVec2: vplus(a,b);
2 SGrid <delphi_integer> iVec = iVec1 + iVec2: ivplus(a,b)
template<class T >
SGrid<T> operator+ ( const SGrid< T > &  nVector,
const T &  nValue 
)

Adds delphi_real/delphi_integer variable to coord/int_coord derived type

1 SGrid <delphi_real> fVec2 = fVec1 + fVal: vplus2(a,b);
2 SGrid <delphi_integer> iVec2 = iVec1 + iVal: ivplus2(a,b)
template<class T >
SGrid<T> operator+ ( const T &  nValue,
const SGrid< T > &  nVector 
)

Adds coord/int_coord derived type to delphi_real/delphi_integer variable

1 SGrid <delphi_real> fVec2 = fVal + fVec1: vplus3(a,b);
2 SGrid <delphi_integer> iVec2 = iVal + iVec1: ivplus3(a,b)
template<class T >
SGrid<T> operator- ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

Substracts two variables of coord/int_coord derived type

1 SGrid <delphi_real> fVec = fVec1 - fVec2: vminus(a,b);
2 SGrid <delphi_integer> iVec = iVec1 - iVec2: ivminus(a,b)
template<class T >
SGrid<T> operator- ( const SGrid< T > &  nVector,
const T &  nValue 
)

Substracts delphi_real/delphi_integer variable from coord/int_coord derived type

1 SGrid <delphi_real> fVec2 = fVec1 - fVal: vminus2(a,b);
2 SGrid <delphi_integer> iVec2 = iVec1 - iVal: ivminus2(a,b)
template<class T >
SGrid<T> operator- ( const T &  nValue,
const SGrid< T > &  nVector 
)

Substracts coord/int_coord derived type from delphi_real/delphi_integer variable

1 SGrid <delphi_real> fVec2 = fVal - fVec1: vminus3(a,b);
2 SGrid <delphi_integer> iVec2 = iVal - iVec1: ivminus3(a,b)
template<class T >
SGrid<T> operator- ( const SGrid< T > &  nVector)

Negation of variable of coord/int_coord derived type

1 SGrid <delphi_real> fVec2 = -fVec1: neg(a);
2 SGrid <delphi_integer> iVec2 = -iVec1: ineg(a)
template<class T , class N >
SGrid<T> operator/ ( const SGrid< N > &  nVector,
const T &  nValue 
)

Divides coord derived type by delphi_real or divides int_coord derived type by delphi_real/delphi_integer

1 SGrid <delphi_real,delphi_real> fVec2 = fVec1/fVal: vdiv(a,b);
2 SGrid <delphi_real,delphi_integer> fVec1 = iVec1/fVal: ivdiv(a,b);
3 SGrid <delphi_integer,delphi_integer> iVec2 = iVec1/iVal: ivdiv2(a,b)
template<class T >
SGrid<T> optABS ( const SGrid< T > &  nVector)

absolute value

1 SGrid <delphi_real> fVec2 = optABS<delphi_real>(fVec1): vabs(a)
2 SGrid <delphi_integer> iVec2 = optABS<delphi_integer>(iVec1): ivabs(a)
template<class T >
bool optANDGE ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid and greater than or equal to (version I)

1 bool bRtVal = optANDGE<delphi_real>(fVec1,fVec2): vandge(a,b);
2 bool bRtVal = optANDGE<delphi_integer>(iVec1,iVec2): ivandge(a,b)
template<class T >
bool optANDGE ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid and greater than or equal to (version II)

1 bool bRtVal = optANDGE<delphi_real>(fVec1,fVal): vandge2(a,b);
2 bool bRtVal = optANDGE<delphi_integer>(iVec1,iVal): ivandge2(a,b)
template<class T >
bool optANDGT ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid and greater than (version I)

1 bool bRtVal = optANDGT<delphi_real>(fVec1,fVec2): vandgt(a,b);
2 bool bRtVal = optANDGT<delphi_integer>(iVec1,iVec2): ivandgt(a,b)
template<class T >
bool optANDGT ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid and greater than (version II)

1 bool bRtVal = optANDGT<delphi_real>(fVec1,fVal): vandgt2(a,b);
2 bool bRtVal = optANDGT<delphi_integer>(iVec1,iVal): ivandgt2(a,b)
template<class T >
bool optANDLE ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid and less than or equal to (version I)

1 bool bRtVal = optANDLE<delphi_real>(fVec1,fVec2): vandle(a,b);
2 bool bRtVal = optANDLE<delphi_integer>(iVec1,iVec2): ivandle(a,b)
template<class T >
bool optANDLE ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid and less than or equal to (version II)

1 bool bRtVal = optANDLE<delphi_real>(fVec1,fVal): vandle2(a,b);
2 bool bRtVal = optANDLE<delphi_integer>(iVec1,iVal): ivandle2(a,b)
template<class T >
bool optANDLT ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid and less than (version I)

1 bool bRtVal = optANDLT<delphi_real>(fVec1,fVec2): vandlt(a,b);
2 bool bRtVal = optANDLT<delphi_integer>(iVec1,iVec2): ivandlt(a,b)
template<class T >
bool optANDLT ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid and less than (version II)

1 bool bRtVal = optANDLT<delphi_real>(fVec1,fVal): vandlt2(a,b);
2 bool bRtVal = optANDLT<delphi_integer>(iVec1,iVal): ivandlt2(a,b)
template<class T , class N >
SGrid<T> optCast ( const SGrid< N > &  nVector)

Converts coord type into int_coord type:

1 SGrid <delphi_integer> iVec = optCast<delphi_integer,delphi_real>(fVec): ivint(a)

Converts int_coord type into coord type:

1 SGrid <delphi_real> iVec = optCast<delphi_real,delphi_integer>(iVec): vfloat(a)
template<class T >
T optComp ( const SGrid< T > &  nVector,
const int &  nValue 
)

comparison of grid to a scalar

1 delphi_real fVal1 = optComp<delphi_real>(fVec1,iVal1): vcomp(a,b);
2 delphi_integer iVal2 = optComp<delphi_integer>(iVec1,iVal1): ivcomp(a,b)
template<class T >
SGrid<T> optCross ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

cross product

1 SGrid <delphi_real> fVec3 = optCross<delphi_real>(fVec1,fVec2) : vx(a,b);
2 SGrid <delphi_integer> iVec3 = optCross<delphi_integer>(iVec1,iVec2): ivx(a,b)
template<class T >
T optDot ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

dot product

1 delphi_real fResult = optDot<delphi_real>(fVec1,fVec2) : vdot(a,b);
2 delphi_integer iResult = optDot<delphi_integer>(iVec1,iVec2): ivdot(a,b)
template<class T >
SGrid<T> optMax ( const T &  nValue,
const SGrid< T > &  nVector 
)

maximal entry (version I)

1 SGrid <delphi_real> fVec2 = optMax<delphi_real>(fVal,fVec1): vmax(b,a);
2 SGrid <delphi_integer> iVec2 = optMax<delphi_integer>(iVal,iVec1): ivmax(b,a)
template<class T >
SGrid<T> optMax ( const SGrid< T > &  nVector,
const T &  nValue 
)

maximal entry (version II)

1 SGrid <delphi_real> fVec2 = optMax<delphi_real>(fVec1,fVal): vmax2(b,a);
2 SGrid <delphi_integer> iVec2 = optMax<delphi_integer>(iVec1,iVal): ivmax2(b,a)
template<class T >
SGrid<T> optMax ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

maximal entry (version III)

1 SGrid <delphi_real> fVec3 = optMax<delphi_real>(fVec1,fVec2): vmax3(b,a);
2 SGrid <delphi_integer> iVec3 = optMax<delphi_integer>(iVec1,iVec2): ivmax3(b,a)
template<class T >
T optMax ( const SGrid< T > &  nVector)

maximal entry (version IV)

1 SGrid <delphi_real> fVal = optMax<delphi_real>(fVec1): vmax4(a);
2 SGrid <delphi_integer> iVal = optMax<delphi_integer>(iVec1): ivmax4(a)
template<class T >
SGrid<T> optMaxSign ( const T &  nValue,
const SGrid< T > &  nVector 
)

maxmal sign (version I)

1 SGrid <delphi_real> fVec2 = optMaxSign<delphi_real>(fVal,fVec1): vpsign(b,a)
template<class T >
SGrid<T> optMaxSign ( const SGrid< T > &  nVector,
const T &  nValue 
)

maximal sign (version II)

1 SGrid <delphi_real> fVec2 = optMaxSign<delphi_real>(fVec1,fVal): vpsign2(b,a)
template<class T >
SGrid<T> optMin ( const T &  nValue,
const SGrid< T > &  nVector 
)

minimal entry (version I)

1 SGrid <delphi_real> fVec2 = optMin<delphi_real>(fVal,fVec1): vmin(b,a);
2 SGrid <delphi_integer> iVec2 = optMin<delphi_integer>(iVal,iVec1): ivmin(b,a)
template<class T >
SGrid<T> optMin ( const SGrid< T > &  nVector,
const T &  nValue 
)

minimal entry (version II)

1 SGrid <delphi_real> fVec2 = optMin<delphi_real>(fVec1,fVal): vmin2(b,a);
2 SGrid <delphi_integer> iVec2 = optMin<delphi_integer>(iVec1,iVal): ivmin2(b,a)
template<class T >
SGrid<T> optMin ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

minial entry (version III)

1 SGrid <delphi_real> fVec3 = optMin<delphi_real>(fVec1,fVec2): vmin3(b,a);
2 SGrid <delphi_integer> iVec3 = optMin<delphi_integer>(iVec1,iVec2): ivmin3(b,a)
template<class T >
T optMin ( const SGrid< T > &  nVector)

minial entry (vesion IV)

1 SGrid <delphi_real> fVal = optMin<delphi_real>(fVec1): vmin4(a);
2 SGrid <delphi_integer> iVal = optMin<delphi_integer>(iVec1): ivmin4(a)
template<class T >
SGrid<T> optMinSign ( const T &  nValue,
const SGrid< T > &  nVector 
)

minimal sign (version I)

1 SGrid <delphi_real> fVec2 = optMinSign<delphi_real>(fVal,fVec1): vmsign(b,a)
template<class T >
SGrid<T> optMinSign ( const SGrid< T > &  nVector,
const T &  nValue 
)

minial sign (version II)

1 SGrid <delphi_real> fVec2 = optMinSign<delphi_real>(fVec1,fVal): vmsign2(b,a)
template<class T >
bool optORGE ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid or greater than or equal to (version I)

1 bool bRtVal = optORGE<delphi_real>(fVec1,fVec2): vorge(a,b);
2 bool bRtVal = optORGE<delphi_integer>(iVec1,iVec2): ivorge(a,b)
template<class T >
bool optORGE ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid or greater than or equal to (version II)

1 bool bRtVal = optORGE<delphi_real>(fVec1,fVal): vorge2(a,b);
2 bool bRtVal = optORGE<delphi_integer>(iVec1,iVal): ivorge2(a,b)
template<class T >
bool optORGT ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid or greater than (version I)

1 bool bRtVal = optORGT<delphi_real>(fVec1,fVec2): vorgt(a,b);
2 bool bRtVal = optORGT<delphi_integer>(iVec1,iVec2): ivorgt(a,b)
template<class T >
bool optORGT ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid or greater than (version II)

1 bool bRtVal = optORGT<delphi_real>(fVec1,fVal): vorgt2(a,b);
2 bool bRtVal = optORGT<delphi_integer>(iVec1,iVal): ivorgt2(a,b)
template<class T >
bool optORLE ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid or less than or equal to (version I)

1 bool bRtVal = optORLE<delphi_real>(fVec1,fVec2): vorle(a,b);
2 bool bRtVal = optORLE<delphi_integer>(iVec1,iVec2): ivorle(a,b)
template<class T >
bool optORLE ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid or less than or equal to

1 bool bRtVal = optORLE<delphi_real>(fVec1,fVal): vorle2(a,b);
2 bool bRtVal = optORLE<delphi_integer>(iVec1,iVal): ivorle2(a,b)
template<class T >
bool optORLT ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2 
)

grid or less than (version I)

1 bool bRtVal = optORLT<delphi_real>(fVec1,fVec2): vorlt(a,b);
2 bool bRtVal = optORLT<delphi_integer>(iVec1,iVec2): ivorlt(a,b)
template<class T >
bool optORLT ( const SGrid< T > &  nVector1,
const T &  nValue 
)

grid or less than (version II)

1 bool bRtVal = optORLT<delphi_real>(fVec1,fVal): vorlt2(a,b);
2 bool bRtVal = optORLT<delphi_integer>(iVec1,iVal): ivorlt2(a,b)
SGrid<delphi_integer> optRound ( const SGrid< delphi_real > &  nVector)

Notes: C++ always truncates, aka rounds down. If you want it to round to the nearest intager, add 0.5 or 0.5f before casting.

Converts coord type into int_coord type with nint

1 SGrid <delphi_integer> iVec = optRound<delphi_integer>(fVec): ivnint(a)
SGrid<delphi_real> optSQRT ( const SGrid< delphi_real > &  nVector)

square root

1 SGrid <delphi_real> fVec2 = optSQRT(fVec1): vsqrt(a)
template<class T >
SGrid<T> optSubMax ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2,
const SGrid< T > &  nVector3 
)
1 SGrid <delphi_real> fVec4 = optSubMax<delphi_real>(fVec1,fVec2,fVec3): vsubmax(a,b,c)
template<class T >
SGrid<T> optSubMin ( const SGrid< T > &  nVector1,
const SGrid< T > &  nVector2,
const SGrid< T > &  nVector3 
)
1 SGrid <delphi_real> fVec4 = optSubMin<delphi_real>(fVec1,fVec2,fVec3): vsubmin(a,b,c)
template<class T >
T optSum ( const SGrid< T > &  nVector)

sum of entries

1 delphi_real fVal = optSum<delphi_real>(fVec1): vsum(a);
2 delphi_integer iVal = optSum<delphi_integer>(iVec1): ivsum(a)