MOOCHO (Single Doxygen Collection)
Version of the Day
|
Iteration Quanities subclass for contiguous iterations. More...
#include <IterationPack_IterQuantityAccessContiguousDecl.hpp>
Public Types | |
typedef IterQuantityAccess < T_info > | base_t |
typedef Teuchos::RCP< const Teuchos::AbstractFactory < T_info > > | abstract_factory_ptr_t |
typedef Teuchos::AbstractFactoryStd < T_info, T_info > | abstract_factory_std_t |
Public Types inherited from IterationPack::IterQuantityAccess< T_info > | |
typedef IterQuantity::NoStorageAvailable | NoStorageAvailable |
typedef IterQuantity::QuanityNotSet | QuanityNotSet |
Public Types inherited from IterationPack::IterQuantity | |
enum | { NONE_UPDATED = INT_MIN } |
Constant for value returned when no iteration quantity has been updated. More... | |
Private Types | |
typedef std::vector< bool > | updated_t |
typedef std::vector< typename abstract_factory_ptr_t::element_type::obj_ptr_t > | store_t |
typedef std::vector< T_info * > | quantities_t |
Private Member Functions | |
bool | is_initialized () const |
void | lazy_initialization () |
void | release_mem () |
IterQuantityAccessContiguous () | |
IterQuantityAccessContiguous (const IterQuantityAccessContiguous &) | |
IterQuantityAccessContiguous & | operator= (const IterQuantityAccessContiguous &) |
Private Attributes | |
int | num_quantities_ |
std::string | name_ |
abstract_factory_ptr_t | abstract_factory_ |
int | max_offset_ |
updated_t | updated_ |
store_t | store_ |
quantities_t | quantities_ |
Constructors/initalizers | |
IterQuantityAccessContiguous (int num_quantities, const std::string &name, const abstract_factory_ptr_t &abstract_factory=Teuchos::rcp(new abstract_factory_std_t())) | |
Construct storage for num_quantities with the name name given an abstract factory. More... | |
void | set_factory (const abstract_factory_ptr_t &abstract_factory) |
Set the abstract factory to use to allocate storate. More... | |
void | resize (int num_quantities) |
Resize the number of contiguous storage locations. More... | |
~IterQuantityAccessContiguous () | |
Access | |
int | num_quantities () const |
Return the number of continous storage locations. More... | |
Overridden from IterQuantity | |
IterQuantity * | clone () const |
const char * | name () const |
bool | has_storage_k (int offset) const |
bool | updated_k (int offset) const |
int | last_updated () const |
void | set_not_updated_k (int offset) |
void | set_all_not_updated () |
bool | will_loose_mem (int offset, int set_offset) const |
void | next_iteration () |
void | print_concrete_type (std::ostream &out) const |
Overridden from IterQuantityAccess | |
T_info & | get_k (int offset) |
const T_info & | get_k (int offset) const |
T_info & | set_k (int offset) |
T_info & | set_k (int set_offset, int get_offset) |
Additional Inherited Members | |
Public Member Functions inherited from IterationPack::IterQuantity | |
virtual | ~IterQuantity () |
void | assert_has_storage_k (int offset) const |
Assert has_storage_k(offset) == true (throw NoStorageAvailable ). More... | |
void | assert_updated_k (int offset) const |
Assert updated_k(offset) == true (throw QuanityNotSet). More... | |
Iteration Quanities subclass for contiguous iterations.
This class implements the IterQuantityAccess interface for the case where storage is provided for consecutive iterations. This class allows the number of iterations to be variable on construction. For 3 storage locations, this class could provide memory for the intervals [k-5, k-4, k-3], or [k-1, k, k+1] or [k+1, k+2, k+3] etc. The particular interval being represented is dependent on the sequence in which set_k(offset)
and next_iteration()
are called. The only rule is that backward interation is not allowed. For example, if the [k, k+1] interval is being represented then set_k(-1)
will throw an exception but set_k(+5)
would not. Backward memory is keep as long as possible and is only changed by set_k()
. For example, if the range [k-1, k] is being represented and set_k(+1)
is called, the interval [k, k+1] is now represented and the value for the kth iteration is still keep but the value for the k-1 iteration is lost. This could have been determined a priori by calling will_loose_mem()
.
The default constructor, copy constructor and assignment operators are not not allowed (i.e. declared private).
Definition at line 86 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
typedef IterQuantityAccess<T_info> IterationPack::IterQuantityAccessContiguous< T_info >::base_t |
Definition at line 90 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
typedef Teuchos::RCP< const Teuchos::AbstractFactory<T_info> > IterationPack::IterQuantityAccessContiguous< T_info >::abstract_factory_ptr_t |
Definition at line 94 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
typedef Teuchos::AbstractFactoryStd<T_info,T_info> IterationPack::IterQuantityAccessContiguous< T_info >::abstract_factory_std_t |
Definition at line 96 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 203 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 205 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 207 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
IterationPack::IterQuantityAccessContiguous< T_info >::IterQuantityAccessContiguous | ( | int | num_quantities, |
const std::string & | name, | ||
const abstract_factory_ptr_t & | abstract_factory = Teuchos::rcp(new abstract_factory_std_t()) |
||
) |
Construct storage for num_quantities
with the name name
given an abstract factory.
After construction this->set_k(offset)
can be called for any offset
in the range of legal integers.
Preconditions:
num_quantities > 0
(throw std::length_error) If abstract_factory.get()
== NULL then the client had better call this->set_factory()
with an non-NULL factory before any attempt is made to call get_k()
or set_k()
or an exception will be thrown.
Definition at line 59 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
IterationPack::IterQuantityAccessContiguous< T_info >::~IterQuantityAccessContiguous | ( | ) |
Definition at line 73 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
private |
|
private |
void IterationPack::IterQuantityAccessContiguous< T_info >::set_factory | ( | const abstract_factory_ptr_t & | abstract_factory | ) |
Set the abstract factory to use to allocate storate.
Postconditions:
this
will become uninitialized and current memory will be wipped out. If abstract_factory.get()
== NULL then the client had better call this->set_factory()
again later with a non-NULL factory before any attempt is made to call get_k()
or set_k()
or an exception will be thrown.
Definition at line 78 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
void IterationPack::IterQuantityAccessContiguous< T_info >::resize | ( | int | num_quantities | ) |
Resize the number of contiguous storage locations.
Postconditions:
this
will become uninitialized and current memory will be wipped out. Definition at line 92 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
inline |
Return the number of continous storage locations.
Definition at line 258 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 106 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 114 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 119 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 126 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 135 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 150 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 156 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 162 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 168 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantity.
Definition at line 175 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantityAccess< T_info >.
Definition at line 189 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantityAccess< T_info >.
Definition at line 194 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantityAccess< T_info >.
Definition at line 200 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
virtual |
Implements IterationPack::IterQuantityAccess< T_info >.
Definition at line 265 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
private |
Definition at line 273 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
private |
Definition at line 278 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
private |
Definition at line 303 of file IterationPack_IterQuantityAccessContiguousDef.hpp.
|
private |
|
private |
Definition at line 213 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 215 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 217 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 222 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 227 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 229 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.
|
private |
Definition at line 231 of file IterationPack_IterQuantityAccessContiguousDecl.hpp.