Go to the documentation of this file.
8 #ifndef FIELDS2COVER_OBJECTIVES_BASE_OBJECTIVE_H_
9 #define FIELDS2COVER_OBJECTIVES_BASE_OBJECTIVE_H_
25 template <
typename T1>
27 return (
static_cast<T*
>(
this)->
isMinimizing() ? 1.0 : -1.0) *
28 static_cast<T*
>(
this)->computeCost(t1);
30 template <
typename T1,
typename T2>
32 return (
static_cast<T*
>(
this)->
isMinimizing() ? 1.0 : -1.0) *
33 static_cast<T*
>(
this)->computeCost(t1, t2);
35 template <
typename T1,
typename T2,
typename T3>
37 const T1& t1,
const T2& t2,
const T3& t3) {
38 return (
static_cast<T*
>(
this)->
isMinimizing() ? 1.0 : -1.0) *
39 static_cast<T*
>(
this)->computeCost(t1, t2, t3);
41 template <
typename T1,
typename T2,
typename T3,
typename T4>
43 const T1& t1,
const T2& t2,
const T3& t3,
const T4& t4) {
44 return (
static_cast<T*
>(
this)->
isMinimizing() ? 1.0 : -1.0) *
45 static_cast<T*
>(
this)->computeCost(t1, t2, t3, t4);
60 #endif // FIELDS2COVER_OBJECTIVES_BASE_OBJECTIVE_H_
virtual ~BaseObjective()=default
double computeCostWithMinimizingSign(const T1 &t1, const T2 &t2, const T3 &t3)
Objective algorithms' namespace.
virtual bool isMaximizing() const
Return true if the objective is to maximize the cost function.
double computeCostWithMinimizingSign(const T1 &t1, const T2 &t2)
double computeCostWithMinimizingSign(const T1 &t1)
Compute the cost function with minimizing sign.
virtual bool isMinimizing() const
Return true if the objective is to minimize the cost function.
double computeCostWithMinimizingSign(const T1 &t1, const T2 &t2, const T3 &t3, const T4 &t4)
fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31