36 #include "CompositeOFScalarMultiply.hpp"
37 #include "MsqTimer.hpp"
38 #include "MsqError.hpp"
39 #include "MsqDebug.hpp"
40 #include "PatchData.hpp"
63 MSQ_DBGOUT(1) <<
"ObjectiveFunction being scaled by zero.";
80 double &fval, MsqError &err){
82 bool b = objFunc->evaluate(patch, fval, err);
94 return objFunc->get_quality_metric_list();
120 bool rval=objFunc->compute_gradient(patch, grad, OF_val, err, array_size);
MSQ_ERRZERO(err);
121 int num_vert=patch.num_vertices();
126 for(i=0;i<num_vert;++
i){
127 grad[
i]*=scale_factor;
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.
every differentiable function should have an analytical gradient implemented.
virtual msq_std::list< QualityMetric * > get_quality_metric_list()
Returns the QualityMetric list assossiated with objFunc.
bool compute_analytical_gradient(PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size)
Implement the scalar multiply analytic gradient.
CompositeOFScalarMultiply(double, ObjectiveFunction *)
NVec< 3, double > Vector3D
#define MSQ_CHKERR(err)
Mesquite's Error Checking macro.
virtual ~CompositeOFScalarMultiply()
void set_negate_flag(int neg)
Set the value of ObjectiveFunction's negateFlag. Unless composite, concrete ObjectiveFunctions should...
int get_negate_flag()
Returns negateFlag.
virtual bool concrete_evaluate(PatchData &patch, double &fval, MsqError &err)
#define MSQ_FUNCTION_TIMER(NAME)
ObjectiveFunction * objFunc
#define MSQ_DBGOUT(flag)
Check debug flag and return ostream associated with flag.