Chemical Descriptors Library: for_each_atom
Molecule Functors

for_each_atom

Object type

Unary function

Description

for_each_atom is an unary operation that applies an unary function to each of the atoms of the molecule. operator() accepts a molecule.

Prototype

  template <class Molecule, class UnaryOperation>
  struct for_each_atom : public std::unary_function<Molecule, UnaryOperation> {

    for_each_atom(const UnaryOperation& uo_ = UnaryOperation() ) : uo(uo_) {}

    result_type
    operator ()(typename boost::call_traits<argument_type>::param_type m) const;
  };

Associated types

type nameDescriptionmember type
argument_type The type of the unary function's argument, usually the type of a molecule public
result_type The type of the unary operation to be applied to each atom. Also, the type returned by the functor public

Definition

#include <morpho/cdl/molecule/functors/mol_ftors.hpp>

Preconditions

The molecular type provides atoms_begin() and atoms_end() methods. Also, the unary function's type UnaryOperation accepts an atom.

Complexity

Linear: num_atoms() applications of the UnaryOperation

Example



References



Copyright © Vladimir Josef Sykora & Morphochem AG 2003
Copyright © Vladimir Josef Sykora 2003-2006