Computes the maximum quality metric value. More...
#include <MaxTemplate.hpp>
Public Member Functions | |
MaxTemplate (QualityMetric *) | |
virtual | ~MaxTemplate () |
virtual bool | concrete_evaluate (PatchData &patch, double &fval, MsqError &err) |
MaxTemplate (QualityMetric *) | |
virtual | ~MaxTemplate () |
virtual bool | concrete_evaluate (PatchData &patch, double &fval, MsqError &err) |
Public Member Functions inherited from ObjectiveFunction | |
ObjectiveFunction () | |
virtual | ~ObjectiveFunction () |
bool | evaluate (PatchData &patch, double &fval, MsqError &err) |
void | set_gradient_type (GRADIENT_TYPE grad) |
Set gradType to either NUMERICAL_GRADIENT or ANALYTICAL_GRADIENT. More... | |
bool | compute_gradient (PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size=0) |
Calls either compute_numerical_gradient or compute_analytical_gradient depending on the value of gradType. Function returns 'false' if the patch is not within a required feasible regeion. Otherwise, it returns 'true'. More... | |
bool | compute_hessian (PatchData &patch, MsqHessian &hessian, Vector3D *const &grad, double &OF_val, MsqError &err) |
Calls compute_analytical_hessian. Function returns 'false' if the patch is not within a required feasible regeion. Otherwise, it returns 'true'. More... | |
QualityMetric * | get_quality_metric () |
virtual msq_std::list < QualityMetric * > | get_quality_metric_list () |
void | set_quality_metric (QualityMetric *qm) |
Set the value of qMetric. More... | |
void | set_negate_flag (int neg) |
Set the value of ObjectiveFunction's negateFlag. Unless composite, concrete ObjectiveFunctions should set this flag to to the value of the associated QualityMetric's negateFLag. More... | |
int | get_negate_flag () |
Returns negateFlag. More... | |
ObjectiveFunction () | |
virtual | ~ObjectiveFunction () |
bool | evaluate (PatchData &patch, double &fval, MsqError &err) |
void | set_gradient_type (GRADIENT_TYPE grad) |
Set gradType to either NUMERICAL_GRADIENT or ANALYTICAL_GRADIENT. More... | |
bool | compute_gradient (PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size=0) |
Calls either compute_numerical_gradient or compute_analytical_gradient depending on the value of gradType. Function returns 'false' if the patch is not within a required feasible regeion. Otherwise, it returns 'true'. More... | |
bool | compute_hessian (PatchData &patch, MsqHessian &hessian, Vector3D *const &grad, double &OF_val, MsqError &err) |
Calls compute_analytical_hessian. Function returns 'false' if the patch is not within a required feasible regeion. Otherwise, it returns 'true'. More... | |
QualityMetric * | get_quality_metric () |
virtual msq_std::list < QualityMetric * > | get_quality_metric_list () |
void | set_quality_metric (QualityMetric *qm) |
Set the value of qMetric. More... | |
void | set_negate_flag (int neg) |
Set the value of ObjectiveFunction's negateFlag. Unless composite, concrete ObjectiveFunctions should set this flag to to the value of the associated QualityMetric's negateFLag. More... | |
int | get_negate_flag () |
Returns negateFlag. More... | |
Protected Member Functions | |
virtual bool | compute_analytical_gradient (PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size) |
virtual bool | compute_analytical_gradient (PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size) |
Protected Member Functions inherited from ObjectiveFunction | |
bool | compute_numerical_gradient (PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size) |
Non-virtual function which numerically computes the gradient of the Objective Function. Function returns 'false' if the patch is not within a required feasible regeion. Otherwise, it returns 'true'. More... | |
virtual bool | compute_analytical_hessian (PatchData &, MsqHessian &, Vector3D *const &, double &, MsqError &) |
double | get_eps (PatchData &pd, double &local_val, int k, MsqVertex *vertex, MsqError &err) |
Returns eps used in the numerical gradient calculation. More... | |
void | set_use_local_gradient (bool new_bool) |
Sets useLocalGradient This variable determines whether compute_numercial_gradient can use the most efficient gradient calculation. More... | |
bool | compute_numerical_gradient (PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size) |
Non-virtual function which numerically computes the gradient of the Objective Function. Function returns 'false' if the patch is not within a required feasible regeion. Otherwise, it returns 'true'. More... | |
virtual bool | compute_analytical_hessian (PatchData &, MsqHessian &, Vector3D *const &, double &, MsqError &) |
double | get_eps (PatchData &pd, double &local_val, int k, MsqVertex *vertex, MsqError &err) |
Returns eps used in the numerical gradient calculation. More... | |
void | set_use_local_gradient (bool new_bool) |
Sets useLocalGradient This variable determines whether compute_numercial_gradient can use the most efficient gradient calculation. More... | |
Additional Inherited Members | |
Public Types inherited from ObjectiveFunction | |
enum | GRADIENT_TYPE { NUMERICAL_GRADIENT, ANALYTICAL_GRADIENT, NUMERICAL_GRADIENT, ANALYTICAL_GRADIENT } |
enum | GRADIENT_TYPE { NUMERICAL_GRADIENT, ANALYTICAL_GRADIENT, NUMERICAL_GRADIENT, ANALYTICAL_GRADIENT } |
Computes the maximum quality metric value.
This function is the same as the LInfTemplate except that no absolute values are used.
Definition at line 56 of file includeLinks/MaxTemplate.hpp.
MaxTemplate | ( | QualityMetric * | qualitymetric | ) |
Definition at line 43 of file ObjectiveFunction/MaxTemplate.cpp.
References ObjectiveFunction::ANALYTICAL_GRADIENT, QualityMetric::get_negate_flag(), ObjectiveFunction::set_gradient_type(), ObjectiveFunction::set_negate_flag(), and ObjectiveFunction::set_quality_metric().
|
virtual |
Definition at line 50 of file ObjectiveFunction/MaxTemplate.cpp.
MaxTemplate | ( | QualityMetric * | ) |
|
virtual |
|
protectedvirtual |
Fills an array of Vector3D, grad, with the gradient of the objective function computed using the gradient of the quality metric. If the function has not been over-riden in the concrete Objective Function, the base class implementation prints a warning and then defaults to numerical gradient. Function returns 'false' if the patch is not within a required feasible regeion. Otherwise, it returns 'true'.
patch | The PatchData object for which the objective function gradient is computed. |
grad | An array of Vector3D, at least the size of the number of vertices in the patch. |
OF_val | is set to the value of the objective function. |
array_size | is the size of the grad Vector3D[] array and must correspond to the number of vertices in the patch. |
Reimplemented from ObjectiveFunction.
Definition at line 115 of file ObjectiveFunction/MaxTemplate.cpp.
References MsqError::INVALID_STATE, and MSQ_SETERR.
|
protectedvirtual |
Fills an array of Vector3D, grad, with the gradient of the objective function computed using the gradient of the quality metric. If the function has not been over-riden in the concrete Objective Function, the base class implementation prints a warning and then defaults to numerical gradient. Function returns 'false' if the patch is not within a required feasible regeion. Otherwise, it returns 'true'.
patch | The PatchData object for which the objective function gradient is computed. |
grad | An array of Vector3D, at least the size of the number of vertices in the patch. |
OF_val | is set to the value of the objective function. |
array_size | is the size of the grad Vector3D[] array and must correspond to the number of vertices in the patch. |
Reimplemented from ObjectiveFunction.
Evaluate the objective function on a given patch.
Implements ObjectiveFunction.
Evaluate the objective function on a given patch.
Implements ObjectiveFunction.
Definition at line 54 of file ObjectiveFunction/MaxTemplate.cpp.
References QualityMetric::ELEMENT_BASED, QualityMetric::evaluate_element(), QualityMetric::evaluate_vertex(), PatchData::get_element_array(), QualityMetric::get_metric_type(), ObjectiveFunction::get_quality_metric(), PatchData::get_vertex_array(), MsqError::INVALID_STATE, MSQ_CHKERR, MSQ_ERRZERO, MSQ_SETERR, PatchData::num_elements(), PatchData::num_vertices(), and QualityMetric::VERTEX_BASED.