42 #ifndef ALGORITHM_STATE_H
43 #define ALGORITHM_STATE_H
55 namespace IterationPack {
108 {
public:
DoesNotExist(
const std::string& what_arg) : std::logic_error(what_arg) {}};
112 {
public:
AlreadyExists(
const std::string& what_arg) : std::logic_error(what_arg) {}};
259 typedef std::vector<IQ_ptr>
iq_t;
276 #ifdef DOXYGEN_COMPILE
289 iq_name_to_id_t::const_iterator
find_and_assert(
const std::string& iq_name)
const;
299 {
iq_.reserve(reserve_size); }
324 const std::string& iq_name)
const
326 const iq_name_to_id_t::const_iterator itr =
iq_name_to_id_.find(iq_name);
332 return iq_.at(iq_id);
339 return iq_.at(iq_id);
354 #endif // ALGORITHM_STATE_H
Teuchos::RCP< IterQuantity > IQ_ptr
IterQuantity * iteration_quantities
AlgorithmState(size_t reserve_size=0)
Construct with an initial guess for the number of iteration quantities.
virtual size_t num_iter_quant() const
Return the number of iteration quantities.
virtual void erase_iter_quant(const std::string &iq_name)
Removes the iteration quantity with name iq_name.
iq_name_to_id_t::iterator find_and_assert(const std::string &iq_name)
Thrown if name or id does not exist.
virtual void dump_iter_quant(std::ostream &out) const
iteration quantity information dumping.
virtual IQ_ptr & get_iter_quant(iq_id_type iq_id)
Returns the RCP<...> for the iteration quantiy with iq_id.
std::vector< IQ_ptr > iq_t
virtual iq_id_type set_iter_quant(const std::string &iq_name, const IQ_ptr &iq)
Inserts the iteration quantity through a RCP<...> object.
Iterface for information about Iteration Quantities.
virtual ~AlgorithmState()
virtual IterQuantity & iter_quant(const std::string &iq_name)
Iteration quantity encapsulation object access with via iq_name.
DoesNotExist(const std::string &what_arg)
Abstacts a set of iteration quantities for an iterative algorithm.
virtual iq_id_type get_iter_quant_id(const std::string &iq_name) const
Return the iteration quantity id (iq_id) for the iteration quantity.
AlreadyExists(const std::string &what_arg)
iq_name_to_id_t iq_name_to_id_
std::map< std::string, iq_id_type > iq_name_to_id_t
Thrown if name already exists.
virtual void next_iteration(bool incr_k=true)
iteration quantity forwarding.