34 #ifndef SHARK_OBJECTIVEFUNCTIONS_COMBINEDOBJECTIVEFUNCTION_H 35 #define SHARK_OBJECTIVEFUNCTIONS_COMBINEDOBJECTIVEFUNCTION_H 51 template <
typename SearchSpaceType,
typename ResultT>
67 {
return "CombinedObjectiveFunction"; }
78 void add(
double weight, element& e)
80 SHARK_RUNTIME_CHECK(weight >= 0.0,
"[CombinedObjectiveFunction::add] weight must be non-negative");
94 for ( std::size_t i=0; i<ic; i++)
101 for ( std::size_t i=0; i<
m_elements.size(); i++){
118 for (std::size_t i=1; i<ic; i++)
132 for (std::size_t i=1; i != ic; i++)
145 typename super::SecondOrderDerivative der;
148 derivative.gradient =
m_weight[0] * der.gradient;
149 derivative.hessian =
m_weight[0] * der.hessian;
150 for (std::size_t i=1; i<ic; i++)
153 derivative.gradient +=
m_weight[i] * der.gradient;
154 derivative.hessian +=
m_weight[i] * der.hessian;
169 #endif // SHARK_CORE_COBINEDOBJECTIVEFUNCTION_H