37 #include "LInfTemplate.hpp"
66 int num_elements=patch.num_elements();
67 MsqMeshEntity* elems=patch.get_element_array(err);
MSQ_ERRZERO(err);
70 for (index=0; index<num_elements;index++){
72 obj_bool=currentQM->evaluate_element(patch, &elems[index], temp_value,
78 temp_value = fabs(temp_value);
84 int num_vertices=patch.num_vertices();
85 MsqVertex* vertices=patch.get_vertex_array(err);
MSQ_ERRZERO(err);
89 for (index=0; index<num_vertices;index++){
91 obj_bool=currentQM->evaluate_vertex(patch,&vertices[index],
97 temp_value = fabs(temp_value);
111 MSQ_SETERR(err)(
"The LInfTemplate is not sufficient for methods requiring\n"
112 " gradient information. If you neeed to try this anyway, \n"
113 " set the gradient type to numerical.\n",
void set_gradient_type(GRADIENT_TYPE grad)
Set gradType to either NUMERICAL_GRADIENT or ANALYTICAL_GRADIENT.
#define MSQ_ERRZERO(err)
Return zero/NULL on error.
void set_quality_metric(QualityMetric *qm)
Set the value of qMetric.
virtual bool concrete_evaluate(PatchData &patch, double &fval, MsqError &err)
every differentiable function should have an analytical gradient implemented.
QualityMetric * get_quality_metric()
virtual msq_std::list< QualityMetric * > get_quality_metric_list()
NVec< 3, double > Vector3D
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
void set_negate_flag(int neg)
Set the value of ObjectiveFunction's negateFlag. Unless composite, concrete ObjectiveFunctions should...
virtual bool compute_analytical_gradient(PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size)
object is in an invalid state
LInfTemplate(QualityMetric *)