Macros for adding IterQuantity objects to NLPAlgoState.


Defines

#define STATE_IQ_DECL(TYPE, NAME)
 Add class declarations for an arbitrary iteration quantity.
#define STATE_INDEX_IQ_DECL(NAME)   STATE_IQ_DECL(index_type,NAME) \
 Add class declarations for an index (i.e. index_type) iteration quantity.
#define STATE_SCALAR_IQ_DECL(NAME)   STATE_IQ_DECL(value_type,NAME) \
 Add class declarations for a scalar (i.e. value_type) iteration quantity.
#define STATE_VECTOR_IQ_DECL(NAME)   STATE_IQ_DECL(VectorMutable,NAME) \
 Add class declarations for a VectorMutable iteration quantity.
#define STATE_IQ_DEF(CLASS, TYPE, NAME, NAME_STR)
 Add class definitions for an arbitrary iteration quantity.
#define STATE_INDEX_IQ_DEF(CLASS, NAME, NAME_STR)
 Add class definitions for a index_type iteration quantity.
#define STATE_SCALAR_IQ_DEF(CLASS, NAME, NAME_STR)
 Add class definitions for a value_type iteration quantity.
#define STATE_VECTOR_IQ_DEF(CLASS, NAME, NAME_STR, VEC_SPC, VEC_RN)
 Add class definitions for a VectorMutable iteration quantity.

Detailed Description

These macros make it easy to add and remove iteration quantities of any type to the state class. These macros can even be used by subclasses of NLPAlgoState (only any IterationPack::AlgorithmState subclass) to add iteration quantities. Since scalars and vectors are so pervasive they have there own special macros that take care of actually instantiating the iteration quantities.

Define Documentation

#define STATE_IQ_DECL TYPE,
NAME   ) 
 

Value:

virtual IterQuantityAccess<TYPE>&       NAME();                       \
  virtual const IterQuantityAccess<TYPE>& NAME() const;                 \
private:                                                                  \
  iq_id_encap NAME ## _iq_id_;                                          \
public:
Add class declarations for an arbitrary iteration quantity.

Definition at line 113 of file MoochoPack_NLPAlgoState.hpp.

#define STATE_INDEX_IQ_DECL NAME   )     STATE_IQ_DECL(index_type,NAME) \
 

Add class declarations for an index (i.e. index_type) iteration quantity.

Definition at line 122 of file MoochoPack_NLPAlgoState.hpp.

#define STATE_SCALAR_IQ_DECL NAME   )     STATE_IQ_DECL(value_type,NAME) \
 

Add class declarations for a scalar (i.e. value_type) iteration quantity.

Definition at line 127 of file MoochoPack_NLPAlgoState.hpp.

#define STATE_VECTOR_IQ_DECL NAME   )     STATE_IQ_DECL(VectorMutable,NAME) \
 

Add class declarations for a VectorMutable iteration quantity.

Definition at line 132 of file MoochoPack_NLPAlgoState.hpp.

#define STATE_IQ_DEF CLASS,
TYPE,
NAME,
NAME_STR   ) 
 

Value:

IterQuantityAccess<TYPE>&                                                 \
CLASS::NAME()                                                             \
{                                                                         \
  update_iq_id( NAME_STR, &NAME ## _iq_id_ );                           \
  return IterationPack::cast_iq<TYPE>(                           \
        *this, NAME ## _iq_id_.iq_id, NAME_STR );                         \
}                                                                         \
const IterQuantityAccess<TYPE>&                                           \
CLASS::NAME() const                                                       \
{                                                                         \
  return const_cast<CLASS*>(this)->NAME();                              \
}
Add class definitions for an arbitrary iteration quantity.

This implementation can not instantate the underlying iteration quantity so it is the responsibility of some client to do this. This implementation just initializes the iq_id for the iteration quantity on the fly and then casts the iteration quantity.

Definition at line 142 of file MoochoPack_NLPAlgoState.hpp.

#define STATE_INDEX_IQ_DEF CLASS,
NAME,
NAME_STR   ) 
 

Value:

IterQuantityAccess<index_type>&                                           \
CLASS::NAME()                                                             \
{                                                                         \
  update_index_type_iq_id( NAME_STR, &NAME ## _iq_id_ );                \
  return IterationPack::cast_iq<index_type>(                     \
        *this, NAME ## _iq_id_.iq_id, NAME_STR );                         \
}                                                                         \
const IterQuantityAccess<index_type>&                                     \
CLASS::NAME() const                                                       \
{                                                                         \
  return const_cast<CLASS*>(this)->NAME();                              \
}
Add class definitions for a index_type iteration quantity.

This implementation will instantiate the IterQuantity object on the fly.

Definition at line 160 of file MoochoPack_NLPAlgoState.hpp.

#define STATE_SCALAR_IQ_DEF CLASS,
NAME,
NAME_STR   ) 
 

Value:

IterQuantityAccess<value_type>&                                           \
CLASS::NAME()                                                             \
{                                                                         \
  update_value_type_iq_id( NAME_STR, &NAME ## _iq_id_ );                \
  return IterationPack::cast_iq<value_type>(                     \
        *this, NAME ## _iq_id_.iq_id, NAME_STR );                         \
}                                                                         \
const IterQuantityAccess<value_type>&                                     \
CLASS::NAME() const                                                       \
{                                                                         \
  return const_cast<CLASS*>(this)->NAME();                              \
}
Add class definitions for a value_type iteration quantity.

This implementation will instantiate the IterQuantity object on the fly.

Definition at line 178 of file MoochoPack_NLPAlgoState.hpp.

#define STATE_VECTOR_IQ_DEF CLASS,
NAME,
NAME_STR,
VEC_SPC,
VEC_RN   ) 
 

Value:

IterQuantityAccess<VectorMutable>&                                  \
CLASS::NAME()                                                             \
{                                                                         \
    update_vector_iq_id( NAME_STR, VEC_SPC, VEC_RN, &NAME ## _iq_id_ );   \
  return IterationPack::cast_iq<VectorMutable>(            \
        *this, NAME ## _iq_id_.iq_id, NAME_STR );                         \
}                                                                         \
const IterQuantityAccess<VectorMutable>&                            \
CLASS::NAME() const                                                       \
{                                                                         \
  return const_cast<CLASS*>(this)->NAME();                          \
}
Add class definitions for a VectorMutable iteration quantity.

This implementation will instantiate the IterQuantity object on the fly given the VectorSpace (VEC_SPC). Note that this VEC_SPC can be any code that will returns a smart pointer to a AbstractFactory<VectorMutable> object from within the class body. It is best if VEC_SPC is some function that is called on *this for the maximum safety and to avoid strage behavior.

Definition at line 201 of file MoochoPack_NLPAlgoState.hpp.


Generated on Thu Sep 18 12:36:06 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1