STIR  6.2.0
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
stir::SumOfGeneralisedObjectiveFunctions< ObjFuncT, TargetT, ParentT > Class Template Reference

A base class for sums of 'generalised' objective functions, i.e. objective functions for which at least a 'gradient' is defined. More...

#include "stir/recon_buildblock/SumOfGeneralisedObjectiveFunctions.h"

Inheritance diagram for stir::SumOfGeneralisedObjectiveFunctions< ObjFuncT, TargetT, ParentT >:
Inheritance graph
[legend]

Public Member Functions

template<typename IterT >
 SumOfGeneralisedObjectiveFunctions (IterT begin, IterT end)
 
template<typename IterT >
void set_functions (IterT begin, IterT end)
 
virtual Succeeded set_up (shared_ptr< TargetT > const &target_sptr)
 Has to be called before using this object. More...
 
virtual void compute_sub_gradient_without_penalty (TargetT &gradient, const TargetT &current_estimate, const int subset_num)
 This computes the gradient of the unregularised objective function at the current_estimate. More...
 
virtual double actual_compute_objective_function_without_penalty (const TargetT &current_estimate, const int subset_num)
 
virtual int set_num_subsets (const int num_subsets)
 Attempts to change the number of subsets. More...
 

Protected Types

typedef std::vector< ObjFuncT > _functions_type
 
typedef _functions_type::iterator _functions_iterator_type
 
typedef _functions_type::const_iterator _functions_const_iterator_type
 

Protected Member Functions

virtual bool actual_subsets_are_approximately_balanced (std::string &warning_message) const
 Implementation of function that checks subset balancing. More...
 

Protected Attributes

_functions_type _functions
 

Detailed Description

template<typename ObjFuncT, typename TargetT, typename ParentT = GeneralisedObjectiveFunction<TargetT>>
class stir::SumOfGeneralisedObjectiveFunctions< ObjFuncT, TargetT, ParentT >

A base class for sums of 'generalised' objective functions, i.e. objective functions for which at least a 'gradient' is defined.

Todo:

document why use of ParentT template

doc subsets

Member Function Documentation

◆ set_up()

template<typename ObjFuncT , typename TargetT, typename Parent >
Succeeded stir::SumOfGeneralisedObjectiveFunctions< ObjFuncT, TargetT, Parent >::set_up ( shared_ptr< TargetT > const &  target_sptr)
inlinevirtual

Has to be called before using this object.

Will call set_up() for all terms in the sum, but will stop as soon as one set_up() fails.

◆ compute_sub_gradient_without_penalty()

template<typename ObjFuncT , typename TargetT, typename Parent >
void stir::SumOfGeneralisedObjectiveFunctions< ObjFuncT, TargetT, Parent >::compute_sub_gradient_without_penalty ( TargetT &  gradient,
const TargetT &  current_estimate,
const int  subset_num 
)
inlinevirtual

This computes the gradient of the unregularised objective function at the current_estimate.

It is computed as the sum of the subgradients for each term, depending on the subset scheme.

Referenced by stir::SumOfGeneralisedObjectiveFunctions< PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >, TargetT, PoissonLogLikelihoodWithLinearModelForMean< TargetT > >::compute_sub_gradient_without_penalty().

◆ set_num_subsets()

template<typename ObjFuncT , typename TargetT , typename Parent >
int stir::SumOfGeneralisedObjectiveFunctions< ObjFuncT, TargetT, Parent >::set_num_subsets ( const int  num_subsets)
inlinevirtual

Attempts to change the number of subsets.

Returns
The number of subsets that will be used later, which is not guaranteed to be what you asked for.

Reimplemented in stir::PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion< TargetT >.

◆ actual_subsets_are_approximately_balanced()

template<typename ObjFuncT , typename TargetT , typename Parent >
bool stir::SumOfGeneralisedObjectiveFunctions< ObjFuncT, TargetT, Parent >::actual_subsets_are_approximately_balanced ( std::string &  warning_message) const
inlineprotectedvirtual

Implementation of function that checks subset balancing.

Todo:
doc subset

Reimplemented in stir::PoissonLogLikelihoodWithLinearModelForMeanAndGatedProjDataWithMotion< TargetT >.


The documentation for this class was generated from the following files: