37 #ifndef LPtoPTemplate_hpp
38 #define LPtoPTemplate_hpp
114 double scale_factor=1.0;
121 scale_factor/=total_num;
126 double total_value=0;
127 for(ind=0;ind<total_num;++ind){
129 for(jnd=0;jnd<
pVal;++jnd){
130 temp_value*=metric_values[ind];
132 total_value+=(scale_factor*temp_value);
139 #endif // LPtoPTemplate_hpp
virtual bool compute_analytical_hessian(PatchData &patch, MsqHessian &hessian, Vector3D *const &grad, double &OF_val, MsqError &err)
short pVal
The metric value entries are raised to the pVal power.
double compute_function(double metric_values[], size_t total_num, MsqError &err)
Calculates the L_p objective function raised to the pth power. That is, sums the p_th powers of (the ...
Used to hold the error state and return it to the application.
Base class for concrete quality metrics.
virtual bool concrete_evaluate(PatchData &patch, double &fval, MsqError &err)
Vector3D is the object that effeciently stores information about about three-deminsional vectors...
Vector3D is the object that effeciently stores the objective function Hessian each entry is a Matrix3...
invalid function argument passed
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
LPtoPTemplate(QualityMetric *, short, MsqError &)
virtual bool compute_analytical_gradient(PatchData &patch, Vector3D *const &grad, double &OF_val, MsqError &err, size_t array_size)
Base class for concrete Objective Functions ObjectiveFunction contains a pointer to a QualityMetric...
bool dividingByN
dividingByN is true if we are dividing the objective function by the number of metric values...
void set_dividing_by_n(bool d_bool)