Numerical operations on fields

Functions

const FIELD MEDMEM::FIELD::operator+ (const FIELD &m) const
FIELD & MEDMEM::FIELD::operator+= (const FIELD &m)
static FIELD * MEDMEM::FIELD::add (const FIELD &m, const FIELD &n)
static FIELD * MEDMEM::FIELD::addDeep (const FIELD &m, const FIELD &n)
const FIELD MEDMEM::FIELD::operator- (const FIELD &m) const
const FIELD MEDMEM::FIELD::operator- () const
FIELD & MEDMEM::FIELD::operator-= (const FIELD &m)
void MEDMEM::FIELD::applyLin (T a, T b, int icomp)
static FIELD * MEDMEM::FIELD::sub (const FIELD &m, const FIELD &n)
static FIELD * MEDMEM::FIELD::subDeep (const FIELD &m, const FIELD &n)
const FIELD MEDMEM::FIELD::operator* (const FIELD &m) const
FIELD & MEDMEM::FIELD::operator*= (const FIELD &m)
static FIELD * MEDMEM::FIELD::mul (const FIELD &m, const FIELD &n)
static FIELD * MEDMEM::FIELD::mulDeep (const FIELD &m, const FIELD &n)
const FIELD MEDMEM::FIELD::operator/ (const FIELD &m) const
FIELD & MEDMEM::FIELD::operator/= (const FIELD &m)
static FIELD * MEDMEM::FIELD::div (const FIELD &m, const FIELD &n)
static FIELD * MEDMEM::FIELD::divDeep (const FIELD &m, const FIELD &n)
double MEDMEM::FIELD::normMax () const throw (MEDEXCEPTION)
double MEDMEM::FIELD::norm2 () const throw (MEDEXCEPTION)
void MEDMEM::FIELD::getMinMax (T &vmin, T &vmax) throw (MEDEXCEPTION)
vector< int > MEDMEM::FIELD::getHistogram (int &nbint) throw (MEDEXCEPTION)
FIELD< double > * MEDMEM::FIELD::buildGradient () const throw (MEDEXCEPTION)
FIELD< double > * MEDMEM::FIELD::buildNorm2Field () const throw (MEDEXCEPTION)
template<T T_function>
void MEDMEM::FIELD::applyFunc ()
static T MEDMEM::FIELD::pow (T x)
void MEDMEM::FIELD::applyPow (T scalar)
void MEDMEM::FIELD::applyLin (T a, T b)
static FIELD * MEDMEM::FIELD::scalarProduct (const FIELD &m, const FIELD &n, bool deepCheck=false)
double MEDMEM::FIELD::normL2 (int component, const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD::normL2 (const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD::normL1 (int component, const FIELD< double, FullInterlace > *p_field_volume=NULL) const
double MEDMEM::FIELD::normL1 (const FIELD< double, FullInterlace > *p_field_volume=NULL) const
FIELD * MEDMEM::FIELD::extract (const SUPPORT *subSupport) const throw (MEDEXCEPTION)

Detailed Description

This section groups together the different operators that enable the user to treat the FIELD objects as high-level numerical arrays, giving operators for numerical treatment (overloading of basic operators, algorithms, etc...)


Function Documentation

template<class T , class INTERLACING_TAG >
const FIELD< T, INTERLACING_TAG > MEDMEM::FIELD< T, INTERLACING_TAG >::operator+ ( const FIELD< T, INTERLACING_TAG > &  m  )  const [inherited]

Overload addition operator. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits.

The data members of the returned field are initialized, based on the first field, except for the name, which is the combination of the two field's names and the operator. Advised Utilisation in C++ : FIELD<T> c = a + b;
In this case, the (recent) compilators perform optimisation and don't call the copy constructor. When using python, this operator calls the copy constructor in any case. The user has to be aware that when using operator + in associatives expressions like a = b + c + d +e;
no optimisation is performed : the evaluation of last expression requires the construction of 3 temporary fields.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::operator+= ( const FIELD< T, INTERLACING_TAG > &  m  )  [inherited]

Overloaded Operator += Operations are directly performed in the first field's array. This operation is authorized only for compatible fields that have the same support.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::add ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
) [static, inherited]

Addition of fields. Static member function. The function return a pointer to a new created field that holds the addition. Data members are checked for compatibility and initialized. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::addDeep ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
) [static, inherited]

Same as add method except that field check is deeper.

References MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
const FIELD< T, INTERLACING_TAG > MEDMEM::FIELD< T, INTERLACING_TAG >::operator- ( const FIELD< T, INTERLACING_TAG > &  m  )  const [inherited]

Overload substraction operator. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits.

The data members of the returned field are initialized, based on the first field, except for the name, which is the combination of the two field's names and the operator. Advised Utilisation in C++ : FIELD<T> c = a - b;
In this case, the (recent) compilators perform optimisation and don't call the copy constructor. When using python, this operator calls the copy constructor in any case. The user has to be aware that when using operator - in associatives expressions like a = b - c - d -e;
no optimisation is performed : the evaluation of last expression requires the construction of 3 temporary fields.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
const FIELD< T, INTERLACING_TAG > MEDMEM::FIELD< T, INTERLACING_TAG >::operator- (  )  const [inherited]
template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::operator-= ( const FIELD< T, INTERLACING_TAG > &  m  )  [inherited]

Overloaded Operator -= Operations are directly performed in the first field's array. This operation is authorized only for compatible fields that have the same support.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACIN_TAG >
void MEDMEM::FIELD< T, INTERLACIN_TAG >::applyLin ( a,
b,
int  icomp 
) [inherited]

Apply to a given field component the linear function x -> ax+b. calculation is done "in place".

References MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::sub ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
) [static, inherited]

Substraction of fields. Static member function. The function return a pointer to a new created field that holds the substraction. Data members are checked for compatibility and initialized. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::subDeep ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
) [static, inherited]

Same as sub method except that field check is deeper.

References MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
const FIELD< T, INTERLACING_TAG > MEDMEM::FIELD< T, INTERLACING_TAG >::operator* ( const FIELD< T, INTERLACING_TAG > &  m  )  const [inherited]

Overload multiplication operator. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits.

The data members of the returned field are initialized, based on the first field, except for the name, which is the combination of the two field's names and the operator. Advised Utilisation in C++ : FIELD<T> c = a * b;
In this case, the (recent) compilators perform optimisation and don't call the copy constructor. When using python, this operator calls the copy constructor in any case. The user has to be aware that when using operator * in associatives expressions like a = b * c * d *e;
no optimisation is performed : the evaluation of last expression requires the construction of 3 temporary fields.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::operator*= ( const FIELD< T, INTERLACING_TAG > &  m  )  [inherited]

Overloaded Operator *= Operations are directly performed in the first field's array. This operation is authorized only for compatible fields that have the same support.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::mul ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
) [static, inherited]

Multiplication of fields. Static member function. The function return a pointer to a new created field that holds the multiplication. Data members are checked for compatibility and initialized. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::mulDeep ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
) [static, inherited]

Same as mul method except that field check is deeper.

References MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
const FIELD< T, INTERLACING_TAG > MEDMEM::FIELD< T, INTERLACING_TAG >::operator/ ( const FIELD< T, INTERLACING_TAG > &  m  )  const [inherited]

Overload division operator. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits.

The data members of the returned field are initialized, based on the first field, except for the name, which is the combination of the two field's names and the operator. Advised Utilisation in C++ : FIELD<T> c = a / b;
In this case, the (recent) compilators perform optimisation and don't call the copy constructor. When using python, this operator calls the copy constructor in any case. The user has to be aware that when using operator / in associatives expressions like a = b / c / d /e;
no optimisation is performed : the evaluation of last expression requires the construction of 3 temporary fields.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > & MEDMEM::FIELD< T, INTERLACING_TAG >::operator/= ( const FIELD< T, INTERLACING_TAG > &  m  )  [inherited]

Overloaded Operator /= Operations are directly performed in the first field's array. This operation is authorized only for compatible fields that have the same support.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::div ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
) [static, inherited]

Division of fields. Static member function. The function return a pointer to a new created field that holds the division. Data members are checked for compatibility and initialized. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::divDeep ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n 
) [static, inherited]

Same as div method except that field check is deeper.

References MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getNumberOfComponents(), and MEDMEM::FIELD_::getSupport().

template<class T , class INTERLACIN_TAG >
double MEDMEM::FIELD< T, INTERLACIN_TAG >::normMax (  )  const throw (MEDEXCEPTION) [inherited]

Return maximum of all absolute values contained in the array (all elements and all components are browsed).

References MEDMEM::FIELD_::getName(), MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACIN_TAG >
double MEDMEM::FIELD< T, INTERLACIN_TAG >::norm2 (  )  const throw (MEDEXCEPTION) [inherited]
template<class T , class INTERLACIN_TAG >
void MEDMEM::FIELD< T, INTERLACIN_TAG >::getMinMax ( T &  vmin,
T &  vmax 
) throw (MEDEXCEPTION) [inherited]

Return Extrema of field

template<class T , class INTERLACIN_TAG >
vector< int > MEDMEM::FIELD< T, INTERLACIN_TAG >::getHistogram ( int &  nbint  )  throw (MEDEXCEPTION) [inherited]

Return Histogram of field

template<class T , class INTERLACIN_TAG >
FIELD< double, FullInterlace > * MEDMEM::FIELD< T, INTERLACIN_TAG >::buildGradient (  )  const throw (MEDEXCEPTION) [inherited]
template<class T , class INTERLACIN_TAG >
FIELD< double, FullInterlace > * MEDMEM::FIELD< T, INTERLACIN_TAG >::buildNorm2Field (  )  const throw (MEDEXCEPTION) [inherited]
template<class T , class INTERLACIN_TAG >
template<T T_function>
void MEDMEM::FIELD< T, INTERLACIN_TAG >::applyFunc (  )  [inherited]

Apply to each (scalar) field component the template parameter T_function, which is a pointer to function. Since the pointer is known at compile time, the function is inlined into the inner loop! calculation is done "in place". Use examples :

 myField.applyFunc<std::sqrt>();  // apply sqare root function 
 myField.applyFunc<myFunction>(); // apply your own created function 

References MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACIN_TAG >
T MEDMEM::FIELD< T, INTERLACIN_TAG >::pow ( x  )  [static, protected, inherited]
template<class T , class INTERLACIN_TAG >
void MEDMEM::FIELD< T, INTERLACIN_TAG >::applyPow ( scalar  )  [inherited]

Apply to each (scalar) field component the math function pow. calculation is done "in place". Use examples :

 myField.applyFunc<std::sqrt>();  // apply sqare root function 
 myField.applyFunc<myFunction>(); // apply your own created function 
template<class T , class INTERLACIN_TAG >
void MEDMEM::FIELD< T, INTERLACIN_TAG >::applyLin ( a,
b 
) [inherited]

Apply to each (scalar) field component the linear function x -> ax+b. calculation is done "in place".

References MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::scalarProduct ( const FIELD< T, INTERLACING_TAG > &  m,
const FIELD< T, INTERLACING_TAG > &  n,
bool  deepCheck = false 
) [static, inherited]

Return a pointer to a new field that holds the scalar product. Static member function. This operation is authorized only for compatible fields that have the same support. The compatibility checking includes equality tests of the folowing data members:

  • _support
  • _numberOfComponents
  • _numberOfValues
  • _componentsTypes
  • _MEDComponentsUnits. Data members are initialized. The new field point to the same support and has one component. Each value of it is the scalar product of the two argument's fields. The user is in charge of memory deallocation.

References MEDMEM::FIELD_::_checkFieldCompatibility(), MEDMEM::FIELD_::_deepCheckFieldCompatibility(), MEDMEM::FIELD_::getIterationNumber(), MEDMEM::FIELD_::getName(), MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), MEDMEM::FIELD_::getOrderNumber(), MEDMEM::FIELD_::getSupport(), MEDMEM::FIELD_::getTime(), MEDMEM::FIELD< T, INTERLACING_TAG >::getValue(), MEDMEM::FIELD_::setIterationNumber(), MEDMEM::FIELD_::setName(), MEDMEM::FIELD_::setOrderNumber(), and MEDMEM::FIELD_::setTime().

template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL2 ( int  component,
const FIELD< double, FullInterlace > *  p_field_volume = NULL 
) const [inherited]
template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL2 ( const FIELD< double, FullInterlace > *  p_field_volume = NULL  )  const [inherited]
template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL1 ( int  component,
const FIELD< double, FullInterlace > *  p_field_volume = NULL 
) const [inherited]
template<class T , class INTERLACING_TAG >
double MEDMEM::FIELD< T, INTERLACING_TAG >::normL1 ( const FIELD< double, FullInterlace > *  p_field_volume = NULL  )  const [inherited]

Return L1 Norm of the field. Cannot be applied to a field with a support on nodes. If the optional p_field_volume argument is furnished, the volume is not re-calculated.

References MEDMEM::FIELD_::_checkNormCompatibility(), MEDMEM::FIELD_::_getFieldSize(), MEDMEM::FIELD< T, INTERLACING_TAG >::getArrayNoGauss(), MEDMEM::FIELD_::getInterlacingType(), MEDMEM::FIELD_::getNumberOfComponents(), MEDMEM::FIELD_::getNumberOfValues(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

template<class T , class INTERLACING_TAG >
FIELD< T, INTERLACING_TAG > * MEDMEM::FIELD< T, INTERLACING_TAG >::extract ( const SUPPORT subSupport  )  const throw (MEDEXCEPTION) [inherited]

Return a new field (to deallocate with delete) lying on subSupport that is included by this->_support with corresponding values extracting from this->_value.

References MEDMEM::FIELD< T, INTERLACING_TAG >::_value, MEDMEM::FIELD_::copyGlobalInfo(), MEDMEM::FIELD< T, INTERLACING_TAG >::getNumberOfElements(), and MEDMEM::FIELD< T, INTERLACING_TAG >::getValue().

Generated on Tue Jul 27 21:55:03 2010 for Med Memory Users' Guide by  doxygen 1.6.3