Index: kernel/include/IMP/ModelData.h =================================================================== --- kernel/include/IMP/ModelData.h (revision 431) +++ kernel/include/IMP/ModelData.h (working copy) @@ -23,11 +23,11 @@ class DerivativeAccumulator; -//! Storage for all model particle data. -/** All data for particles is stored through indexing of data - in this structure. Float data is assumed to be potentially - differentiable and is stored in a structure that can accomodate - differentiation. Int and string data is stored directly in vectors. +//! The interface that optimizers uses to access Particle attributes. +/** All data for particles is stored in this structure. Float values + is are all differentiable. Each Float value has an associated flag + saying whether it is optimized or not. Non-optimized values should + not be changed by the optimizer. \note ModelData should only be used in writing Optimizers. */ Index: kernel/include/IMP/restraints/NonbondedRestraint.h =================================================================== --- kernel/include/IMP/restraints/NonbondedRestraint.h (revision 431) +++ kernel/include/IMP/restraints/NonbondedRestraint.h (working copy) @@ -21,7 +21,7 @@ class NonbondedListScoreState; class PairScore; -//! Restrain all pairs of non-bonded particles +//! Apply a PairScore to all nonbonded pairs of particles /** \ingroup restraint */ Index: kernel/include/IMP/restraints/ConnectivityRestraint.h =================================================================== --- kernel/include/IMP/restraints/ConnectivityRestraint.h (revision 431) +++ kernel/include/IMP/restraints/ConnectivityRestraint.h (working copy) @@ -22,14 +22,17 @@ { class PairScore; -//! Connectivity restraint. +//! Ensure that several sets of particles remain connected with one another. /** The restraint takes several sets (added using the add_set method) - and ensures that the sets of points are connected. More precisely, - the restraint scores based on a minimum spanning tree on the set - of particles in the union of the sets. Edges between two particles - from the same set have weight 0. Edges between two nodes from - different sets have weights given by the PairScore for that pair. + and ensures that the sets of points are connected. + More precisely, the restraint scores based on a minimum spanning + tree on the set of particles in the union of the sets. Edges + between two particles from the same set have weight 0. Edges + between two nodes from different sets have weights given by the + PairScore for that pair. The edges within a set are ignored for + the purposes of computing derivatives. + \ingroup restraint */ class IMPDLLEXPORT ConnectivityRestraint : public Restraint Index: kernel/include/IMP/restraints/TripletChainRestraint.h =================================================================== --- kernel/include/IMP/restraints/TripletChainRestraint.h (revision 431) +++ kernel/include/IMP/restraints/TripletChainRestraint.h (working copy) @@ -20,7 +20,7 @@ class TripletScore; -//! Restrain each three consecutive particles in each chain. +//! Restrain each triplet of consecutive particles in each chain. /** \ingroup restraint */ class IMPDLLEXPORT TripletChainRestraint : public Restraint Index: kernel/include/IMP/restraints/PairListRestraint.h =================================================================== --- kernel/include/IMP/restraints/PairListRestraint.h (revision 431) +++ kernel/include/IMP/restraints/PairListRestraint.h (working copy) @@ -21,7 +21,7 @@ class PairScore; -//! Applies a PairScore to each Particle in a list. +//! Applies a PairScore to each pair of particles Particle in a list. /** \ingroup restraint */ class IMPDLLEXPORT PairListRestraint : public Restraint Index: kernel/include/IMP/decorators/NameDecorator.h =================================================================== --- kernel/include/IMP/decorators/NameDecorator.h (revision 431) +++ kernel/include/IMP/decorators/NameDecorator.h (working copy) @@ -16,7 +16,9 @@ namespace IMP { -//! A simple decorator which controls the Particle name. +//! A simple decorator which controls the Particle description. +/** \ingroup helper + */ class IMPDLLEXPORT NameDecorator: public DecoratorBase { IMP_DECORATOR(NameDecorator, DecoratorBase, Index: kernel/include/IMP/optimizers/states/CMMLogOptimizerState.h =================================================================== --- kernel/include/IMP/optimizers/states/CMMLogOptimizerState.h (revision 431) +++ kernel/include/IMP/optimizers/states/CMMLogOptimizerState.h (working copy) @@ -90,9 +90,6 @@ FloatKey r_, g_, b_; }; - -IMP_OUTPUT_OPERATOR(CMMLogOptimizerState); - } // namespace IMP #endif /* __IMP_CMM_LOG_OPTIMIZER_STATE_H */ Index: kernel/include/IMP/optimizers/states/VRMLLogOptimizerState.h =================================================================== --- kernel/include/IMP/optimizers/states/VRMLLogOptimizerState.h (revision 431) +++ kernel/include/IMP/optimizers/states/VRMLLogOptimizerState.h (working copy) @@ -91,9 +91,6 @@ FloatKey r_, g_, b_; }; - -IMP_OUTPUT_OPERATOR(VRMLLogOptimizerState); - } // namespace IMP #endif /* __IMP_VRML_LOG_STATE_H */ Index: kernel/include/IMP/optimizers/MonteCarlo.h =================================================================== --- kernel/include/IMP/optimizers/MonteCarlo.h (revision 431) +++ kernel/include/IMP/optimizers/MonteCarlo.h (working copy) @@ -16,7 +16,7 @@ typedef std::vector Movers; -//! Simple Monte Carlo optimizer. +//! A Monte Carlo optimizer. /** The optimizer uses a set of Mover objects to propose steps. Currently each Mover is called at each Monte Carlo iteration. This may change in the future. The movers propose some modification, which is then Index: kernel/include/IMP/optimizers/movers/BallMover.h =================================================================== --- kernel/include/IMP/optimizers/movers/BallMover.h (revision 431) +++ kernel/include/IMP/optimizers/movers/BallMover.h (working copy) @@ -16,7 +16,7 @@ namespace IMP { -//! Modify a set of continuous variables. +//! Modify a set of continuous variables by perturbing them within a ball. /** The variables are perturbed within a ball of the given radius. \ingroup mover @@ -30,7 +30,7 @@ \param[in] vars The variables to use (normally the keys for x,y,z) \param[in] radius The radius deviation to use. */ - BallMover(const Particles &pis, const FloatKeys &vars, + BallMover(const Particles &ps, const FloatKeys &vars, Float radius); //! void set_radius(Float radius) { Index: kernel/include/IMP/internal/Grid3D.h =================================================================== --- kernel/include/IMP/internal/Grid3D.h (revision 431) +++ kernel/include/IMP/internal/Grid3D.h (working copy) @@ -244,8 +244,8 @@ /** \param[in] xd The number of voxels in the x direction \param[in] yd The number of voxels in the y direction \param[in] zd The number of voxels in the z direction - \param[in] minc The min coordinate of the grid - \param[in] maxc The max coordinate of the grid + \param[in] minc The min point of the grid + \param[in] max The max point of the grid \param[in] def The default value for the voxels */ Grid3D(int xd, int yd, int zd, Index: kernel/include/IMP/Key.h =================================================================== --- kernel/include/IMP/Key.h (revision 431) +++ kernel/include/IMP/Key.h (working copy) @@ -96,7 +96,7 @@ data().map[sc]=sz; data().rmap.push_back(sc); str_= sz; - IMP_assert(data().rmap.size() == data().map.size(), "Unequal map sizes") + IMP_assert(data().rmap.size() == data().map.size(), "Unequal map sizes"); } else { str_= data().map.find(sc)->second; } @@ -104,7 +104,7 @@ }; explicit Key(unsigned int i): str_(i) { - IMP_assert(data().rmap.size() > i, "There is no such attribute " << i) + IMP_assert(data().rmap.size() > i, "There is no such attribute " << i); } //! Turn a key into a pretty string Index: kernel/include/IMP/exception.h =================================================================== --- kernel/include/IMP/exception.h (revision 431) +++ kernel/include/IMP/exception.h (working copy) @@ -135,11 +135,13 @@ \param[in] message Write this message if the assertion fails. \ingroup assert */ -#define IMP_assert(expr, message) \ - if (!(expr)) { \ - IMP_ERROR(message); \ - IMP::internal::assert_fail(); \ - } +#define IMP_assert(expr, message) \ + do { \ + if (!(expr)) { \ + IMP_ERROR(message); \ + IMP::internal::assert_fail(); \ + } \ + } while(false) #else #define IMP_assert(expr, message) #endif @@ -151,10 +153,12 @@ \ingroup assert */ #define IMP_check(expr, message, exception) \ - if (!(expr)) { \ - IMP_ERROR(message); \ - throw exception; \ - } + do { \ + if (!(expr)) { \ + IMP_ERROR(message); \ + throw exception; \ + } \ + } while (false) //! A runtime failure for IMP. /** \param[in] message Write this message if the assertion fails. Index: kernel/include/IMP/Particle.h =================================================================== --- kernel/include/IMP/Particle.h (revision 431) +++ kernel/include/IMP/Particle.h (working copy) @@ -223,9 +223,6 @@ } // Set pointer to model particle data. - /* This is called by the Model after the particle is added. - \param[in] md Pointer to a ModelData object. - */ void set_model(Model *md, ParticleIndex pi); // all of the particle data Index: kernel/src/Particle.cpp =================================================================== --- kernel/src/Particle.cpp (revision 431) +++ kernel/src/Particle.cpp (working copy) @@ -13,45 +13,28 @@ namespace IMP { -//! Constructor Particle::Particle() { is_active_ = true; } -//! Constructor Particle::~Particle() { } -//! Set pointer to model particle data. -/** This is called by the Model after the particle is added. - \param[in] md Pointer to a ModelData object. - */ void Particle::set_model(Model *md, ParticleIndex pi) { model_ = md; pi_ = pi; } - -//! Set whether the particle is active. -/** Restraints referencing the particle are only evaluated for 'active' - particles. - \param[in] is_active If true, the particle is active. - */ void Particle::set_is_active(const bool is_active) { is_active_ = is_active; } -//! Add a Float attribute to this particle. -/** \param[in] name Name of the attribute being added. - \param[in] value Initial value of the attribute. - \param[in] is_optimized Whether the attribute's value should be optimizable. - */ void Particle::add_attribute(FloatKey name, const Float value, bool is_optimized) { @@ -64,10 +47,6 @@ } -//! Add an Int attribute to this particle. -/** \param[in] name Name of the attribute being added. - \param[in] value Initial value of the attribute. - */ void Particle::add_attribute(IntKey name, const Int value) { IMP_assert(model_, @@ -76,10 +55,6 @@ } -//! Add a String attribute to this particle. -/** \param[in] name Name of the attribute being added. - \param[in] value Initial value of the attribute. - */ void Particle::add_attribute(StringKey name, const String value) { IMP_assert(model_, @@ -89,9 +64,6 @@ -//! Show the particle -/** \param[in] out Stream to write particle description to. - */ void Particle::show(std::ostream& out) const { char* inset = " "; Index: kernel/src/decorators/HierarchyDecorator.cpp =================================================================== --- kernel/src/decorators/HierarchyDecorator.cpp (revision 431) +++ kernel/src/decorators/HierarchyDecorator.cpp (working copy) @@ -40,7 +40,7 @@ IMP_assert(!get_particle()->has_attribute( get_child_key(get_number_of_children())), "Recorded and actual number of children don't match -- " - "too many actual") + "too many actual"); } void HierarchyDecorator::show(std::ostream &, std::string) const Index: kernel/src/internal/ParticleGrid.cpp =================================================================== --- kernel/src/internal/ParticleGrid.cpp (revision 431) +++ kernel/src/internal/ParticleGrid.cpp (working copy) @@ -15,6 +15,7 @@ namespace internal { +static const int target_cell_occupancy=10; ParticleGrid::ParticleGrid(float tvs): target_voxel_side_(tvs), grid_valid_(false) @@ -49,8 +50,9 @@ if (!mc_->get_particles().empty()) { // keep the grid size sane if things blow up float maxdim= std::max(mx[0]-mn[0], std::max(mx[1]-mn[1], mx[2]-mn[2])); - float vx= std::pow(static_cast(10.0*(maxdim*maxdim*maxdim - /mc_->get_particles().size())), + float vx= std::pow(static_cast(target_cell_occupancy + *(maxdim*maxdim*maxdim + /mc_->get_particles().size())), .3333f); if (vx > target_voxel_side_) { IMP_LOG(VERBOSE, "Overroade target side of " << target_voxel_side_