Chemical Data Processing Library C++ API - Version 1.1.1
Classes | Typedefs | Enumerations | Functions
CDPL::Util Namespace Reference

Contains general purpose algorithms, containers, functors and other classes. More...

Classes

class  Array
 A dynamic array class providing amortized constant time access to arbitrary elements. More...
 
class  BronKerboschAlgorithm
 Implementation of the Bron-Kerbosch clique-detection algorithm [BKA]. More...
 
class  CompoundDataReader
 CompoundDataReader. More...
 
class  CompressedDataReader
 CompressedDataReader. More...
 
class  CompressedDataWriter
 CompressedDataWriter. More...
 
class  CompressedIOStream
 
struct  CompressionAlgoTraits
 
struct  CompressionAlgoTraits< BZIP2 >
 
struct  CompressionAlgoTraits< GZIP >
 
class  CompressionOStream
 
class  CompressionStreamBase
 
class  DecompressionIStream
 
class  DefaultDataInputHandler
 DefaultDataInputHandler. More...
 
class  DefaultDataOutputHandler
 DefaultDataOutputHandler. More...
 
struct  Dereferencer
 An unary functor for the dereferenciation of pointers without null pointer checking. More...
 
class  DGCoordinatesGenerator
 Generic implementation for generation of coordinates that fulfill user-provided point distance constraints [ASPE]. More...
 
class  DGCoordinatesGenerator< 3, T >
 Specialized implementation for the generation of 3D coordinates that fulfill user-provided point distance and volume constraints [ASPE]. More...
 
class  DGCoordinatesGeneratorBase
 Base for classes dedicated to the generation of coordinates that fulfill user-provided point distance (and volume) constraints [ASPE]. More...
 
class  FileDataReader
 FileDataReader. More...
 
class  FileDataWriter
 FileDataWriter. More...
 
class  FileRemover
 
class  IndexedElementIterator
 A STL compatible random access iterator for container elements accessible by index. More...
 
class  IndirectArray
 A dynamic array class for the storage of object pointers with an indirected query interface. More...
 
class  Map
 A unique sorted associative container that maps keys to values. More...
 
struct  MapDefaultValue
 
struct  MapDefaultValue< ValueType, false >
 
class  MultiFormatDataReader
 MultiFormatDataReader. More...
 
class  MultiFormatDataWriter
 MultiFormatDataWriter. More...
 
class  MultiMap
 A multiple sorted associative container that maps keys to values. More...
 
struct  MultiMapDefaultValue
 
struct  MultiMapDefaultValue< ValueType, false >
 
struct  NullCheckDereferencer
 An unary functor for the dereferenciation of pointers with null pointer checking. More...
 
class  ObjectPool
 A data structure that caches instances of type T up to a user specified amount. More...
 
class  ObjectStack
 ObjectStack. More...
 
class  PropertyValue
 An unary functor that retrieves the value of a given property from the Base::PropertyContainer instance provided as argument. More...
 
class  PropertyValueProduct
 A binary functor that calculates the product of two property values retrieved from a pair of Base::PropertyContainer instances passed as argument. More...
 
class  StreamDataReader
 A helper class that implements Base::DataReader for std::istream based data readers. More...
 

Typedefs

typedef Array< unsigned int > UIArray
 An array of unsigned integers. More...
 
typedef Array< std::size_t > STArray
 An array of unsigned integers of type std::size_t. More...
 
typedef Array< long > LArray
 An array of unsigned integers of type long. More...
 
typedef std::pair< std::size_t, std::size_t > STPair
 A pair of unsigned integers of type std::size_t. More...
 
typedef Array< STPairSTPairArray
 An array of pairs of unsigned integers of type std::size_t. More...
 
typedef Array< doubleDArray
 An array of double precision floating-point numbers. More...
 
typedef Array< std::string > SArray
 An array of std::string objects. More...
 
typedef Array< BitSetBitSetArray
 An array of Util::BitSet objects. More...
 
typedef boost::dynamic_bitset BitSet
 A dynamic bitset class. More...
 
typedef DecompressionIStream< GZIPGZipIStream
 
typedef DecompressionIStream< BZIP2BZip2IStream
 
typedef CompressionOStream< GZIPGZipOStream
 
typedef CompressionOStream< BZIP2BZip2OStream
 
typedef CompressedIOStream< GZIPGZipIOStream
 
typedef CompressedIOStream< BZIP2BZip2IOStream
 
typedef DGCoordinatesGenerator< 3, doubleDG3DCoordinatesGenerator
 

Enumerations

enum  CompressionAlgo {
  GZIP,
  BZIP2
}
 

Functions

template<typename ValueType >
bool operator== (const Array< ValueType > &array1, const Array< ValueType > &array2)
 Equality comparison operator. More...
 
template<typename ValueType >
bool operator!= (const Array< ValueType > &array1, const Array< ValueType > &array2)
 Inequality comparison operator. More...
 
template<typename ValueType >
bool operator<= (const Array< ValueType > &array1, const Array< ValueType > &array2)
 Less or equal comparison operator. More...
 
template<typename ValueType >
bool operator>= (const Array< ValueType > &array1, const Array< ValueType > &array2)
 Greater or equal comparison operator. More...
 
template<typename ValueType >
bool operator< (const Array< ValueType > &array1, const Array< ValueType > &array2)
 Less than comparison operator. More...
 
template<typename ValueType >
bool operator> (const Array< ValueType > &array1, const Array< ValueType > &array2)
 Greater than comparison operator. More...
 
void fold (BitSet &bs, std::size_t num_times)
 Folds the bitset bs the specified number of times. More...
 
CDPL_UTIL_API std::string genCheckedTempFilePath (const std::string &dir="", const std::string &ptn="%%%%-%%%%-%%%%-%%%%")
 
CDPL_UTIL_API bool checkIfSameFile (const std::string &path1, const std::string &path2)
 
CDPL_UTIL_API bool fileExists (const std::string &path)
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator== (const Map< Key, Value, AllowDefValues, KeyCompFunc > &map1, const Map< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Equality comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator!= (const Map< Key, Value, AllowDefValues, KeyCompFunc > &map1, const Map< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Inequality comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator<= (const Map< Key, Value, AllowDefValues, KeyCompFunc > &map1, const Map< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Less or equal comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator>= (const Map< Key, Value, AllowDefValues, KeyCompFunc > &map1, const Map< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Greater or equal comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator< (const Map< Key, Value, AllowDefValues, KeyCompFunc > &map1, const Map< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Less than comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator> (const Map< Key, Value, AllowDefValues, KeyCompFunc > &map1, const Map< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Greater than comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator== (const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map1, const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Equality comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator!= (const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map1, const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Inequality comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator<= (const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map1, const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Less or equal comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator>= (const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map1, const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Greater or equal comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator< (const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map1, const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Less than comparison operator. More...
 
template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool operator> (const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map1, const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &map2)
 Greater than comparison operator. More...
 
template<typename InputIt1 , typename InputIt2 , typename BinaryFunc >
void forEachPair (InputIt1 it1, InputIt1 end1, InputIt2 it2, BinaryFunc func)
 
template<typename InputIt1 , typename InputIt2 , typename BinaryFunc >
void forEachPair (InputIt1 it1, InputIt1 end1, InputIt2 it2, InputIt2 end2, BinaryFunc func)
 

Detailed Description

Contains general purpose algorithms, containers, functors and other classes.

Typedef Documentation

◆ UIArray

typedef Array<unsigned int> CDPL::Util::UIArray

An array of unsigned integers.

◆ STArray

typedef Array<std::size_t> CDPL::Util::STArray

An array of unsigned integers of type std::size_t.

◆ LArray

typedef Array<long> CDPL::Util::LArray

An array of unsigned integers of type long.

◆ STPair

typedef std::pair<std::size_t, std::size_t> CDPL::Util::STPair

A pair of unsigned integers of type std::size_t.

◆ STPairArray

An array of pairs of unsigned integers of type std::size_t.

◆ DArray

An array of double precision floating-point numbers.

◆ SArray

typedef Array<std::string> CDPL::Util::SArray

An array of std::string objects.

◆ BitSetArray

An array of Util::BitSet objects.

◆ BitSet

typedef boost::dynamic_bitset CDPL::Util::BitSet

A dynamic bitset class.

For further information see [BDBS].

◆ GZipIStream

◆ BZip2IStream

◆ GZipOStream

◆ BZip2OStream

◆ GZipIOStream

◆ BZip2IOStream

◆ DG3DCoordinatesGenerator

Enumeration Type Documentation

◆ CompressionAlgo

Enumerator
GZIP 
BZIP2 

Function Documentation

◆ operator==() [1/3]

template<typename ValueType >
bool CDPL::Util::operator== ( const Array< ValueType > &  array1,
const Array< ValueType > &  array2 
)

Equality comparison operator.

Parameters
array1The first array.
array2The second array.
Returns
true if the sizes and elements of the arrays are equal, and false otherwise.

◆ operator!=() [1/3]

template<typename ValueType >
bool CDPL::Util::operator!= ( const Array< ValueType > &  array1,
const Array< ValueType > &  array2 
)

Inequality comparison operator.

Parameters
array1The first array.
array2The second array.
Returns
true if the sizes or elements of the arrays are non-equal, and false otherwise.

◆ operator<=() [1/3]

template<typename ValueType >
bool CDPL::Util::operator<= ( const Array< ValueType > &  array1,
const Array< ValueType > &  array2 
)

Less or equal comparison operator.

Parameters
array1The first array.
array2The second array.
Returns
true if array1 is lexicographically less than or equal to array2, and false otherwise.

◆ operator>=() [1/3]

template<typename ValueType >
bool CDPL::Util::operator>= ( const Array< ValueType > &  array1,
const Array< ValueType > &  array2 
)

Greater or equal comparison operator.

Parameters
array1The first array.
array2The second array.
Returns
true if array1 is lexicographically greater than or equal to array2, and false otherwise.

◆ operator<() [1/3]

template<typename ValueType >
bool CDPL::Util::operator< ( const Array< ValueType > &  array1,
const Array< ValueType > &  array2 
)

Less than comparison operator.

Parameters
array1The first array.
array2The second array.
Returns
true if array1 is lexicographically less than array2, and false otherwise.

◆ operator>() [1/3]

template<typename ValueType >
bool CDPL::Util::operator> ( const Array< ValueType > &  array1,
const Array< ValueType > &  array2 
)

Greater than comparison operator.

Parameters
array1The first array.
array2The second array.
Returns
true if array1 is lexicographically greater than array2, and false otherwise.

◆ fold()

void CDPL::Util::fold ( BitSet bs,
std::size_t  num_times 
)
inline

Folds the bitset bs the specified number of times.

Folding a bitset means that the lower and upper half of the bitset are combined by a logical OR operation to produce a new bitset which is half of the original size. This process is repeated the specified number of times. See also [DTPFP].

Parameters
bsThe bitset to fold.
num_timesThe number of times the bitset has to be folded.

◆ genCheckedTempFilePath()

CDPL_UTIL_API std::string CDPL::Util::genCheckedTempFilePath ( const std::string &  dir = "",
const std::string &  ptn = "%%%%-%%%%-%%%%-%%%%" 
)

◆ checkIfSameFile()

CDPL_UTIL_API bool CDPL::Util::checkIfSameFile ( const std::string &  path1,
const std::string &  path2 
)

◆ fileExists()

CDPL_UTIL_API bool CDPL::Util::fileExists ( const std::string &  path)

◆ operator==() [2/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator== ( const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Equality comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if the sizes and elements of the maps are equal, and false otherwise.

◆ operator!=() [2/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator!= ( const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Inequality comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if the sizes or elements of the maps are non-equal, and false otherwise.

◆ operator<=() [2/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator<= ( const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Less or equal comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if map1 is lexicographically less than or equal to map2, and false otherwise.

◆ operator>=() [2/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator>= ( const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Greater or equal comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if map1 is lexicographically greater than or equal to map2, and false otherwise.

◆ operator<() [2/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator< ( const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Less than comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if map1 is lexicographically less than map2, and false otherwise.

◆ operator>() [2/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator> ( const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const Map< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Greater than comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if map1 is lexicographically greater than map2, and false otherwise.

◆ operator==() [3/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator== ( const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Equality comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if the sizes and elements of the maps are equal, and false otherwise.

◆ operator!=() [3/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator!= ( const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Inequality comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if the sizes or elements of the maps are non-equal, and false otherwise.

◆ operator<=() [3/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator<= ( const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Less or equal comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if map1 is lexicographically less than or equal to map2, and false otherwise.

◆ operator>=() [3/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator>= ( const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Greater or equal comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if map1 is lexicographically greater than or equal to map2, and false otherwise.

◆ operator<() [3/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator< ( const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Less than comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if map1 is lexicographically less than map2, and false otherwise.

◆ operator>() [3/3]

template<typename Key , typename Value , bool AllowDefValues, typename KeyCompFunc >
bool CDPL::Util::operator> ( const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map1,
const MultiMap< Key, Value, AllowDefValues, KeyCompFunc > &  map2 
)

Greater than comparison operator.

Parameters
map1The first map.
map2The second map.
Returns
true if map1 is lexicographically greater than map2, and false otherwise.

◆ forEachPair() [1/2]

template<typename InputIt1 , typename InputIt2 , typename BinaryFunc >
void CDPL::Util::forEachPair ( InputIt1  it1,
InputIt1  end1,
InputIt2  it2,
BinaryFunc  func 
)

◆ forEachPair() [2/2]

template<typename InputIt1 , typename InputIt2 , typename BinaryFunc >
void CDPL::Util::forEachPair ( InputIt1  it1,
InputIt1  end1,
InputIt2  it2,
InputIt2  end2,
BinaryFunc  func 
)