Logo Search packages:      
Sourcecode: ball version File versions

simpleDescriptors.C

// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: simpleDescriptors.C,v 1.9.20.1 2007/03/16 00:06:49 bertsch Exp $
//

#include <BALL/QSAR/simpleDescriptors.h>
#include <BALL/KERNEL/expression.h>
#include <BALL/KERNEL/forEach.h>

using namespace std;

namespace BALL
{
      /////////////////////
      // molecular weight
      /////////////////////
00018       MolecularWeight::MolecularWeight()
            :     SimpleBase("MolecularWeight", "g/mol")
      {
      }

00023       MolecularWeight::MolecularWeight(const MolecularWeight& mw)
            :     SimpleBase(mw)
      {
      }

00028       MolecularWeight::~MolecularWeight()
      {
      }

00032       MolecularWeight& MolecularWeight::operator = (const MolecularWeight& mw)
      {
            this->setName(mw.getName());
            this->setUnit(mw.getUnit());
            return *this;
      }

      
      /////////////////////
      // number of bonds
      /////////////////////
00043       NumberOfBonds::NumberOfBonds()
            :     SimpleBase("NumberOfBonds", "")
      {
      }

00048       NumberOfBonds::NumberOfBonds(const NumberOfBonds& nb)
            :     SimpleBase(nb)
      {
      }

00053       NumberOfBonds::~NumberOfBonds()
      {
      }

00057       NumberOfBonds& NumberOfBonds::operator = (const NumberOfBonds& nb)
      {
            this->setName(nb.getName());
            this->setUnit(nb.getUnit());
            return *this;
      }

      
      ///////////////////////////
      // number of single bonds
      //////////////////////////
00068       NumberOfSingleBonds::NumberOfSingleBonds()
            :     SimpleBase("NumberOfSingleBonds", "")
      {
      }

00073       NumberOfSingleBonds::NumberOfSingleBonds(const NumberOfSingleBonds& nsb)
            :     SimpleBase(nsb)
      {
      }

00078       NumberOfSingleBonds::~NumberOfSingleBonds()
      {
      }

00082       NumberOfSingleBonds& NumberOfSingleBonds::operator = (const NumberOfSingleBonds& nsb)
      {
            this->setName(nsb.getName());
            this->setUnit(nsb.getUnit());
            return *this;
      }

      ///////////////////////////
      // number of double bonds
      ///////////////////////////
00092       NumberOfDoubleBonds::NumberOfDoubleBonds()
            :     SimpleBase("NumberOfDoubleBonds", "")
      {
      }

00097       NumberOfDoubleBonds::NumberOfDoubleBonds(const NumberOfDoubleBonds& ndb)
            :     SimpleBase(ndb)
      {
      }

00102       NumberOfDoubleBonds::~NumberOfDoubleBonds()
      {
      }

00106       NumberOfDoubleBonds& NumberOfDoubleBonds::operator = (const NumberOfDoubleBonds& ndb)
      {
            this->setName(ndb.getName());
            this->setUnit(ndb.getUnit());
            return *this;
      }

      ///////////////////////////
      // number of triple bonds
      ///////////////////////////
00116       NumberOfTripleBonds::NumberOfTripleBonds()
            :     SimpleBase("NumberOfTripleBonds", "")
      {
      }

00121       NumberOfTripleBonds::NumberOfTripleBonds(const NumberOfTripleBonds& ntb)
            :     SimpleBase(ntb)
      {
      }

00126       NumberOfTripleBonds::~NumberOfTripleBonds()
      {
      }

00130       NumberOfTripleBonds& NumberOfTripleBonds::operator = (const NumberOfTripleBonds& ntb)
      {
            this->setName(ntb.getName());
            this->setUnit(ntb.getUnit());
            return *this;
      }

      //////////////////////////////
      // number of aromatic bonds
      //////////////////////////////
00140       NumberOfAromaticBonds::NumberOfAromaticBonds()
            :     SimpleBase("NumberOfAromaticBonds", "")
      {
      }

00145       NumberOfAromaticBonds::NumberOfAromaticBonds(const NumberOfAromaticBonds& nab)
            :     SimpleBase(nab)
      {
      }

00150       NumberOfAromaticBonds::~NumberOfAromaticBonds()
      {
      }

00154       NumberOfAromaticBonds& NumberOfAromaticBonds::operator = (const NumberOfAromaticBonds& nab)
      {
            this->setName(nab.getName());
            this->setUnit(nab.getUnit());
            return *this;
      }
      
      /////////////////////
      // number of atoms
      /////////////////////
00164       NumberOfAtoms::NumberOfAtoms()
            :     SimpleBase("NumberOfAtoms", "")
      {
      }

00169       NumberOfAtoms::NumberOfAtoms(const NumberOfAtoms& na)
            :     SimpleBase(na)
      {
      }

00174       NumberOfAtoms::~NumberOfAtoms()
      {
      }

00178       NumberOfAtoms& NumberOfAtoms::operator = (const NumberOfAtoms& na)
      {
            this->setName(na.getName());
            this->setUnit(na.getUnit());
            return *this;
      }

      ////////////////////
      // number of boron
      ////////////////////
00188       NumberOfBoron::NumberOfBoron()
            : SimpleBase("NumberOfBoron", "")
      {
      }
      
00193       NumberOfBoron::NumberOfBoron(const NumberOfBoron& nb)
            :     SimpleBase(nb)
      {
      }

00198       NumberOfBoron::~NumberOfBoron()
      {
      }

00202       NumberOfBoron& NumberOfBoron::operator = (const NumberOfBoron& nb)
      {
            this->setName(nb.getName());
            this->setUnit(nb.getUnit());
            return *this;
      }
      
      /////////////////////
      // number of carbon
      /////////////////////
00212       NumberOfCarbon::NumberOfCarbon()
            :     SimpleBase("NumberOfCarbon", "")
      {
      }

00217       NumberOfCarbon::NumberOfCarbon(const NumberOfCarbon& nc)
            :     SimpleBase(nc)
      {
      }

00222       NumberOfCarbon::~NumberOfCarbon()
      {
      }

00226       NumberOfCarbon& NumberOfCarbon::operator = (const NumberOfCarbon& nc)
      {
            this->setName(nc.getName());
            this->setUnit(nc.getUnit());
            return *this;
      }
      
      ////////////////////////
      // number of nitrogen
      ////////////////////////
00236       NumberOfNitrogen::NumberOfNitrogen()
            :     SimpleBase("NumberOfNitrogen", "")
      {
      }

00241       NumberOfNitrogen::NumberOfNitrogen(const NumberOfNitrogen& nn)
            :     SimpleBase(nn)
      {
      }

00246       NumberOfNitrogen::~NumberOfNitrogen()
      {
      }

00250       NumberOfNitrogen& NumberOfNitrogen::operator = (const NumberOfNitrogen& nn)
      {
            this->setName(nn.getName());
            this->setUnit(nn.getUnit());
            return *this;
      }

      //////////////////////
      // number of oxygen
      //////////////////////
00260       NumberOfOxygen::NumberOfOxygen()
            :     SimpleBase("NumberOfOxygen", "")
      {
      }
      
00265       NumberOfOxygen::NumberOfOxygen(const NumberOfOxygen& no)
            :     SimpleBase(no)
      {
      }

00270       NumberOfOxygen::~NumberOfOxygen()
      {
      }

00274       NumberOfOxygen& NumberOfOxygen::operator = (const NumberOfOxygen& no)
      {
            this->setName(no.getName());
            this->setUnit(no.getUnit());
            return *this;
      }
      
      ////////////////////////
      // number of flourine
      ////////////////////////
00284       NumberOfFlourine::NumberOfFlourine()
            :     SimpleBase("NumberOfFlourine", "")
      {
      }

00289       NumberOfFlourine::NumberOfFlourine(const NumberOfFlourine& nf)
            :     SimpleBase(nf)
      {
      }

00294       NumberOfFlourine::~NumberOfFlourine()
      {
      }

00298       NumberOfFlourine& NumberOfFlourine::operator = (const NumberOfFlourine& nf)
      {
            this->setName(nf.getName());
            this->setUnit(nf.getUnit());
            return *this;
      }

      /////////////////////////
      // number of phophorus
      /////////////////////////
00308       NumberOfPhosphorus::NumberOfPhosphorus()
            :     SimpleBase("NumberOfPhosphorus", "")
      {
      }

00313       NumberOfPhosphorus::NumberOfPhosphorus(const NumberOfPhosphorus& np)
            :     SimpleBase(np)
      {
      }

00318       NumberOfPhosphorus::~NumberOfPhosphorus()
      {
      }

00322       NumberOfPhosphorus& NumberOfPhosphorus::operator = (const NumberOfPhosphorus& np)
      {
            this->setName(np.getName());
            this->setUnit(np.getUnit());
            return *this;
      }

      //////////////////////
      // number of sulfur
      //////////////////////
00332       NumberOfSulfur::NumberOfSulfur()
            :     SimpleBase("NumberOfSulfur", "")
      {
      }

00337       NumberOfSulfur::NumberOfSulfur(const NumberOfSulfur& ns)
            :     SimpleBase(ns)
      {
      }

00342       NumberOfSulfur::~NumberOfSulfur()
      {
      }

00346       NumberOfSulfur& NumberOfSulfur::operator = (const NumberOfSulfur& ns)
      {
            this->setName(ns.getName());
            this->setUnit(ns.getUnit());
            return *this;
      }

      /////////////////////////
      // number of chlorine
      /////////////////////////
00356       NumberOfChlorine::NumberOfChlorine()
            :     SimpleBase("NumberOfChlorine", "")
      {
      }

00361       NumberOfChlorine::NumberOfChlorine(const NumberOfChlorine& nc)
            :     SimpleBase(nc)
      {
      }

00366       NumberOfChlorine::~NumberOfChlorine()
      {
      }

00370       NumberOfChlorine& NumberOfChlorine::operator = (const NumberOfChlorine& nc)
      {
            this->setName(nc.getName());
            this->setUnit(nc.getUnit());
            return *this;
      }

      ///////////////////////
      // number of bromine
      ///////////////////////
00380       NumberOfBromine::NumberOfBromine()
            :     SimpleBase("NumberOfBromine", "")
      {
      }

00385       NumberOfBromine::NumberOfBromine(const NumberOfBromine& nb)
            :     SimpleBase(nb)
      {
      }

00390       NumberOfBromine::~NumberOfBromine()
      {
      }

00394       NumberOfBromine& NumberOfBromine::operator = (const NumberOfBromine& nb)
      {
            this->setName(nb.getName());
            this->setUnit(nb.getUnit());
            return *this;
      }

      //////////////////////
      // number of iodine
      //////////////////////
00404       NumberOfIodine::NumberOfIodine()
            :     SimpleBase("NumberOfIodine", "")
      {
      }

00409       NumberOfIodine::NumberOfIodine(const NumberOfIodine& ni)
            :     SimpleBase(ni)
      {
      }

00414       NumberOfIodine::~NumberOfIodine()
      {
      }

00418       NumberOfIodine& NumberOfIodine::operator = (const NumberOfIodine& ni)
      {
            this->setName(ni.getName());
            this->setUnit(ni.getUnit());
            return *this;
      }

      ////////////////////////
      // number of hydrogen
      ////////////////////////
00428       NumberOfHydrogen::NumberOfHydrogen()
            :     SimpleBase("NumberOfHydrogen", "")
      {
      }

00433       NumberOfHydrogen::NumberOfHydrogen(const NumberOfHydrogen& nh)
            :     SimpleBase(nh)
      {
      }

00438       NumberOfHydrogen::~NumberOfHydrogen()
      {
      }

00442       NumberOfHydrogen& NumberOfHydrogen::operator = (const NumberOfHydrogen& nh)
      {
            this->setName(nh.getName());
            this->setUnit(nh.getUnit());
            return *this;
      }

      ///////////////////////
      // formal charge
      ///////////////////////
00452       FormalCharge::FormalCharge()
            :     SimpleBase("FormalCharge", "eV")
      {
      }

00457       FormalCharge::FormalCharge(const FormalCharge& fc)
            :     SimpleBase(fc)
      {
      }

00462       FormalCharge::~FormalCharge()
      {
      }

00466       FormalCharge& FormalCharge::operator = (const FormalCharge& fc)
      {
            this->setName(fc.getName());
            this->setUnit(fc.getUnit());
            return *this;
      }

      /////////////////////////////
      // number of aromatic atoms
      /////////////////////////////
00476       NumberOfAromaticAtoms::NumberOfAromaticAtoms()
            :     SimpleBase("NumberOfAromaticAtoms", "")
      {
      }

00481       NumberOfAromaticAtoms::NumberOfAromaticAtoms(const NumberOfAromaticAtoms& naa)
            :     SimpleBase(naa)
      {
      }

00486       NumberOfAromaticAtoms::~NumberOfAromaticAtoms()
      {
      }

00490       NumberOfAromaticAtoms& NumberOfAromaticAtoms::operator = (const NumberOfAromaticAtoms& naa)
      {
            this->setName(naa.getName());
            this->setUnit(naa.getUnit());
            return *this;
      }

      ///////////////////////////
      // number of heavy bonds
      ///////////////////////////
00500       NumberOfHeavyBonds::NumberOfHeavyBonds()
            :     SimpleBase("NumberOfHeavyBonds", "")
      {
      }

00505       NumberOfHeavyBonds::NumberOfHeavyBonds(const NumberOfHeavyBonds& nhb)
            :     SimpleBase(nhb)
      {
      }

00510       NumberOfHeavyBonds::~NumberOfHeavyBonds()
      {
      }

00514       NumberOfHeavyBonds& NumberOfHeavyBonds::operator = (const NumberOfHeavyBonds& nhb)
      {
            this->setName(nhb.getName());
            this->setUnit(nhb.getUnit());
            return *this;
      }

      ///////////////////////////
      // number of heavy atoms
      ///////////////////////////
00524       NumberOfHeavyAtoms::NumberOfHeavyAtoms()
            :     SimpleBase("NumberOfHeavyAtoms", "")
      {
      }

00529       NumberOfHeavyAtoms::NumberOfHeavyAtoms(const NumberOfHeavyAtoms& nha)
            :     SimpleBase(nha)
      {
      }

00534       NumberOfHeavyAtoms::~NumberOfHeavyAtoms()
      {
      }

00538       NumberOfHeavyAtoms& NumberOfHeavyAtoms::operator = (const NumberOfHeavyAtoms& nha)
      {
            this->setName(nha.getName());
            this->setUnit(nha.getUnit());
            return *this;
      }

      //////////////////////
      // vertex adjacency
      //////////////////////
00548       VertexAdjacency::VertexAdjacency()
            :     SimpleBase("VertexAdjacency", "")
      {
      }

00553       VertexAdjacency::VertexAdjacency(const VertexAdjacency& va)
            :     SimpleBase(va)
      {
      }

00558       VertexAdjacency::~VertexAdjacency()
      {
      }

00562       VertexAdjacency& VertexAdjacency::operator = (const VertexAdjacency& va)
      {
            this->setName(va.getName());
            this->setUnit(va.getUnit());
            return *this;
      }

      double VertexAdjacency::compute(AtomContainer& ac)
      {
            if (!isValid_(ac))
            {
                  calculate_(ac);
            }
            double m = ac.getProperty("NumberOfHeavyBonds").getDouble();
            return m!=0 ? 1 + 3.3219280948873626 * log10(m) : 0.0;
      }

      ///////////////////////////////
      // vertex adjacency equaility 
      //////////////////////////////
00582       VertexAdjacencyEquality::VertexAdjacencyEquality()
            :     SimpleBase("VertexAdjacencyEquality", "")
      {
      }

00587       VertexAdjacencyEquality::VertexAdjacencyEquality(const VertexAdjacencyEquality& vae)
            :     SimpleBase(vae)
      {
      }

00592       VertexAdjacencyEquality::~VertexAdjacencyEquality()
      {
      }

00596       VertexAdjacencyEquality& VertexAdjacencyEquality::operator = ( const VertexAdjacencyEquality& vae)
      {
            this->setName(vae.getName());
            this->setUnit(vae.getUnit());
            return *this;
      }

      double VertexAdjacencyEquality::compute(AtomContainer& ac)
      {
            if (!isValid_(ac))
            {
                  calculate_(ac);
            }     
            double n = ac.getProperty("NumberOfHeavyAtoms").getDouble();
            double m = ac.getProperty("NumberOfHeavyBonds").getDouble();

            if (n!=0.0 && m!=0) 
            {
                  double f = 1.0 - 2*m/n/n;
                  if (f > 0.0 && f < 1.0) 
                  {
                        return -(1.0-f) * 3.3219280948873626 * log10(1.0-f) - f * 3.3219280948873626 * log10(f);
                  }
                  else 
                  {
                        return 0.0;
                  }
            }
            return 0.0;
      }
      
      /////////////////////////////////
      // number of hydrophobic atoms
      /////////////////////////////////
00630       NumberOfHydrophobicAtoms::NumberOfHydrophobicAtoms()
            :     SimpleBase("NumberOfHydrophobicAtoms", ""),
            expression_("")
      {
      }

00636       NumberOfHydrophobicAtoms::NumberOfHydrophobicAtoms(const NumberOfHydrophobicAtoms& nha)
            :     SimpleBase(nha),
            expression_(nha.getExpression())
      {
      }

00642       NumberOfHydrophobicAtoms::NumberOfHydrophobicAtoms(const String& expression)
            :     SimpleBase("NumberOfHydrophobicAtoms", ""),
            expression_(expression)
      {
      }

00648       NumberOfHydrophobicAtoms::~NumberOfHydrophobicAtoms()
      {
      }

00652       NumberOfHydrophobicAtoms& NumberOfHydrophobicAtoms::operator = (const NumberOfHydrophobicAtoms& nha)
      {
            this->setName(nha.getName());
            this->setUnit(nha.getUnit());
            this->setExpression(nha.getExpression());
            return *this;
      }

      void NumberOfHydrophobicAtoms::setExpression(const String& expression)
      {
            this->expression_ = expression;
      }

      const String& NumberOfHydrophobicAtoms::getExpression() const
      {
            return this->expression_;
      }

      double NumberOfHydrophobicAtoms::compute(AtomContainer& ac)
      {
            if (expression_ != "")
            {
                  Size num_hyd = 0;
                  Expression ex_hyd(expression_);
                  AtomIterator a_it = ac.beginAtom();
                  BALL_FOREACH_ATOM (ac, a_it)
                  {
                        if (ex_hyd(*a_it))
                        {
                              ++num_hyd;
                        }
                  }
                  ac.setProperty(this->getName(), (double)num_hyd);
            }
            else
            {
                  if (!isValid_(ac))
                  {
                        calculate_(ac);
                  }
            }
            return ac.getProperty(this->getName()).getDouble();
      }

      /////////////////////////////////////
      // number of hydrogen bond donors
      /////////////////////////////////////
00699       NumberOfHydrogenBondDonors::NumberOfHydrogenBondDonors()
            :     SimpleBase("NumberOfHydrogenBondDonors", ""),
            expression_("")
      {
      }

00705       NumberOfHydrogenBondDonors::NumberOfHydrogenBondDonors(const NumberOfHydrogenBondDonors& nhbd)
            :     SimpleBase(nhbd),
                  expression_(nhbd.getExpression())
      {
      }

00711       NumberOfHydrogenBondDonors::NumberOfHydrogenBondDonors(const String& expression)
            :     SimpleBase("NumberOfHydrogenBondDonors", ""),
            expression_(expression)
      {
      }

00717       NumberOfHydrogenBondDonors::~NumberOfHydrogenBondDonors()
      {
      }

00721       NumberOfHydrogenBondDonors& NumberOfHydrogenBondDonors::operator = (const NumberOfHydrogenBondDonors& nhbd)
      {
            this->setName(nhbd.getName());
            this->setUnit(nhbd.getUnit());
            this->setExpression(nhbd.getExpression());
            return *this;
      }
      
      void NumberOfHydrogenBondDonors::setExpression(const String& expression)
      {
            this->expression_ = expression;
      }

      const String& NumberOfHydrogenBondDonors::getExpression() const
      {
            return this->expression_;
      }

      double NumberOfHydrogenBondDonors::compute(AtomContainer& ac)
      {
            if (expression_ != "")
            {
                  Expression ex_don(expression_);
                  Size num_don = 0;
                  AtomIterator a_it = ac.beginAtom();
                  BALL_FOREACH_ATOM (ac, a_it)
                  {
                        if (ex_don(*a_it))
                        {
                              ++num_don;
                        }
                  }
                  ac.setProperty(this->getName(), (double)num_don);
            }
            else
            {
                  if (!isValid_(ac))
                  {
                        calculate_(ac);
                  }
            }
            return ac.getProperty(this->getName()).getDouble();
      }

      ////////////////////////////////////////
      // number of hydrogen bond acceptors
      ////////////////////////////////////////
00768       NumberOfHydrogenBondAcceptors::NumberOfHydrogenBondAcceptors()
            :     SimpleBase("NumberOfHydrogenBondAcceptors", ""),
            expression_("")
      {
      }

00774       NumberOfHydrogenBondAcceptors::NumberOfHydrogenBondAcceptors(const NumberOfHydrogenBondAcceptors& nhba)
            :     SimpleBase(nhba),
            expression_(nhba.getExpression())
      {
      }

00780       NumberOfHydrogenBondAcceptors::NumberOfHydrogenBondAcceptors(const String& expression)
            :     SimpleBase("NumberOfHydrogenBondAcceptors", ""),
            expression_(expression)
      {
      }

00786       NumberOfHydrogenBondAcceptors::~NumberOfHydrogenBondAcceptors()
      {
      }

00790       NumberOfHydrogenBondAcceptors& NumberOfHydrogenBondAcceptors::operator = (const NumberOfHydrogenBondAcceptors& nhba)
      {
            this->setName(nhba.getName());
            this->setUnit(nhba.getUnit());
            this->setExpression(nhba.getExpression());
            return *this;
      }

      void NumberOfHydrogenBondAcceptors::setExpression(const String& expression)
      {
            this->expression_ = expression;
      }

00803       const String& NumberOfHydrogenBondAcceptors::getExpression() const
      {
            return this->expression_;
      }

      double NumberOfHydrogenBondAcceptors::compute(AtomContainer& ac)
      {
            if (expression_ != "")
            {
                  Expression ex_acc(expression_);
                  Size num_acc = 0;
                  AtomIterator a_it = ac.beginAtom();
                  BALL_FOREACH_ATOM (ac, a_it)
                  {
                        if (ex_acc(*a_it))
                        {
                              ++num_acc;
                        }
                  }
                  ac.setProperty(this->getName(), (double)num_acc);
            }
            else
            {
                  if (!isValid_(ac))
                  {
                        calculate_(ac);
                  }
            }
            return ac.getProperty(this->getName()).getDouble();
      }

      ///////////////////////////
      // bond polarizabilities
      ///////////////////////////
00837       BondPolarizabilities::BondPolarizabilities()
            :     SimpleBase("BondPolarizabilities", "A^3")
      {
      }

00842       BondPolarizabilities::BondPolarizabilities(const BondPolarizabilities& bp)
            :     SimpleBase(bp)
      {
      }

00847       BondPolarizabilities::~BondPolarizabilities()
      {
      }

00851       BondPolarizabilities& BondPolarizabilities::operator = (const BondPolarizabilities& bp)
      {
            this->setName(bp.getName());
            this->setUnit(bp.getUnit());
            return *this;
      }

      ///////////////////////////
      // atomic polarizabilities
      ///////////////////////////
00861       AtomicPolarizabilities::AtomicPolarizabilities()
            :     SimpleBase("AtomicPolarizabilities", "A^3")
      {
      }

00866       AtomicPolarizabilities::AtomicPolarizabilities(const AtomicPolarizabilities& ap)
            :     SimpleBase(ap)
      {
      }

00871       AtomicPolarizabilities::~AtomicPolarizabilities()
      {
      }

00875       AtomicPolarizabilities& AtomicPolarizabilities::operator = (const AtomicPolarizabilities& ap)
      {
            this->setName(ap.getName());
            this->setUnit(ap.getUnit());
            return *this;
      }

      ////////////////////////////////
      // number of rotatable bonds
      ///////////////////////////////
00885       NumberOfRotatableBonds::NumberOfRotatableBonds()
            :     SimpleBase("NumberOfRotatableBonds", "")
      {
      }
      
00890       NumberOfRotatableBonds::NumberOfRotatableBonds(const NumberOfRotatableBonds& nrb)
            :     SimpleBase(nrb)
      {
      }
      
00895       NumberOfRotatableBonds::~NumberOfRotatableBonds()
      {
      }

00899       NumberOfRotatableBonds& NumberOfRotatableBonds::operator = (const NumberOfRotatableBonds& nrb)
      {
            this->setName(nrb.getName());
            this->setUnit(nrb.getUnit());
            return *this;
      }
      
      //////////////////////////////////////
      // number of rotatable single bonds
      //////////////////////////////////////
00909       NumberOfRotatableSingleBonds::NumberOfRotatableSingleBonds()
            :     SimpleBase("NumberOfRotatableSingleBonds", "")
      {
      }

00914       NumberOfRotatableSingleBonds::NumberOfRotatableSingleBonds(const NumberOfRotatableSingleBonds& nrsb)
            :     SimpleBase(nrsb)
      {
      }
      
00919       NumberOfRotatableSingleBonds::~NumberOfRotatableSingleBonds()
      {
      }

00923       NumberOfRotatableSingleBonds& NumberOfRotatableSingleBonds::operator = (const NumberOfRotatableSingleBonds& nrsb)
      {
            this->setName(nrsb.getName());
            this->setUnit(nrsb.getUnit());
            return *this;
      }

      ///////////////////////////////////
      // relative number of rotatable bonds
      ///////////////////////////////////
00933       RelNumberOfRotatableBonds::RelNumberOfRotatableBonds()
            :     SimpleBase("RelNumberOfRotatableBonds", "")
      {
      }

00938       RelNumberOfRotatableBonds::RelNumberOfRotatableBonds(const RelNumberOfRotatableBonds& rnrb)
            :     SimpleBase(rnrb)
      {
      }

00943       RelNumberOfRotatableBonds::~RelNumberOfRotatableBonds()
      {
      }

00947       RelNumberOfRotatableBonds& RelNumberOfRotatableBonds::operator = (const RelNumberOfRotatableBonds& rnrb)
      {
            this->setName(rnrb.getName());
            this->setUnit(rnrb.getUnit());
            return *this;
      }

      double RelNumberOfRotatableBonds::compute(AtomContainer& ac)
      {
            if (!isValid_(ac))
            {     
                  calculate_(ac);
            }
            double num_bonds =  ac.getProperty("NumberOfBonds").getDouble();
            double num_rot = ac.getProperty("NumberOfRotatableBonds").getDouble();
            return num_bonds != 0 ? num_rot/num_bonds : -1.0;
      }

      //////////////////////////////////////////////////////
      // relative number number of rotatable single bonds
      //////////////////////////////////////////////////////
00968       RelNumberOfRotatableSingleBonds::RelNumberOfRotatableSingleBonds()
            :     SimpleBase("RelNumberOfRotatableSingleBonds", "")
      {
      }

00973       RelNumberOfRotatableSingleBonds::RelNumberOfRotatableSingleBonds(const RelNumberOfRotatableSingleBonds& rnrs)
            :     SimpleBase(rnrs)
      {
      }

00978       RelNumberOfRotatableSingleBonds::~RelNumberOfRotatableSingleBonds()
      {
      }

00982       RelNumberOfRotatableSingleBonds& RelNumberOfRotatableSingleBonds::operator = (const RelNumberOfRotatableSingleBonds& rnrs)
      {
            this->setName(rnrs.getName());
            this->setUnit(rnrs.getUnit());
            return *this;
      }

00989       double RelNumberOfRotatableSingleBonds::compute(AtomContainer& ac)
      {
            if (!isValid_(ac))
            {
                  calculate_(ac);
            }
            double num_bonds = ac.getProperty("NumberOfBonds").getDouble();
            double num_rot = ac.getProperty("NumberOfRotatableSingleBonds").getDouble();
            return num_bonds != 0 ? num_rot/num_bonds : -1.0;
      }

      //////////////////////////////////////
      // mean atom information content
      //////////////////////////////////////
01003       MeanAtomInformationContent::MeanAtomInformationContent()
            :     SimpleBase("MeanAtomInformationContent", "")
      {
      }

01008       MeanAtomInformationContent::MeanAtomInformationContent(const MeanAtomInformationContent& maic)
            :     SimpleBase(maic)
      {
      }

01013       MeanAtomInformationContent::~MeanAtomInformationContent()
      {
      }

01017       MeanAtomInformationContent& MeanAtomInformationContent::operator = (const MeanAtomInformationContent& maic)
      {
            this->setName(maic.getName());
            this->setUnit(maic.getUnit());
            return *this;
      }

      //////////////////////////////////////
      // atom information content
      //////////////////////////////////////
01027       AtomInformationContent::AtomInformationContent()
            :     SimpleBase("AtomInformationContent", "")
      {
      }

01032       AtomInformationContent::AtomInformationContent(const AtomInformationContent& aic)
            :     SimpleBase(aic)
      {
      }

01037       AtomInformationContent::~AtomInformationContent()
      {
      }

01041       AtomInformationContent& AtomInformationContent::operator = (const AtomInformationContent& aic)
      {
            this->setName(aic.getName());
            this->setUnit(aic.getUnit());
            return *this;
      }

      double AtomInformationContent::compute(AtomContainer& ac)
      {
            if (!isValid_(ac))
            {
                  calculate_(ac);
            }
            double num_atoms = ac.getProperty("NumberOfAtoms").getDouble();
            double info_mean = ac.getProperty("MeanAtomInformationContent").getDouble();
            return num_atoms * info_mean;
      }

      //////////////////
      // size of sssr
      //////////////////
01062       SizeOfSSSR::SizeOfSSSR()
            :     SimpleBase("SizeOfSSSR", "")
      {
      }

01067       SizeOfSSSR::SizeOfSSSR(const SizeOfSSSR& sssr)
            :     SimpleBase(sssr)
      {
      }

01072       SizeOfSSSR::~SizeOfSSSR()
      {
      }

01076       SizeOfSSSR& SizeOfSSSR::operator = (const SizeOfSSSR& sssr)
      {
            this->setName(sssr.getName());
            this->setUnit(sssr.getUnit());
            return *this;
      }

      /////////////////////////////////
      // principal moment of inertia
      /////////////////////////////////
01086       PrincipalMomentOfInertia::PrincipalMomentOfInertia()
            :     SimpleBase("PrincipalMomentOfInertia", "uŲ")
      {
      }

01091       PrincipalMomentOfInertia::PrincipalMomentOfInertia(const PrincipalMomentOfInertia& pmi)
            :     SimpleBase(pmi)
      {
      }

01096       PrincipalMomentOfInertia::~PrincipalMomentOfInertia()
      {
      }

01100       PrincipalMomentOfInertia& PrincipalMomentOfInertia::operator = (const PrincipalMomentOfInertia& pmi)
      {
            this->setName(pmi.getName());
            this->setUnit(pmi.getUnit());
            return *this;
      }

      ///////////////////////////////////
      // principal moment of inertia x
      ///////////////////////////////////
01110       PrincipalMomentOfInertiaX::PrincipalMomentOfInertiaX()
            :     SimpleBase("PrincipalMomentOfInertiaX", "uA^2")
      {
      }

01115       PrincipalMomentOfInertiaX::PrincipalMomentOfInertiaX(const PrincipalMomentOfInertiaX& pmix)
            :     SimpleBase(pmix)
      {
      }

01120       PrincipalMomentOfInertiaX::~PrincipalMomentOfInertiaX()
      {
      }

01124       PrincipalMomentOfInertiaX& PrincipalMomentOfInertiaX::operator = (const PrincipalMomentOfInertiaX& pmix)
      {
            this->setName(pmix.getName());
            this->setUnit(pmix.getUnit());
            return *this;
      }

      /////////////////////////////////////
      // principal moment of inertia y
      /////////////////////////////////////
01134       PrincipalMomentOfInertiaY::PrincipalMomentOfInertiaY()
            :     SimpleBase("PrincipalMomentOfInertiaY", "uA^2")
      {
      }

01139       PrincipalMomentOfInertiaY::PrincipalMomentOfInertiaY(const PrincipalMomentOfInertiaY& pmiy)
            :     SimpleBase(pmiy)
      {
      }

01144       PrincipalMomentOfInertiaY::~PrincipalMomentOfInertiaY()
      {
      }

01148       PrincipalMomentOfInertiaY& PrincipalMomentOfInertiaY::operator = (const PrincipalMomentOfInertiaY& pmiy)
      {
            this->setName(pmiy.getName());
            this->setUnit(pmiy.getUnit());
            return *this;
      }

      /////////////////////////////////////
      // principal moment of inertia
      /////////////////////////////////////
01158       PrincipalMomentOfInertiaZ::PrincipalMomentOfInertiaZ()
            :     SimpleBase("PrincipalMomentOfInertiaZ", "uA^2")
      {
      }

01163       PrincipalMomentOfInertiaZ::PrincipalMomentOfInertiaZ(const PrincipalMomentOfInertiaZ& pmiz)
            :     SimpleBase(pmiz)
      {
      }

01168       PrincipalMomentOfInertiaZ::~PrincipalMomentOfInertiaZ()
      {
      }

01172       PrincipalMomentOfInertiaZ& PrincipalMomentOfInertiaZ::operator = (const PrincipalMomentOfInertiaZ& pmiz)
      {
            this->setName(pmiz.getName());
            this->setUnit(pmiz.getUnit());
            return *this;
      }

} // namespace BALL




Generated by  Doxygen 1.6.0   Back to index