21#ifndef __stir_recon_buildblock_GeneralisedPrior_H__
22#define __stir_recon_buildblock_GeneralisedPrior_H__
41template <
typename DataT>
42class GeneralisedPrior :
public RegisteredObject<GeneralisedPrior<DataT>>
46 inline GeneralisedPrior();
57 virtual void compute_gradient(DataT& prior_gradient,
const DataT& current_estimate) = 0;
78 const DataT& current_image_estimate)
const;
105 inline float get_penalisation_factor()
const;
116 float penalisation_factor;
125 virtual void check(DataT
const& current_estimate)
const;
127 bool _already_set_up;
Inline implementations for class stir::GeneralisedPrior.
Declaration of class stir::ParsingObject.
Declaration of class stiir::RegisteredObject.
Declaration of class stir::Succeeded.
class BasicCoordinate<int num_dimensions, typename coordT> defines num_dimensions -dimensional coordi...
Definition BasicCoordinate.h:57
virtual double compute_gradient_times_input(const DataT &input, const DataT ¤t_estimate)
compute the dot product of the gradient of the log of the prior function at the current_estimate with...
Definition GeneralisedPrior.inl:71
virtual void compute_Hessian(DataT &prior_Hessian_for_single_densel, const BasicCoordinate< 3, int > &coords, const DataT ¤t_image_estimate) const
This computes a single row of the Hessian.
Definition GeneralisedPrior.inl:79
void set_penalisation_factor(float new_penalisation_factor)
Definition GeneralisedPrior.inl:41
virtual void add_multiplication_with_approximate_Hessian(DataT &output, const DataT &input) const
This should compute the multiplication of the Hessian with a vector and add it to output.
Definition GeneralisedPrior.inl:98
virtual Succeeded set_up(shared_ptr< const DataT > const &target_sptr)
Has to be called before using this object.
Definition GeneralisedPrior.inl:63
virtual void compute_Hessian_diagonal(DataT &Hessian_diagonal, const DataT ¤t_estimate) const
This computes the diagonal of the Hessian of the log of the prior function at the current_estimate an...
Definition GeneralisedPrior.inl:91
virtual void check(DataT const ¤t_estimate) const
Check that the prior is ready to be used.
Definition GeneralisedPrior.inl:116
virtual void compute_gradient(DataT &prior_gradient, const DataT ¤t_estimate)=0
This should compute the gradient of the log of the prior function at the current_estimate.
void initialise_keymap() override
sets key for penalisation factor
Definition GeneralisedPrior.inl:48
virtual void accumulate_Hessian_times_input(DataT &output, const DataT ¤t_estimate, const DataT &input) const
This should compute the multiplication of the Hessian with a vector and add it to output.
Definition GeneralisedPrior.inl:106
void set_defaults() override
sets value for penalisation factor
Definition GeneralisedPrior.inl:55
virtual bool is_convex() const =0
Indicates if the prior is a smooth convex function.
virtual double compute_value(const DataT ¤t_estimate)=0
compute the value of the function
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44