STIR 6.4.0
SumOfGeneralisedObjectiveFunctions.h
Go to the documentation of this file.
1//
2//
3/*
4 Copyright (C) 2005- 2008, Hammersmith Imanet
5 This file is part of STIR.
6
7 SPDX-License-Identifier: Apache-2.0
8
9 See STIR/LICENSE.txt for details
10*/
19
20#ifndef __stir_recon_buildblock_SumOfGeneralisedObjectiveFunctions_H__
21#define __stir_recon_buildblock_SumOfGeneralisedObjectiveFunctions_H__
22
23#include "stir/shared_ptr.h"
25#include <vector>
26
27START_NAMESPACE_STIR
28
37template <typename ObjFuncT, typename TargetT, typename ParentT = GeneralisedObjectiveFunction<TargetT>>
38class SumOfGeneralisedObjectiveFunctions : public ParentT
39{
40 typedef ParentT base_type;
41 typedef SumOfGeneralisedObjectiveFunctions<ObjFuncT, TargetT, ParentT> self_type;
42
43public:
44 inline SumOfGeneralisedObjectiveFunctions();
45
46 template <typename IterT>
47 inline SumOfGeneralisedObjectiveFunctions(IterT begin, IterT end);
48
49 inline virtual ~SumOfGeneralisedObjectiveFunctions();
50
51 template <typename IterT>
52 inline void set_functions(IterT begin, IterT end);
53
54#if 0
56
59 inline virtual
60 TargetT *
62#endif
63
65
68 inline virtual Succeeded set_up(shared_ptr<TargetT> const& target_sptr);
69
71
73 inline virtual void
74 compute_sub_gradient_without_penalty(TargetT& gradient, const TargetT& current_estimate, const int subset_num);
75
76 inline virtual double actual_compute_objective_function_without_penalty(const TargetT& current_estimate, const int subset_num);
77
79
81 inline virtual int set_num_subsets(const int num_subsets);
82
83protected:
84 typedef std::vector<ObjFuncT> _functions_type;
85 typedef typename _functions_type::iterator _functions_iterator_type;
86 typedef typename _functions_type::const_iterator _functions_const_iterator_type;
87 _functions_type _functions;
89
92 inline virtual bool actual_subsets_are_approximately_balanced(std::string& warning_message) const;
93};
94
95END_NAMESPACE_STIR
96
98
99#endif
Declaration of class stir::GeneralisedObjectiveFunction.
Implementation of class stir::SumOfGeneralisedObjectiveFunctions.
virtual TargetT * construct_target_ptr() const =0
Creates a suitable target as determined by the parameters.
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
virtual Succeeded set_up(shared_ptr< TargetT > const &target_sptr)
Has to be called before using this object.
Definition SumOfGeneralisedObjectiveFunctions.inl:64
virtual int set_num_subsets(const int num_subsets)
Attempts to change the number of subsets.
Definition SumOfGeneralisedObjectiveFunctions.inl:114
virtual double actual_compute_objective_function_without_penalty(const TargetT &current_estimate, const int subset_num)
Implementation of function that computes the objective function for the current subset.
Definition SumOfGeneralisedObjectiveFunctions.inl:97
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.
Definition SumOfGeneralisedObjectiveFunctions.inl:82
virtual bool actual_subsets_are_approximately_balanced(std::string &warning_message) const
Implementation of function that checks subset balancing.
Definition SumOfGeneralisedObjectiveFunctions.inl:131
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...