Page MenuHomec4science

common.hpp
No OneTemporary

File Metadata

Created
Wed, May 29, 16:26

common.hpp

#ifndef SPECMICP_COMMON_HPP
#define SPECMICP_COMMON_HPP
#include <Eigen/Core>
#include "boost/range/irange.hpp"
namespace specmicp {
//! type of an index
using index_t = std::ptrdiff_t;
using uindex_t = std::size_t;
//! type of a scalar
using scalar_t = double;
// linear algebra
//! A vector
using Vector = Eigen::Matrix<scalar_t, Eigen::Dynamic, 1>;
//! A matrix
using Matrix = Eigen::Matrix<scalar_t, Eigen::Dynamic, Eigen::Dynamic>;
//! \brief Range
//!
//! used to access all species of a certain types
using range_t = boost::iterator_range<boost::range_detail::integer_iterator<index_t>>;
// constants
//! Id of an equation that is not an equation
const index_t no_equation = -1;
//! Id of a non-existant species
const index_t no_species = -1;
//! Precision used to compute jacobian
const scalar_t eps_jacobian = 1e-8;
} // namespace specmicp
// macros
// ------
#ifdef SPECMICP_NO_DEBUG
#define specmicp_assert
#else
#define specmicp_assert(x) assert(x)
#endif // SPECMICP_NO_DEBUG
#endif // SPECMICP_COMMON_HPP

Event Timeline