Index: kernel/include/IMP/score_states/MaxChangeScoreState.h =================================================================== --- kernel/include/IMP/score_states/MaxChangeScoreState.h (revision 385) +++ kernel/include/IMP/score_states/MaxChangeScoreState.h (working copy) @@ -25,8 +25,6 @@ Particles ps_; float max_change_; public: - IMP_LIST(Particle, particle, Particle*); - MaxChangeScoreState(const FloatKeys &keys):keys_(keys){} virtual ~MaxChangeScoreState(){} @@ -38,6 +36,7 @@ return max_change_; } + IMP_LIST(public, Particle, particle, Particle*); }; } // namespace IMP Index: kernel/include/IMP/Restraint.h =================================================================== --- kernel/include/IMP/Restraint.h (revision 385) +++ kernel/include/IMP/Restraint.h (working copy) @@ -29,12 +29,6 @@ and then various functions which are applied to the tuples. */ -/** \defgroup restraint General purpose restraints - Classes to define and help in defining restraints. The restraints - typically involve a Restraint which defines the set of tuples of Particles - and then various functions which are applied to the tuples. - */ - //! Abstract class for representing restraints class IMPDLLEXPORT Restraint : public Object { @@ -81,8 +75,7 @@ return model_; } -protected: - IMP_LIST(Particle, particle, Particle*) + IMP_LIST(protected, Particle, particle, Particle*) private: Model* model_; Index: kernel/include/IMP/optimizers/MonteCarlo.h =================================================================== --- kernel/include/IMP/optimizers/MonteCarlo.h (revision 385) +++ kernel/include/IMP/optimizers/MonteCarlo.h (working copy) @@ -23,6 +23,8 @@ accepted or rejected based on the Metropolis criteria. Optionally, a number of local optimization steps are taken before the step is accepted or rejected. + + \ingroup optimizer */ class IMPDLLEXPORT MonteCarlo: public Optimizer { Index: kernel/include/IMP/optimizers/movers/NormalMover.h =================================================================== --- kernel/include/IMP/optimizers/movers/NormalMover.h (revision 385) +++ kernel/include/IMP/optimizers/movers/NormalMover.h (working copy) @@ -17,7 +17,8 @@ //! Modify a set of continuous variables. /** The variables are perturbed within a ball of the - given radius. + given radius. + \ingroup mover */ class IMPDLLEXPORT NormalMover :public MoverBase { Index: kernel/include/IMP/optimizers/movers/BallMover.h =================================================================== --- kernel/include/IMP/optimizers/movers/BallMover.h (revision 385) +++ kernel/include/IMP/optimizers/movers/BallMover.h (working copy) @@ -17,7 +17,8 @@ //! Modify a set of continuous variables. /** The variables are perturbed within a ball of the - given radius. + given radius. + \ingroup mover */ class IMPDLLEXPORT BallMover :public MoverBase { Index: kernel/include/IMP/optimizers/Mover.h =================================================================== --- kernel/include/IMP/optimizers/Mover.h (revision 385) +++ kernel/include/IMP/optimizers/Mover.h (working copy) @@ -21,8 +21,14 @@ class Mover; typedef Index MoverIndex; +/** \ingroup optimizer + \addtogroup mover Monte Carlo movers + Classes which move particles around. Currently used + for MonteCarlo optimization. + */ + //! A class to make a monte carlo move. -/** You probably want to use MoverBase if you are implementing a Mover. . +/** You probably want to use MoverBase if you are implementing a Mover. */ class IMPDLLEXPORT Mover: public Object { Index: kernel/include/IMP/Optimizer.h =================================================================== --- kernel/include/IMP/Optimizer.h (revision 385) +++ kernel/include/IMP/Optimizer.h (working copy) @@ -63,8 +63,8 @@ IMP_CONTAINER(OptimizerState, optimizer_state, OptimizerStateIndex); protected: - //! Update optimizer state, at each successful step - void update_state(); + //! Update optimizer state, should be called at each successful step + void update_states(); private: Model *model_; Index: kernel/include/IMP/macros.h =================================================================== --- kernel/include/IMP/macros.h (revision 385) +++ kernel/include/IMP/macros.h (working copy) @@ -213,7 +213,9 @@ /** \internal */ -#define IMP_CONTAINER_CORE(Ucname, lcname, Data, IndexType, Container) \ +#define IMP_CONTAINER_CORE(protection, Ucname, lcname, Data, IndexType,\ + Container) \ + protection: \ /** \short Add an object. \param[in] obj Pointer to the object \return index of object within the object @@ -248,7 +250,10 @@ return lcname##_vector_.begin();} \ Ucname##ConstIterator lcname##s_end() const { \ return lcname##_vector_.end();} \ - Container lcname##_vector_; + private: \ + /** \internal */ \ + Container lcname##_vector_; \ + protection: /** \internal */ @@ -278,22 +283,23 @@ /** Such a container adds public methods add_foo, get_foo, number_of_foo and a private type foo_iterator, with methods foo_begin, foo_end. + \param[in] protection The level of protection for the container. \param[in] Ucname The name of the type in uppercase \param[in] lcname The name of the type in lower case \param[in] Data The type of the data to store. \param[in] Onchanged Code to get executed every time the container changes - Eventually we can add removal and correctness checks. - Note that the type Ucnames must be declared and be a vector of + \note the type Ucnames must be declared and be a vector of Data. */ -#define IMP_LIST(Ucname, lcname, Data) \ +#define IMP_LIST(protection, Ucname, lcname, Data) \ + protection: \ /** \short Clear the contents of the container */ \ void clear_##lcname##s(); \ /** \short Remove any occurences of d from the container */ \ void erase_##lcname(Data d); \ - IMP_CONTAINER_CORE(Ucname, lcname, Data, unsigned int, \ + IMP_CONTAINER_CORE(protection, Ucname, lcname, Data, unsigned int, \ IMP::internal::Vector) @@ -335,12 +341,17 @@ \param[in] IndexType The type to use for the index. This should be an instantiation of Index or something similar. - Eventually we can add removal and correctness checks. + \note The type Ucnames must be declared and be a vector of + Data. + \note these containers are always public */ #define IMP_CONTAINER(Ucname, lcname, IndexType) \ + private: \ + /** \internal + This is an implementation detail.*/ \ typedef IMP::internal::ObjectContainer \ Ucname##Container; \ - IMP_CONTAINER_CORE(Ucname, lcname, Ucname*, IndexType, \ + IMP_CONTAINER_CORE(public, Ucname, lcname, Ucname*, IndexType,\ Ucname##Container) Index: kernel/src/Optimizer.cpp =================================================================== --- kernel/src/Optimizer.cpp (revision 385) +++ kernel/src/Optimizer.cpp (working copy) @@ -25,7 +25,7 @@ } //! Update optimizer state, at each successful step -void Optimizer::update_state() +void Optimizer::update_states() { IMP_LOG(VERBOSE, "Updating OptimizerStates " << std::flush); Index: kernel/src/optimizers/ConjugateGradients.cpp =================================================================== --- kernel/src/optimizers/ConjugateGradients.cpp (revision 385) +++ kernel/src/optimizers/ConjugateGradients.cpp (working copy) @@ -276,7 +276,7 @@ /* Begin the major iteration loop. */ g40: - update_state(); + update_states(); /* Begin linear search. alpha is the steplength. */ if (gradient_direction) { @@ -429,7 +429,7 @@ for (i = 0; i < n; i++) { model_data->set_value(float_indices[i], x[i]); } - update_state(); + update_states(); return f; } Index: kernel/src/optimizers/SteepestDescent.cpp =================================================================== --- kernel/src/optimizers/SteepestDescent.cpp (revision 385) +++ kernel/src/optimizers/SteepestDescent.cpp (working copy) @@ -90,7 +90,7 @@ temp_vals[i] - temp_derivs[i] * current_step_size); } - update_state(); + update_states(); // check the new model new_score = get_model()->evaluate(false); Index: kernel/src/optimizers/MonteCarlo.cpp =================================================================== --- kernel/src/optimizers/MonteCarlo.cpp (revision 385) +++ kernel/src/optimizers/MonteCarlo.cpp (working copy) @@ -37,10 +37,7 @@ Float MonteCarlo::optimize(unsigned int max_steps) { IMP_CHECK_OBJECT(this); - for (OptimizerStateIterator it= optimizer_states_begin(); - it != optimizer_states_end(); ++it) { - (*it)->update(); - } + update_states(); prior_energy_ =get_model()->evaluate(0); IMP_LOG(VERBOSE, "MC Initial energy is " << prior_energy_ << std::endl); ::boost::uniform_real<> rand(0,1); @@ -90,10 +87,7 @@ if (accept) { ++stat_forward_steps_taken_; prior_energy_= next_energy; - for (OptimizerStateIterator it= optimizer_states_begin(); - it != optimizer_states_end(); ++it) { - (*it)->update(); - } + update_states(); } else { ++stat_num_failures_; } Index: kernel/src/optimizers/MolecularDynamics.cpp =================================================================== --- kernel/src/optimizers/MolecularDynamics.cpp (revision 385) +++ kernel/src/optimizers/MolecularDynamics.cpp (working copy) @@ -133,7 +133,7 @@ Float score = model->evaluate(true); for (unsigned int i = 0; i < max_steps; ++i) { - update_state(); + update_states(); step(); score = model->evaluate(true); }