11 #ifndef CGRADIENTRESULT_H_
12 #define CGRADIENTRESULT_H_
31 m_parameter_dictionary=NULL;
44 virtual const char*
get_name()
const {
return "GradientResult"; }
57 "Provided evaluation result is not of type CGradientResult!\n")
75 REQUIRE(m_gradient,
"Gradient map should not be NULL\n")
76 REQUIRE(m_parameter_dictionary,
"Parameter dictionary should not be "
95 CMapNode<TParameter*, SGVector<float64_t> >* param_node=
99 const char* param_name=param_node->key->m_name;
102 const char* object_name=
108 SG_PRINT(
"%s.%s: ", object_name, param_name)
115 if (param_gradient.
vlen>0)
120 if (param_gradient.
vlen>0)
125 SG_SPRINT(
"] Total Variables: %u\n", m_total_variables)
134 return m_total_variables;
161 REQUIRE(gradient,
"Gradient map should not be NULL\n")
169 for (
index_t i=0; i<gradient->get_num_elements(); i++)
171 CMapNode<TParameter*, SGVector<float64_t> >*
node=
173 m_total_variables+=node->data.vlen;
194 SG_REF(parameter_dictionary);
196 m_parameter_dictionary=parameter_dictionary;
205 SG_REF(m_parameter_dictionary);
206 return m_parameter_dictionary;
220 uint32_t m_total_variables;