#include <IterationPack_AlgorithmState.hpp>
Public types | |
| typedef size_t | iq_id_type |
| | |
| typedef Teuchos::RefCountPtr< IterQuantity > | IQ_ptr |
| | |
| enum | |
| More... | |
Constructors | |
| AlgorithmState (size_t reserve_size=0) | |
| Construct with an initial guess for the number of iteration quantities. | |
Iteration counter | |
| void | k (int k) |
| | |
| int | k () const |
| | |
| int | incr_k () |
| | |
Iteration quantity setup | |
| virtual size_t | num_iter_quant () const |
| Return the number of iteration quantities. | |
| virtual iq_id_type | set_iter_quant (const std::string &iq_name, const IQ_ptr &iq) |
| Inserts the iteration quantity through a RefCountPtr<...> object. | |
| virtual void | erase_iter_quant (const std::string &iq_name) |
| Removes the iteration quantity with name iq_name. | |
| 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. | |
| virtual IQ_ptr & | get_iter_quant (iq_id_type iq_id) |
| Returns the RefCountPtr<...> for the iteration quantiy with iq_id. | |
| virtual const IQ_ptr & | get_iter_quant (iq_id_type iq_id) const |
| | |
Iteration quantity access | |
| virtual IterQuantity & | iter_quant (const std::string &iq_name) |
| Iteration quantity encapsulation object access with via iq_name. | |
| virtual const IterQuantity & | iter_quant (const std::string &iq_name) const |
| | |
| virtual IterQuantity & | iter_quant (iq_id_type iq_id) |
| Iteration quantity encapsulation object access via iq_id. | |
| virtual const IterQuantity & | iter_quant (iq_id_type iq_id) const |
| | |
Iteration incrementation | |
| virtual void | next_iteration (bool incr_k=true) |
| iteration quantity forwarding. | |
Miscellaneous | |
| virtual void | dump_iter_quant (std::ostream &out) const |
| iteration quantity information dumping. | |
Public Member Functions | |
| virtual | ~AlgorithmState () |
| | |
This object encapsulates a set of iteration quantity access objects. The concrete types of the IterQuantity objects are expected to be subclasses of IterQuantityAccess. It is therefore up the the clients to determine the concrete types of these iteration quantity access objects and to use dynamic_cast<...> (or static_cast<...> if you are sure) to access the IterQuantityAccess<...> object and therefore the iteration quantities themselves. Each iteration quantity (IQ) access object must have a unique name associated with it. IQ objects are given to the state object by clients through the set_iter_quant() method at which point the IQ object will be given a unique id that will never change change until the IQ object is removed using erase_iter_quant(). Memory management is performed using the Teuchos::RefCountPtr smart reference counting poiner class. The id of any IQ object (iq_id) can be obtained from its name by calling iq_id = get_iter_quant_id(iq_name). If an IQ object with the name iq_name does not exist then get_iter_quant_id(iq_name) will return DOES_NOT_EXIST. The IQ objects themselves can be accesed in O(log(num_iter_quant())) time using iter_quant(iq_name) or in O(1) time using iter_quant(iq_id). Therefore, the access of IQ objects using iq_id is an optimization for faster access and the client should never have to lookup iq_name given iq_id. The mapping only works from iq_name to iq_id, not the other way around. It is guaranteed that as long as erase_iter_quant(iq_id) is not called that each iq_id that &iter_quant(iq_id) == &iter_quant( get_iter_quant(iq_name) ) will true. For iq_name, if get_iter_quant_id(iq_name) == DOES_NOT_EXIST then iter_quant(iq_name) will throw the exception DoesNotExist.
The next_iteration() operation is called by the algorithm to call next_iteration() on each of the IQ objects.
The dump_iter_quant(out) operation prints out a list of all of the IQ objects of thier iq_name, iq_name and concrete type.
The default copy constructor, and assignment operator functions are allowed since they have the proper semantics.
Definition at line 80 of file IterationPack_AlgorithmState.hpp.
|
|
Definition at line 87 of file IterationPack_AlgorithmState.hpp. |
|
|
Definition at line 89 of file IterationPack_AlgorithmState.hpp. |
|
|
Definition at line 91 of file IterationPack_AlgorithmState.hpp. |
|
|
Definition at line 104 of file IterationPack_AlgorithmState.hpp. |
|
|
Construct with an initial guess for the number of iteration quantities. The iteration counter k is default constructed to zero. Definition at line 284 of file IterationPack_AlgorithmState.hpp. |
|
|
Definition at line 291 of file IterationPack_AlgorithmState.hpp. |
|
|
Definition at line 295 of file IterationPack_AlgorithmState.hpp. |
|
|
Definition at line 299 of file IterationPack_AlgorithmState.hpp. |
|
|
Return the number of iteration quantities.
Definition at line 305 of file IterationPack_AlgorithmState.hpp. |
|
||||||||||||
|
Inserts the iteration quantity through a RefCountPtr<...> object. Time = O(log(num_iter_quant)), Space = O(1).
If an iteration quantity already exists with the name Preconditions:
Definition at line 48 of file IterationPack_AlgorithmState.cpp. |
|
|
Removes the iteration quantity with name iq_name. Time = O(log(num_iter_quant)), Space = O(1).
If Preconditions:
Definition at line 67 of file IterationPack_AlgorithmState.cpp. |
|
|
Return the iteration quantity id (iq_id) for the iteration quantity.
If an iteration quantity with the name Time = O(log(num_iter_quant)), Space = O(1). Definition at line 310 of file IterationPack_AlgorithmState.hpp. |
|
|
Returns the RefCountPtr<...> for the iteration quantiy with iq_id. If this iq_id does not correspond to a valid iteration quantity object then a DoesNotExist exception will be thrown. If iq_id was returned from get_iter_quant_id(iq_name), this iq_id may become invalid if a client called erase_iter_quant(iq_name) in the mean time. Time = O(1), Space = O(1). Definition at line 318 of file IterationPack_AlgorithmState.hpp. |
|
|
Definition at line 323 of file IterationPack_AlgorithmState.hpp. |
|
|
Iteration quantity encapsulation object access with via iq_name. Time = O(log(num_iter_quant())), Space = O(1). Preconditions:
Definition at line 330 of file IterationPack_AlgorithmState.hpp. |
|
|
Definition at line 335 of file IterationPack_AlgorithmState.hpp. |
|
|
Iteration quantity encapsulation object access via iq_id. Time = O(1), Space = O(1).
If the IQ object with iq_id does not exist then a Definition at line 74 of file IterationPack_AlgorithmState.cpp. |
|
|
Definition at line 99 of file IterationPack_AlgorithmState.cpp. |
|
|
iteration quantity forwarding.
Definition at line 103 of file IterationPack_AlgorithmState.cpp. |
|
|
iteration quantity information dumping. This function outputs a list with columns: iq_name iq_id concrete type for each iteration quantity object. Definition at line 109 of file IterationPack_AlgorithmState.cpp. |
1.3.9.1