IMP logo

Macros to aid with implementation classes


Detailed Description

These macros are here to aid with implementing classes that inherit from the various abstract base classes in the kernel. Each macro, which should be used in the body of the class, declares/defines the set of needed functions. The declared functions should be defined in the associated .cpp file. By using the macros, you ensure that your class gets the names of the functions correct and it makes it easier to update your class if the functions should change.

All of the macros define the following methods:

In addition, they all declare:

For all macros, the Name parameter is the name of the class being implemented and the version_info parameter is the IMP::VersionInfo to use (probably get_version_info()).


Defines

#define IMP_CONSTRAINT(Name)
 Define the basics needed for a ScoreState.
#define IMP_FAILURE_HANDLER(Name)
 Declare a IMP::FailureHandler.
#define IMP_INCREMENTAL_RESTRAINT(Name)
 Define the basic things you need for a Restraint.
#define IMP_INTERNAL_OBJECT(Name)
 Define the basic things needed by any internal Object.
#define IMP_INTERNAL_SINGLETON_MODIFIER(Name,apply_expr)
 Define a simple SingletonModifier.
#define IMP_OBJECT(Name)
 Define the basic things needed by any Object.
#define IMP_OBJECT_INLINE(Name, show, destructor)
 Define the basic things needed by any Object.
 IMP::Optimizer::IMP_OPTIMIZER(Name)
 Define the basic things you need for an Optimizer.
#define IMP_OPTIMIZER(Name)
 Define the basic things you need for an Optimizer.
#define IMP_OPTIMIZER_STATE(Name)
 Define the basics needed for an OptimizerState.
#define IMP_PAIR_CONTAINER(Name)
 Declare the needed functions for a PairContainer.
#define IMP_PAIR_FILTER(Name)
 Declare the needed functions for a PairFilter.
#define IMP_PAIR_MODIFIER(Name)
 Declare the functions needed for a PairModifier.
#define IMP_PAIR_MODIFIER_DA(Name)
 Declare the functions needed for a PairModifier.
#define IMP_PAIR_SCORE(Name)
 Declare the functions needed for a PairScore.
#define IMP_PERIODIC_OPTIMIZER_STATE(Name)
 Define the basics needed for an OptimizerState which acts every n steps.
#define IMP_QUAD_CONTAINER(Name)
 Declare the needed functions for a QuadContainer.
#define IMP_QUAD_FILTER(Name)
 Declare the needed functions for a QuadFilter.
#define IMP_QUAD_SCORE(Name)
 Declare the functions needed for a QuadScore.
#define IMP_RAII(Name, args, Initialize, Set, Reset)
 Declare a RAII-style class.
#define IMP_REFINER(Name)
 Define the basics needed for a particle refiner.
#define IMP_RESTRAINT(Name)
 Define the basic things you need for a Restraint.
 IMP::Sampler::IMP_SAMPLER(Name)
 Define the basic things you need for a Sampler.
#define IMP_SAMPLER(Name)
 Define the basic things you need for a Sampler.
#define IMP_SCORE_STATE(Name)
 Define the basics needed for a ScoreState.
#define IMP_SIMPLE_PAIR_SCORE(Name)
 Declare the functions needed for a SingletonScore.
#define IMP_SIMPLE_REFINER(Name)
 Define the basics needed for a particle refiner.
#define IMP_SIMPLE_SINGLETON_SCORE(Name)
 Declare the functions needed for a SingletonScore.
#define IMP_SIMPLE_TRIPLET_SCORE(Name)
 Declare the functions needed for a TripletScore.
#define IMP_SINGLETON_CONTAINER(Name)
 Declare the needed functions for a SingletonContainer.
#define IMP_SINGLETON_FILTER(Name)
 Declare the needed functions for a SingletonFilter.
#define IMP_SINGLETON_MODIFIER(Name)
 Declare the functions needed for a SingletonModifier.
#define IMP_SINGLETON_MODIFIER_DA(Name)
 Declare the functions needed for a SingletonModifier.
#define IMP_SINGLETON_MODIFIER_FROM_REFINED(Name, refiner)
 Add interaction methods to a SingletonModifer.
#define IMP_SINGLETON_MODIFIER_TO_REFINED(Name, refiner)
 Add interaction methods to a SingletonModifer.
#define IMP_SINGLETON_SCORE(Name)
 Declare the functions needed for a SingletonScore.
#define IMP_TRIPLET_CONTAINER(Name)
 Declare the needed functions for a TripletContainer.
#define IMP_TRIPLET_FILTER(Name)
 Declare the needed functions for a TripletFilter.
#define IMP_TRIPLET_SCORE(Name)
 Declare the functions needed for a TripletScore.
#define IMP_UNARY_FUNCTION(Name)
 Declare the needed functions for a UnaryFunction.
#define IMP_UNARY_FUNCTION_INLINE(Name, value_expression,derivative_expression, show_expression)
 Declare the needed functions for a UnaryFunction which evaluates inline.

Define Documentation

#define IMP_CONSTRAINT ( Name   ) 

Define the basics needed for a ScoreState.

In addition to the methods done by IMP_OBJECT, it declares

  • IMP::Constraint::do_update_attributes()
  • IMP::Constraint::do_update_derivatives()

#define IMP_FAILURE_HANDLER ( Name   ) 

Value:

void handle_failure();                        \
  IMP_OBJECT(Name)
Declare a IMP::FailureHandler.

In addition to the standard methods it declares:

  • IMP::FailureHandler::handle_failure()

#define IMP_INCREMENTAL_RESTRAINT ( Name   ) 

Define the basic things you need for a Restraint.

In addition to the methods done by IMP_OBJECT, it declares

  • IMP::Restraint::unprotected_evaluate()
  • IMP::Restraint::unprotected_incremental_evaluate()
  • IMP::Restraint::get_input_containers()
  • IMP::Restraint::get_interacting_particles()
  • IMP::Restraint::get_input_particles()

and it defines

#define IMP_INTERNAL_OBJECT ( Name   ) 

Define the basic things needed by any internal Object.

See also:
IMP_OBJECT This version also defines IMP::Object::do_show()

#define IMP_INTERNAL_SINGLETON_MODIFIER ( Name,
apply_expr   ) 

Define a simple SingletonModifier.

In addition to the methods done by IMP_OBJECT, it defines

#define IMP_OBJECT ( Name   ) 

Define the basic things needed by any Object.

This defines

#define IMP_OBJECT_INLINE ( Name,
show,
destructor   ) 

Define the basic things needed by any Object.

This defines

IMP_OPTIMIZER ( Name   )  [related, inherited]

Define the basic things you need for an Optimizer.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_OPTIMIZER ( Name   ) 

Value:

virtual Float optimize(unsigned int max_steps);       \
  IMP_OBJECT(Name);
Define the basic things you need for an Optimizer.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_OPTIMIZER_STATE ( Name   ) 

Value:

virtual void update();                        \
  IMP_OBJECT(Name);
Define the basics needed for an OptimizerState.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_PAIR_CONTAINER ( Name   ) 

Declare the needed functions for a PairContainer.

In addition to the methods of IMP_OBJECT, it declares

#define IMP_PAIR_FILTER ( Name   ) 

Declare the needed functions for a PairFilter.

In addition to the methods done by all the macros, it declares

#define IMP_PAIR_MODIFIER ( Name   ) 

Declare the functions needed for a PairModifier.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_PAIR_MODIFIER_DA ( Name   ) 

Declare the functions needed for a PairModifier.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_PAIR_SCORE ( Name   ) 

Declare the functions needed for a PairScore.

In addition to the methods done by IMP_OBJECT(), it declares

The macro expects a class method

  • bool get_is_changed(const ParticlePair&) which returns true if the score needs to be recalculated.

See IMP_SIMPLE_PAIR_SCORE() for a way of providing an implementation of that method.

#define IMP_PERIODIC_OPTIMIZER_STATE ( Name   ) 

Define the basics needed for an OptimizerState which acts every n steps.

In addition to the methods done by all the macros, it declares

  • do_update(unsigned int call_number) where step number is the number of the optimization step, and call_number is the number of the call to do_update. It also defines
  • void set_skip_steps(unsigned int)

If you use this macro, you should also include IMP/internal/utility.h.

#define IMP_QUAD_CONTAINER ( Name   ) 

Declare the needed functions for a QuadContainer.

In addition to the methods of IMP_OBJECT, it declares

#define IMP_QUAD_FILTER ( Name   ) 

Declare the needed functions for a QuadFilter.

In addition to the methods done by all the macros, it declares

#define IMP_QUAD_SCORE ( Name   ) 

Declare the functions needed for a QuadScore.

In addition to the methods done by IMP_OBJECT(), it declares

The macro expects a class method

  • bool get_is_changed(ParticleQuad) which returns true if the score needs to be recalculated.

#define IMP_RAII ( Name,
args,
Initialize,
Set,
Reset   ) 

Declare a RAII-style class.

Since such classes are typically quite small and simple, all the implementation is inline. The macro declares

  • default constructor
  • RAII::set()
  • RAII::reset()
  • destructor The Set and Reset arguments are the code to run in the respective functions. "args" are the argument string (in parens) for the constructor and set.

#define IMP_REFINER ( Name   ) 

Define the basics needed for a particle refiner.

In addition to the methods done by all the macros, it declares

#define IMP_RESTRAINT ( Name   ) 

Define the basic things you need for a Restraint.

In addition to the methods defined by IMP::Object it declares

It also defines

IMP_SAMPLER ( Name   )  [related, inherited]

Define the basic things you need for a Sampler.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_SAMPLER ( Name   ) 

Value:

IMP_OBJECT(Name);                             \
protected:                                      \
 ConfigurationSet* do_sample() const;
Define the basic things you need for a Sampler.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_SCORE_STATE ( Name   ) 

Define the basics needed for a ScoreState.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_SIMPLE_PAIR_SCORE ( Name   ) 

Declare the functions needed for a SingletonScore.

In addition to the methods declared and defined by IMP_PAIR_SCORE, the macro provides an implementation of

#define IMP_SIMPLE_REFINER ( Name   ) 

Define the basics needed for a particle refiner.

In contrast to IMP_REFINER, if this macro is used, the Refiner::get_refined(Particle*) method is implemented using the other Refiner::get_refined() method and so does not have to be provided.

See also:
IMP_REFINER

#define IMP_SIMPLE_SINGLETON_SCORE ( Name   ) 

Declare the functions needed for a SingletonScore.

In addition to the methods declared and defined by IMP_SINGLETON_SCORE, the macro provides an implementation of

#define IMP_SIMPLE_TRIPLET_SCORE ( Name   ) 

Declare the functions needed for a TripletScore.

In addition to the methods declared and defined by IMP_TRIPLET_SCORE, the macro provides an implementation of

#define IMP_SINGLETON_CONTAINER ( Name   ) 

Declare the needed functions for a SingletonContainer.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_SINGLETON_FILTER ( Name   ) 

Declare the needed functions for a SingletonFilter.

In addition to the methods done by all the macros, it declares

#define IMP_SINGLETON_MODIFIER ( Name   ) 

Declare the functions needed for a SingletonModifier.

In addition to the methods done by IMP_OBJECT, it declares

#define IMP_SINGLETON_MODIFIER_DA ( Name   ) 

#define IMP_SINGLETON_MODIFIER_FROM_REFINED ( Name,
refiner   ) 

Add interaction methods to a SingletonModifer.

This macro is designed to be used in conjunction with IMP_SINGLETON_MODIFIER or IMP_SINGLETON_MODIFIER_DA. It adds definitions for the methods:

#define IMP_SINGLETON_MODIFIER_TO_REFINED ( Name,
refiner   ) 

Add interaction methods to a SingletonModifer.

This macro is designed to be used in conjunction with IMP_SINGLETON_MODIFIER or IMP_SINGLETON_MODIFIER_DA. It adds definitions for the methods:

This macro should appear in a .cpp file.

#define IMP_SINGLETON_SCORE ( Name   ) 

Declare the functions needed for a SingletonScore.

In addition to the methods done by IMP_INTERACTON, it declares

The macro expects a class method

  • bool get_is_changed(Particle*) which returns true if the score needs to be recalculated.

See IMP_SIMPLE_SINGLETON_SCORE() for a way of providing an implementation of that method.

#define IMP_TRIPLET_CONTAINER ( Name   ) 

Declare the needed functions for a TripletContainer.

In addition to the methods of IMP_OBJECT, it declares

#define IMP_TRIPLET_FILTER ( Name   ) 

Declare the needed functions for a TripletFilter.

In addition to the methods done by all the macros, it declares

#define IMP_TRIPLET_SCORE ( Name   ) 

Declare the functions needed for a TripletScore.

In addition to the methods done by IMP_OBJECT(), it declares

The macro expects a class method

  • bool get_is_changed(ParticleTriplet) which returns true if the score needs to be recalculated.

See IMP_SIMPLE_TRIPLET_SCORE() for a way of providing an implementation of that method.

#define IMP_UNARY_FUNCTION ( Name   ) 

Value:

virtual DerivativePair evaluate_with_derivative(double feature) const; \
  virtual double evaluate(double feature) const;                        \
  IMP_OBJECT(Name)
Declare the needed functions for a UnaryFunction.

In addition to the methods done by all the macros, it declares

See also:
IMP_UNARY_FUNCTION_INLINE

#define IMP_UNARY_FUNCTION_INLINE ( Name,
value_expression,
derivative_expression,
show_expression   ) 

Declare the needed functions for a UnaryFunction which evaluates inline.

This macro declares all the functions needed for an IMP::UnaryFunction inline in the class. There is no need for an associated .cpp file.

The last three arguments are expressions that evaluate to the unary function value and derivative and are sent to the stream in the show function, respectively. The input to the function is called feature.

See also:
IMP_UNARY_FUNCTION


Generated on Mon Mar 8 23:08:33 2010 for IMP by doxygen 1.5.8