Chemical Data Processing Library Python API - Version 1.4.0
Classes | Functions
CDPL.Util Package Reference

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

Classes

class  BZip2IOStream
 Bidirectional stream that transparently (de)compresses bzip2 data. More...
 
class  BZip2IStream
 Input stream that transparently decompresses bzip2-compressed data. More...
 
class  BZip2OStream
 Output stream that transparently writes bzip2-compressed data. More...
 
class  BitSet
 Dynamic bitset class. More...
 
class  BitSetArray
 Array storing Util.BitSet objects. More...
 
class  BronKerboschAlgorithm
 Implementation of the Bron-Kerbosch clique-detection algorithm [BKA]. More...
 
class  DArray
 Array storing floating point values of type double. More...
 
class  DG2DCoordinatesGenerator
 
class  DG3DCoordinatesGenerator
 Convenience alias for the 3D coordinates generator with double-precision values. More...
 
class  GZipIOStream
 Bidirectional stream that transparently (de)compresses gzip data. More...
 
class  GZipIStream
 Input stream that transparently decompresses gzip-compressed data. More...
 
class  GZipOStream
 Output stream that transparently writes gzip-compressed data. More...
 
class  LArray
 Array storing integers of type long. More...
 
class  PropertyValue
 Unary functor that retrieves the value of a given property from the Base.PropertyContainer instance provided as argument. More...
 
class  PropertyValueProduct
 Binary functor that calculates the product of two property values retrieved from a pair of Base.PropertyContainer instances passed as argument. More...
 
class  SArray
 Array storing std::string objects. More...
 
class  STArray
 Array storing unsigned integers of type std::size_t. More...
 
class  STPair
 Pair of unsigned integers of type std::size_t. More...
 
class  STPairArray
 Array storing pairs of unsigned integers of type std::size_t. More...
 
class  UIArray
 Array storing unsigned integers of type unsigned int. More...
 

Functions

bool checkIfSameFile (str path1, str path2)
 Tells whether path1 and path2 refer to the same file (after resolving symlinks and case-insensitivity rules of the underlying file system). More...
 
bool fileExists (str path)
 Tells whether the file at path exists. More...
 
None fold (BitSet bs, int num_times)
 Folds the bitset bs the specified number of times. More...
 
None forEachPair (object seq1, object seq2, object func)
 
None forEach (object seq, object func)
 
str genCheckedTempFilePath (str dir='', str ptn='%%%%-%%%%-%%%%-%%%%')
 Generates a temporary file path inside dir whose basename matches the supplied randomization ptn and that is guaranteed not to collide with any existing file. More...
 

Detailed Description

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

Function Documentation

◆ checkIfSameFile()

bool CDPL.Util.checkIfSameFile ( str  path1,
str  path2 
)

Tells whether path1 and path2 refer to the same file (after resolving symlinks and case-insensitivity rules of the underlying file system).

Parameters
path1The first file-system path.
path2The second file-system path.
Returns
True if both paths resolve to the same file, and False otherwise.

◆ fileExists()

bool CDPL.Util.fileExists ( str  path)

Tells whether the file at path exists.

Parameters
pathThe file-system path to test.
Returns
True if the file exists, and False otherwise.

◆ fold()

None CDPL.Util.fold ( BitSet  bs,
int  num_times 
)

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.

◆ forEachPair()

None CDPL.Util.forEachPair ( object  seq1,
object  seq2,
object  func 
)
Parameters
seq1
seq2
func

◆ forEach()

None CDPL.Util.forEach ( object  seq,
object  func 
)
Parameters
seq
func

◆ genCheckedTempFilePath()

str CDPL.Util.genCheckedTempFilePath ( str   dir = '',
str   ptn = '%%%%-%%%%-%%%%-%%%%' 
)

Generates a temporary file path inside dir whose basename matches the supplied randomization ptn and that is guaranteed not to collide with any existing file.

Parameters
dirThe directory in which to place the file (an empty string selects the platform's temporary directory).
ptnThe Boost-filesystem-style randomization pattern for the basename (% characters are replaced with random hex digits).
Returns
The generated unique file-system path.