IntaRNA 3.4.1
RNA-RNA interaction prediction | C++ API
Loading...
Searching...
No Matches
Namespaces | Macros | Typedefs | Functions | Variables
general.h File Reference
#include "IntaRNA/intarna_config.h"
#include <algorithm>
#include <cassert>
#include "easylogging++.h"
#include <stdexcept>
#include <boost/lexical_cast.hpp>
#include <cmath>
#include <limits>
#include <iostream>
#include <string>
Include dependency graph for general.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  IntaRNA
 

Macros

#define INTARNA_IN_DEBUG_MODE   1
 central flag whether or not debug mode is enabled
 
#define INTARNA_NOT_IMPLEMENTED(message)
 
#define INTARNA_CHECK_NOT_NULL(pointer, message)
 
#define toString(x)   boost::lexical_cast<std::string>(x)
 
#define Z_log   std::log
 
#define Z_exp   std::exp
 
#define IntaRNA_precisionEpsilon   std::sqrt(std::numeric_limits<float>::min())
 
#define E_2_Ekcal(e)   ( static_cast<E_kcal_type>(e) / 100.0 )
 convert internal energy type to energy value in kcal/mol units
 
#define Ekcal_2_E(e)   ( static_cast<E_type>(e * 100) )
 convert energy in kcal/mol units to internal energy type
 
#define E_2_Z(e)   ( static_cast<Z_type>(e) / 100.0 )
 convert E_type to Z_type
 
#define Z_2_E(e)   ( static_cast<E_type>(e * 100) )
 convert Z_type to E_type
 
#define E_equal(e1, e2)   ( e1 == e2 )
 check if two energies are equal
 
#define E_isNotINF(e)   ( E_INF > e )
 check if a given energy is NOT set to E_INF
 
#define E_isINF(e)   ( E_INF <= e )
 check if a given energy is set to E_INF
 
#define Z_equal(e1, e2)   ( std::abs((e1)-(e2)) < IntaRNA_precisionEpsilon)
 check if two energies are equal according to some epsilon
 
#define Z_isNotINF(e)   ( std::numeric_limits<Z_type>::max() >= e )
 check if a given energy is NOT set to Z_INF
 
#define Z_isINF(e)   ( std::numeric_limits<Z_type>::max() < e )
 check if a given energy is set to Z_INF
 

Typedefs

typedef float IntaRNA::E_kcal_type
 type for energy values in kcal/mol units for in-/output only
 
typedef int IntaRNA::E_type
 type for energy values (energy + accessibility [ED]) (internally)
 
typedef double IntaRNA::Z_type
 type for probabilities, RT and Boltzmann values
 

Functions

template<class T >
void INTARNA_CLEANUP (T *&pointer)
 
std::ostream * IntaRNA::newOutputStream (const std::string &outName)
 
void IntaRNA::deleteOutputStream (std::ostream *&outStream)
 
std::istream * IntaRNA::newInputStream (const std::string &inName)
 
void IntaRNA::deleteInputStream (std::istream *&inStream)
 

Variables

const E_type IntaRNA::E_INF = (std::numeric_limits<E_type>::max() / 8) + 1
 
const E_type IntaRNA::E_MAX = E_INF / 2
 
const Z_type IntaRNA::Z_INF = std::numeric_limits<Z_type>::infinity()
 

Macro Definition Documentation

◆ E_2_Ekcal

#define E_2_Ekcal (   e)    ( static_cast<E_kcal_type>(e) / 100.0 )

convert internal energy type to energy value in kcal/mol units

◆ E_2_Z

#define E_2_Z (   e)    ( static_cast<Z_type>(e) / 100.0 )

convert E_type to Z_type

◆ E_equal

#define E_equal (   e1,
  e2 
)    ( e1 == e2 )

check if two energies are equal

◆ E_isINF

#define E_isINF (   e)    ( E_INF <= e )

check if a given energy is set to E_INF

◆ E_isNotINF

#define E_isNotINF (   e)    ( E_INF > e )

check if a given energy is NOT set to E_INF

◆ Ekcal_2_E

#define Ekcal_2_E (   e)    ( static_cast<E_type>(e * 100) )

convert energy in kcal/mol units to internal energy type

◆ INTARNA_CHECK_NOT_NULL

#define INTARNA_CHECK_NOT_NULL (   pointer,
  message 
)
Value:
if (pointer == NULL) { \
throw std::runtime_error( \
std::string("\nSTOP DUE TO NULL POINTER : ") \
+ message \
); }

◆ INTARNA_IN_DEBUG_MODE

#define INTARNA_IN_DEBUG_MODE   1

central flag whether or not debug mode is enabled

◆ INTARNA_NOT_IMPLEMENTED

#define INTARNA_NOT_IMPLEMENTED (   message)
Value:
throw std::runtime_error( \
std::string("\nSTOP DUE TO MISSING IMPLEMENTATION : ") \
+ message \
);

◆ IntaRNA_precisionEpsilon

#define IntaRNA_precisionEpsilon   std::sqrt(std::numeric_limits<float>::min())

the delta difference range to consider two floating point values equivalent using sqrt(representable positive value closest to zero)

◆ toString

#define toString (   x)    boost::lexical_cast<std::string>(x)

◆ Z_2_E

#define Z_2_E (   e)    ( static_cast<E_type>(e * 100) )

convert Z_type to E_type

◆ Z_equal

#define Z_equal (   e1,
  e2 
)    ( std::abs((e1)-(e2)) < IntaRNA_precisionEpsilon)

check if two energies are equal according to some epsilon

◆ Z_exp

#define Z_exp   std::exp

◆ Z_isINF

#define Z_isINF (   e)    ( std::numeric_limits<Z_type>::max() < e )

check if a given energy is set to Z_INF

◆ Z_isNotINF

#define Z_isNotINF (   e)    ( std::numeric_limits<Z_type>::max() >= e )

check if a given energy is NOT set to Z_INF

◆ Z_log

#define Z_log   std::log

Function Documentation

◆ INTARNA_CLEANUP()

template<class T >
void INTARNA_CLEANUP ( T *&  pointer)