22 #ifndef mia_core_transformation_hh 23 #define mia_core_transformation_hh 43 template <
typename D,
typename I>
75 std::shared_ptr<D>
operator () (
const D&
input,
const I& ipf_override)
const;
103 virtual std::shared_ptr<D> do_transform(
const D&
input,
const I& ipf)
const = 0;
104 virtual double do_get_energy_penalty_and_gradient(
CDoubleVector& gradient)
const;
105 virtual double do_get_energy_penalty()
const;
106 virtual bool do_has_energy_penalty()
const;
119 template <
typename T>
121 static_assert(
sizeof(T) == 0,
"this needs to specialized for the handled type");
125 template <
typename D,
typename I>
132 template <
typename D,
typename I>
137 template <
typename D,
typename I>
143 template <
typename D,
typename I>
149 template <
typename D,
typename I>
152 return do_transform(input, ipf_override);
155 template <
typename D,
typename I>
158 return do_transform(input, m_ipf);
161 template <
typename D,
typename I>
164 return do_get_energy_penalty_and_gradient(gradient);
168 template <
typename D,
typename I>
171 return do_get_energy_penalty();
174 template <
typename D,
typename I>
177 std::fill(gradient.
begin(), gradient.
end(), 0.0);
182 template <
typename D,
typename I>
188 template <
typename D,
typename I>
191 return do_has_energy_penalty();
195 template <
typename D,
typename I>
201 template <
typename D,
typename I>
A wrapper around the c-array to provide an STL like interface for iterators.
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
A collection of attributes.
T load_transform(const std::string &file)
template to unify transformation loading
helper class to derive from for data that can be loaded and stored to a disk.
#define NS_MIA_END
conveniance define to end the mia namespace