RDCode: Invariant.h File Reference

# Invariant.h File Reference

`#include <assert.h>`
`#include <string>`
`#include <iostream>`
`#include <stdexcept>`
`#include <RDGeneral/RDLog.h>`

Go to the source code of this file.

## Namespaces
namespace | Invar
## Classes
class | Invar::Invariant
## Defines
#define | INVARIANT_EXCEPTION_METHOD 1
#define | ASSERT_INVARIANT(expr, mess) assert( expr )
#define | CHECK_INVARIANT(expr, mess)
#define | PRECONDITION(expr, mess)
#define | POSTCONDITION(expr, mess)
#define | UNDER_CONSTRUCTION(fn)
#define | RANGE_CHECK(lo, x, hi)
#define | TEST_ASSERT(expr)
## Functions
std::ostream & | Invar::operator<< (std::ostream &s, Invariant &inv)

## Define Documentation

#define ASSERT_INVARIANT | ( | expr,
|  | mess |  | ) | assert( expr )

Definition at line 102 of file Invariant.h.

#define CHECK_INVARIANT | ( | expr,
|  | mess |  | ) |

Value:

    if ( !(expr) ) {\
         Invar::Invariant inv( "Invariant Violation", mess, \
         #expr, __FILE__, __LINE__ ); \
         BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv; }

Definition at line 111 of file Invariant.h.

Referenced by RDKit::appendPackedIntToStream(), RDNumeric::Vector< TYPE >::assign(), RDNumeric::Matrix< double >::assign(), RDDataManip::MetricMatrixCalc< vectType, entryType >::calcMetricMatrix(), DistGeom::ChiralSet::ChiralSet(), RDKit::countSwapsToInterconvert(), RDNumeric::Vector< TYPE >::dotProduct(), RDNumeric::SymmMatrix< TYPE >::getCol(), RDNumeric::Matrix< double >::getCol(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::getEntriesOfOrder(), RDNumeric::SymmMatrix< TYPE >::getRow(), RDNumeric::Matrix< double >::getRow(), RDPickers::MaxMinPicker::lazyPick(), RDNumeric::multiply(), RDNumeric::SymmMatrix< TYPE >::operator*=(), RDNumeric::SquareMatrix< double >::operator*=(), RDNumeric::Vector< TYPE >::operator+=(), RDNumeric::SymmMatrix< TYPE >::operator+=(), RDNumeric::Matrix< double >::operator+=(), RDNumeric::Vector< TYPE >::operator-=(), RDNumeric::SymmMatrix< TYPE >::operator-=(), RDNumeric::Matrix< double >::operator-=(), RDPickers::MaxMinPicker::pick(), DistGeom::BoundsMatrix::setLowerBound(), DistGeom::BoundsMatrix::setUpperBound(), RDNumeric::SymmMatrix< TYPE >::transpose(), and RDNumeric::Matrix< double >::transpose().

#define INVARIANT_EXCEPTION_METHOD 1

Definition at line 22 of file Invariant.h.

#define POSTCONDITION | ( | expr,
|  | mess |  | ) |

Value:

    if ( !(expr) ) { \
         Invar::Invariant inv( "Post-condition Violation", mess, \
         #expr, __FILE__, __LINE__ );\
         BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv; }

Definition at line 121 of file Invariant.h.

Referenced by RDGeom::Point3D::getPerpendicular(), and PySequenceHolder< T >::operator[]().

#define PRECONDITION | ( | expr,
|  | mess |  | ) |

Value:

    if ( !(expr) ) {\
         Invar::Invariant inv( "Pre-condition Violation", mess, \
         #expr, __FILE__, __LINE__ ); \
         BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv; }

Definition at line 116 of file Invariant.h.

Referenced by RDCatalog::HierarchCatalog< entryType, paramType, orderType >::addEntry(), RDKit::countSwapsToInterconvert(), RDGeom::PointND::directionVector(), RDKit::TDTWriter::flush(), RDKit::SDWriter::flush(), RDKit::SmilesWriter::flush(), DistGeom::FourthDimContrib::FourthDimContrib(), RDKit::PeriodicTable::getAtomicNumber(), RDKit::PeriodicTable::getAtomicWeight(), RDKit::PeriodicTable::getDefaultValence(), RDKit::PeriodicTable::getElementSymbol(), RDDepict::EmbeddedFrag::GetEmbeddedAtom(), DistGeom::FourthDimContrib::getEnergy(), DistGeom::FourthDimContrib::getGrad(), RDFeatures::ImplicitFeature< FAMILYMARKER, TYPEMARKER, LOCTYPE >::getLoc(), RDKit::PeriodicTable::getNouterElecs(), RDKit::Bond::getProp(), RDKit::PeriodicTable::getRb0(), RDKit::PeriodicTable::getRcovalent(), RDKit::PeriodicTable::getRvdw(), RDKit::PeriodicTable::getValenceList(), RDKit::PeriodicTable::moreElectroNegative(), RDGeom::UniformGrid3D::operator &(), RDGeom::Point2D::operator[](), RDGeom::Point3D::operator[](), RankAtoms::rankVect(), RDCatalog::Catalog< entryType, orderType >::setCatalogParams(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::toStream(), and Queries::Query< const int, Atom *, needsConversion >::TypeConvert().

#define RANGE_CHECK | ( | lo,
|  | x,
|  | hi |  | ) |

Value:

    if ( (lo)>(hi) || (x)<(lo) || (x)>(hi) ) {\
         std::stringstream errstr;\
         errstr << lo << " <= " << x <<" <= "<<hi;\
         Invar::Invariant inv( "Range Error", #x, errstr.str().c_str(), __FILE__, __LINE__ );\
         BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv; }

Definition at line 130 of file Invariant.h.

Referenced by RDCatalog::HierarchCatalog< entryType, paramType, orderType >::addEdge(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::getEntryWithBitId(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::getEntryWithIdx(), RDCatalog::HierarchCatalog< entryType, paramType, orderType >::getIdOfEntryWithBitId(), DistGeom::BoundsMatrix::getLowerBound(), RDNumeric::Matrix< double >::getRow(), DistGeom::BoundsMatrix::getUpperBound(), RDNumeric::Vector< TYPE >::getVal(), RDNumeric::SymmMatrix< TYPE >::getVal(), RDNumeric::Matrix< double >::getVal(), RDNumeric::Vector< TYPE >::operator[](), DistGeom::BoundsMatrix::setLowerBound(), DistGeom::BoundsMatrix::setUpperBound(), RDNumeric::Vector< TYPE >::setVal(), RDNumeric::SymmMatrix< TYPE >::setVal(), and RDNumeric::Matrix< double >::setVal().

#define TEST_ASSERT | ( | expr |  | ) |

Value:

    if ( !(expr) ) {\
         Invar::Invariant inv( "Test Assert", "Expression Failed: ", \
         #expr, __FILE__, __LINE__ ); \
         BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv; }

Definition at line 136 of file Invariant.h.

#define UNDER_CONSTRUCTION | ( | fn |  | ) |

Value:

    Invar::Invariant inv( "Incomplete Code", \
         "This routine is still under development", fn, __FILE__, __LINE__ ); \
         BOOST_LOG(rdErrorLog) << "\n\n****\n" << inv << "****\n\n"; throw inv;

Definition at line 126 of file Invariant.h.