MOAB: Mesh Oriented datABase
(version 5.4.1)
|
Public Member Functions | |
FauxObjectiveFunction (double value, bool invalid=false, bool error=false) | |
~FauxObjectiveFunction () | |
bool | initialize_block_coordinate_descent (MeshDomainAssoc *, const Settings *, PatchSet *, MsqError &) |
Initial accumulated value for block coordinate descent algorithms. | |
bool | evaluate (EvalType, PatchData &, double &value_out, bool, MsqError &err) |
Evaluate objective function for specified patch. | |
ObjectiveFunction * | clone () const |
Create copy with same state. | |
void | clear () |
int | min_patch_layers () const |
void | initialize_queue (MeshDomainAssoc *, const Settings *, MsqError &) |
Called at start of instruction queue processing. | |
double | get_value () const |
Static Public Member Functions | |
static int | get_instance_count () |
Private Attributes | |
double | mValue |
bool | mInvalid |
bool | mError |
Static Private Attributes | |
static int | instanceCount = 0 |
Fake ObjectiveFunction to pass to Composite OFs
Definition at line 54 of file CompositeOFTest.cpp.
FauxObjectiveFunction::FauxObjectiveFunction | ( | double | value, |
bool | invalid = false , |
||
bool | error = false |
||
) | [inline] |
Definition at line 57 of file CompositeOFTest.cpp.
FauxObjectiveFunction::~FauxObjectiveFunction | ( | ) | [inline] |
Definition at line 62 of file CompositeOFTest.cpp.
{ --instanceCount; }
void FauxObjectiveFunction::clear | ( | ) | [inline, virtual] |
Clear any values accumulated for BCD-related eval calls
Implements MBMesquite::ObjectiveFunction.
Definition at line 82 of file CompositeOFTest.cpp.
{}
ObjectiveFunction* FauxObjectiveFunction::clone | ( | ) | const [inline, 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 77 of file CompositeOFTest.cpp.
{ ++instanceCount; return new FauxObjectiveFunction( *this ); }
bool FauxObjectiveFunction::evaluate | ( | EvalType | type, |
PatchData & | pd, | ||
double & | value_out, | ||
bool | free, | ||
MsqError & | err | ||
) | [inline, 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 71 of file CompositeOFTest.cpp.
References INTERNAL_ERROR, and MSQ_SETERR.
{ if( mError ) MSQ_SETERR( err )( MsqError::INTERNAL_ERROR ); value_out = mValue; return !mInvalid; }
static int FauxObjectiveFunction::get_instance_count | ( | ) | [inline, static] |
Definition at line 94 of file CompositeOFTest.cpp.
Referenced by CompositeOFTest::test_composite_clone().
{ return instanceCount; }
double FauxObjectiveFunction::get_value | ( | ) | const [inline] |
Definition at line 90 of file CompositeOFTest.cpp.
{ return mValue; }
bool FauxObjectiveFunction::initialize_block_coordinate_descent | ( | MeshDomainAssoc * | mesh_and_domain, |
const Settings * | settings, | ||
PatchSet * | user_set, | ||
MsqError & | err | ||
) | [inline, virtual] |
Initial accumulated value for block coordinate descent algorithms.
Set accumulated value of objective function to the value for the entire, unmodified mesh. This is the initial state for a block coordinate descent algorithm. The ObjectiveFunction will asked to add or remove values for a specific patch of the mesh during the optimization.
mesh | The Mesh |
domain | The MeshDomain |
user_set | User-defined patch set - not relevant for most OF templates. |
Implements MBMesquite::ObjectiveFunction.
Definition at line 66 of file CompositeOFTest.cpp.
{ CPPUNIT_ASSERT_MESSAGE( "This shouldn't ever get called", false ); return false; }
void FauxObjectiveFunction::initialize_queue | ( | MeshDomainAssoc * | mesh_and_domain, |
const Settings * | settings, | ||
MsqError & | err | ||
) | [inline, virtual] |
Called at start of instruction queue processing.
Do any preliminary global initialization, consistency checking, etc. This function is pure-virtual (abstract) in this class because every practical OF implementation at this time should have an implementation that at least recursively calls the same function on the underlying QualityMetric or ObjectiveFunction(s).
Implements MBMesquite::ObjectiveFunction.
Definition at line 88 of file CompositeOFTest.cpp.
{}
int FauxObjectiveFunction::min_patch_layers | ( | ) | const [inline, virtual] |
Get the minimum number of layers of adjacent elements required in a patch to evaluate the objective function for a single free vertex.
Implements MBMesquite::ObjectiveFunction.
Definition at line 83 of file CompositeOFTest.cpp.
{
return 0;
}
int FauxObjectiveFunction::instanceCount = 0 [static, private] |
Definition at line 102 of file CompositeOFTest.cpp.
bool FauxObjectiveFunction::mError [private] |
Definition at line 101 of file CompositeOFTest.cpp.
bool FauxObjectiveFunction::mInvalid [private] |
Definition at line 101 of file CompositeOFTest.cpp.
double FauxObjectiveFunction::mValue [private] |
Definition at line 100 of file CompositeOFTest.cpp.