IMP logo
Public Member Functions | Static Public Member Functions | Related Functions
IMP::core::XYZ Class Reference

Detailed Description

A a decorator for a particle with x,y,z coordinates.

Using the decorator one can get and set coordinates and modify derivatives.

import IMP
import IMP.core
import IMP.algebra

m= IMP.Model()
p0= IMP.Particle(m)
# add x,y,z coordinates to the particle
d0= IMP.core.XYZ.setup_particle(p0, IMP.algebra.Vector3D(0,1,2))
p1= IMP.Particle(m)
# add slots for the coordinates, but leave them uninitialized
d1= IMP.core.XYZ.setup_particle(p1)
# set the coordinate values
d1.set_coordinates(IMP.algebra.Vector3D(3,4,5))

# return the distance between the two points described by the decorated
# particles
print IMP.core.get_distance(d0, d1)
See also:
XYZR

Examples: XYZR Decorator, symmetry, XYZ Decorator, custom filter, displaying ensembles, tasks, score protein with ligand, adding data, simplex, six particles optimization, pdb, interactive with containers, ms connectivity restraint, multiscale, setup, interactive, nup84 cg, restrain diameter, nup84 rb, domino approach

+ Inheritance diagram for IMP::core::XYZ:

List of all members.

Public Member Functions

 XYZ (Model *m, ParticleIndex id)
 XYZ (::IMP::Particle *p)
void add_to_derivative (int i, Float v, DerivativeAccumulator &d)
 Add something to the derivative of the ith coordinate.
void add_to_derivatives (const algebra::Vector3D &v, DerivativeAccumulator &d)
 Add something to the derivative of the coordinates.
Float get_coordinate (int i) const
 Get the ith coordinate.
const algebra::Vector3Dget_coordinates () const
 Convert it to a vector.
bool get_coordinates_are_optimized () const
 Get whether the coordinates are optimized.
Float get_derivative (int i) const
 Get the ith coordinate derivative.
algebra::Vector3D get_derivatives () const
 Get the vector of derivatives.
algebra::Vector3D get_vector_to (const XYZ &b) const
 Get the vector from this particle to another.
Float get_x () const
Float get_y () const
Float get_z () const
void set_coordinate (unsigned int i, Float v)
 set the ith coordinate
void set_coordinates (const algebra::Vector3D &v)
 set all coordinates from a vector
void set_coordinates_are_optimized (bool tf) const
 Set whether the coordinates are optimized.
void set_x (Float t)
void set_y (Float t)
void set_z (Float t)

Static Public Member Functions

static XYZ decorate_particle (::IMP::Particle *p)
static FloatKey get_coordinate_key (unsigned int i)
static const FloatKeys & get_xyz_keys ()
 Get a vector containing the keys for x,y,z.
static bool particle_is_instance (Particle *p)
 Return true if the particle can be cast to the decorator.
static bool particle_is_instance (Model *m, ParticleIndex pi)
static XYZ setup_particle (Particle *p, const algebra::Vector3D &v=algebra::Vector3D(0, 0, 0))

Related Functions

(Note that these are not member functions.)

double get_dihedral (XYZ a, XYZ b, XYZ c, XYZ d)
 Compute the dihedral angle (in radians) between the four particles.
double get_distance (XYZ a, XYZ b)
 Compute the distance between a pair of particles.

Member Function Documentation

void IMP::core::XYZ::add_to_derivative ( int  i,
Float  v,
DerivativeAccumulator d 
)

Add something to the derivative of the ith coordinate.

void IMP::core::XYZ::add_to_derivatives ( const algebra::Vector3D v,
DerivativeAccumulator d 
)

Add something to the derivative of the coordinates.

Float IMP::core::XYZ::get_coordinate ( int  i) const

Get the ith coordinate.

const algebra::Vector3D& IMP::core::XYZ::get_coordinates ( ) const

Convert it to a vector.

Somewhat suspect based on wanting a Point/Vector differentiation but we don't have points

Reimplemented in IMP::core::RigidBody.

bool IMP::core::XYZ::get_coordinates_are_optimized ( ) const

Get whether the coordinates are optimized.

Returns:
true only if all of them are optimized.

Reimplemented in IMP::core::RigidBody.

Float IMP::core::XYZ::get_derivative ( int  i) const

Get the ith coordinate derivative.

algebra::Vector3D IMP::core::XYZ::get_derivatives ( ) const

Get the vector of derivatives.

Somewhat suspect based on wanting a Point/Vector differentiation but we don't have points

algebra::Vector3D IMP::core::XYZ::get_vector_to ( const XYZ b) const

Get the vector from this particle to another.

static const FloatKeys& IMP::core::XYZ::get_xyz_keys ( ) [static]

Get a vector containing the keys for x,y,z.

This is quite handy for initializing movers and things.

static bool IMP::core::XYZ::particle_is_instance ( Particle p) [static]

Return true if the particle can be cast to the decorator.

That is, if particle_is_instance() returns true, then it is legal to construct an instance of the decorator with that particle. If not, setup_particle() must be called first.

  IMP::Particle *p = new IMP::Particle(m);
  // it is false
  std::cout << IMP::core::XYZ::particle_is_instance(p) << std::endl;
  // As a result this is an error
  IMP::core::XYZ d(p);
  // now set it up
  IMP::core::XYZ(p);
  // now it is true
  std::cout << IMP::core::XYZ::particle_is_instance(p) << std::endl;
  // and now this code is OK
  IMP::core::XYZ d(p);

Reimplemented from IMP::Decorator.

Reimplemented in IMP::core::RigidMember, IMP::core::RigidBody, IMP::atom::RigidBodyDiffusion, IMP::core::XYZR, IMP::core::Cover, IMP::atom::Diffusion, IMP::atom::Charged, IMP::atom::LennardJones, and IMP::core::Centroid.

void IMP::core::XYZ::set_coordinate ( unsigned int  i,
Float  v 
)

set the ith coordinate

void IMP::core::XYZ::set_coordinates ( const algebra::Vector3D v)

set all coordinates from a vector

Reimplemented in IMP::core::RigidMember.

void IMP::core::XYZ::set_coordinates_are_optimized ( bool  tf) const

Set whether the coordinates are optimized.

static XYZ IMP::core::XYZ::setup_particle ( Particle p,
const algebra::Vector3D v = algebra::Vector3D(0,0,0) 
) [static]

Create a decorator with the passed coordinates.


Friends And Related Function Documentation

double get_dihedral ( XYZ  a,
XYZ  b,
XYZ  c,
XYZ  d 
) [related]

Compute the dihedral angle (in radians) between the four particles.

double get_distance ( XYZ  a,
XYZ  b 
) [related]

Compute the distance between a pair of particles.


The documentation for this class was generated from the following file:

Generated on Fri Feb 10 2012 23:36:26 for IMP by doxygen 1.7.5.1