MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Computes the L_infinity objective function for a given patch, i.e., LInfTemplate::concrete_evaluate returns the maximum absolute value of the quality metric values on 'patch'. More...
#include <LInfTemplate.hpp>
Public Member Functions | |
MESQUITE_EXPORT | LInfTemplate (QualityMetric *) |
virtual MESQUITE_EXPORT | ~LInfTemplate () |
virtual MESQUITE_EXPORT bool | evaluate (EvalType type, PatchData &pd, double &value_out, bool free, MsqError &err) |
Evaluate objective function for specified patch. | |
virtual MESQUITE_EXPORT ObjectiveFunction * | clone () const |
Create copy with same state. | |
virtual MESQUITE_EXPORT void | clear () |
Private Attributes | |
std::vector< size_t > | qmHandles |
Computes the L_infinity objective function for a given patch, i.e., LInfTemplate::concrete_evaluate returns the maximum absolute value of the quality metric values on 'patch'.
Definition at line 51 of file LInfTemplate.hpp.
MBMesquite::LInfTemplate::LInfTemplate | ( | QualityMetric * | qualitymetric | ) |
Definition at line 44 of file LInfTemplate.cpp.
Referenced by clone().
: ObjectiveFunctionTemplate( qualitymetric ) {}
MBMesquite::LInfTemplate::~LInfTemplate | ( | ) | [virtual] |
Definition at line 47 of file LInfTemplate.cpp.
{}
void MBMesquite::LInfTemplate::clear | ( | ) | [virtual] |
Clear any values accumulated for BCD-related eval calls
Implements MBMesquite::ObjectiveFunction.
Definition at line 54 of file LInfTemplate.cpp.
{}
ObjectiveFunction * MBMesquite::LInfTemplate::clone | ( | ) | const [virtual] |
Create copy with same state.
Create a new instance of the objective function that is a copy of the callee with the same accumulated values, parameters, etc.
Implements MBMesquite::ObjectiveFunction.
Definition at line 49 of file LInfTemplate.cpp.
References MBMesquite::ObjectiveFunctionTemplate::get_quality_metric(), and LInfTemplate().
{ return new LInfTemplate( get_quality_metric() ); }
bool MBMesquite::LInfTemplate::evaluate | ( | EvalType | type, |
PatchData & | pd, | ||
double & | value_out, | ||
bool | free, | ||
MsqError & | err | ||
) | [virtual] |
Evaluate objective function for specified patch.
Either evaluate the objective function over the passed patch or update the accumulated, global objective function value for changes in the passed patch, depending on the value of the EvalType.
type | Evaluation type. |
pd | The patch. |
value_out | The passed-back value of the objective fuction. |
free | If true, incorporate the quality metric values only for those metric evaluations that depend on at least one free vertex |
Implements MBMesquite::ObjectiveFunction.
Definition at line 56 of file LInfTemplate.cpp.
References MBMesquite::ObjectiveFunction::CALCULATE, MBMesquite::QualityMetric::evaluate(), MBMesquite::QualityMetric::get_evaluations(), MBMesquite::QualityMetric::get_negate_flag(), MBMesquite::ObjectiveFunctionTemplate::get_quality_metric(), MBMesquite::MsqError::INVALID_STATE, MSQ_CHKERR, MSQ_ERRFALSE, MSQ_SETERR, MBMesquite::negate(), qmHandles, and value().
{ if( type != ObjectiveFunction::CALCULATE ) { MSQ_SETERR( err ) ( "LInfTemplate does not support block coodinate descent algoritms", MsqError::INVALID_STATE ); return false; } QualityMetric* qm = get_quality_metric(); qm->get_evaluations( pd, qmHandles, free, err ); MSQ_ERRFALSE( err ); const double negate = qm->get_negate_flag(); // calculate OF value for just the patch std::vector< size_t >::const_iterator i; double value; value_out = -HUGE_VAL; for( i = qmHandles.begin(); i != qmHandles.end(); ++i ) { bool result = qm->evaluate( pd, *i, value, err ); if( MSQ_CHKERR( err ) || !result ) return false; value = negate * fabs( value ); if( value > value_out ) value_out = value; } return true; }
std::vector< size_t > MBMesquite::LInfTemplate::qmHandles [mutable, private] |
Temporary storage for qm sample handles
Definition at line 62 of file LInfTemplate.hpp.
Referenced by evaluate().