stator
A math, geometry, and utility library
Namespaces | Classes | Typedefs | Functions
stator Namespace Reference

The stator library namespace. More...

Namespaces

 detail
 Namespace containing the details of the implmentation for general stator components.
 
 geometry
 Geometric types and algorithms for calculating properties (e.g., intersection, volume).
 
 numeric
 Numerical routines, such as root-finding, etc.
 
 orphan
 Miscellaneous tools and utilities without a particular grouping.
 

Classes

struct  constant
 Physical constants in different floating point representations. More...
 
struct  constant_ratio
 Physical constants approximated in std::ratio representation. More...
 
struct  Debug_output
 
class  Exception
 An exception class that also appears to function like an ostream object. More...
 
struct  Latex_output
 
struct  ReprConfig
 
struct  Rounding_digits
 

Typedefs

using DefaultReprConfig = ReprConfig<>
 
template<typename Scalar , size_t D1, size_t D2>
using Matrix = Eigen::Matrix< Scalar, D1, D2, Eigen::DontAlign >
 A convenience typedef for a non-aligned Eigen Matrix. More...
 
template<typename Scalar , size_t D>
using Vector = Matrix< Scalar, D, 1 >
 A convenience typedef for a non-aligned Eigen Vector. More...
 

Functions

template<class Config = DefaultReprConfig, std::intmax_t Num, std::intmax_t Denom>
std::string repr (const sym::C< Num, Denom >)
 
template<class Config = DefaultReprConfig, class ... Args>
std::string repr (const sym::Var< Args... > &v)
 
template<class Config = DefaultReprConfig, class Var , class Arg >
std::string repr (const sym::Relation< Var, Arg > &sub)
 
template<class Config = DefaultReprConfig, class Arg >
std::string repr (const sym::UnaryOp< Arg, sym::detail::Sine > &f)
 
template<class Config = DefaultReprConfig, class Arg >
std::string repr (const sym::UnaryOp< Arg, sym::detail::Cosine > &f)
 
template<class Config = DefaultReprConfig, class Arg >
std::string repr (const sym::UnaryOp< Arg, sym::detail::Exp > &f)
 
template<class Config = DefaultReprConfig, class Arg >
std::string repr (const sym::UnaryOp< Arg, sym::detail::Log > &f)
 
template<class Config = DefaultReprConfig, class Arg >
std::string repr (const sym::UnaryOp< Arg, sym::detail::Absolute > &f)
 
template<class Config = DefaultReprConfig, class Arg >
std::string repr (const sym::UnaryOp< Arg, sym::detail::Arbsign > &f)
 
template<class Config = DefaultReprConfig, class T , typename = typename std::enable_if<std::is_base_of<Eigen::EigenBase<T>, T>::value>::type>
std::string repr (const T &val)
 
template<class Config = DefaultReprConfig, typename T >
std::enable_if< std::is_integral< T >::value, std::string >::type repr (T a)
 
template<class Config , class Float >
std::enable_if< std::is_floating_point< Float >::value, std::string >::type repr (Float a)
 
template<class Config = DefaultReprConfig, class LHS , class RHS , class Op >
std::string repr (const sym::BinaryOp< LHS, Op, RHS > &op)
 
template<class Config = DefaultReprConfig, class LHS , class RHS >
std::string repr (const sym::BinaryOp< LHS, sym::detail::Power, RHS > &op)
 
template<class Config = DefaultReprConfig, class LHS , class RHS >
std::string repr (const sym::BinaryOp< LHS, sym::detail::Divide, RHS > &op)
 
template<class Config = DefaultReprConfig, class LHS , class RHS >
std::string repr (const sym::BinaryOp< LHS, sym::detail::Multiply, RHS > &op)
 
template<class Config >
std::string repr (const sym::RTBase &b)
 
template<class Config >
std::string repr (const sym::Expr &b)
 
std::pair< std::string, size_t > search_replace (std::string in, const std::string &from, const std::string &to)
 Search and replace elements in a std::string. More...
 
template<typename ... Args>
std::string string_format (const std::string &format, Args ... args)
 A C++ version of snprintf allowing simple formatting of output. format A printf-style formatting string, such as "%.17f %s %g". args The arguments for substitution into the placeholders in the formatting string. More...
 
std::string strip (const std::string &str, const std::string &whitespace=" \)
 A C++ version of python's string trim function str The string to be trimmed. whitespace A string of characters to be treated as whitespace and trimmed from the start and end of the string. More...
 

Detailed Description

Although the stator namespace is used for shared functionality (e.g., stator::Exception), most of the code is implemented under the namespaces stator::sym, stator::geometry, and stator::orphan.

Typedef Documentation

◆ DefaultReprConfig

Definition at line 107 of file repr.hpp.

◆ Matrix

template<typename Scalar , size_t D1, size_t D2>
using stator::Matrix = typedef Eigen::Matrix<Scalar, D1, D2, Eigen::DontAlign>

Definition at line 55 of file config.hpp.

◆ Vector

template<typename Scalar , size_t D>
using stator::Vector = typedef Matrix<Scalar, D, 1>

Definition at line 58 of file config.hpp.

Function Documentation

◆ repr() [1/18]

template<class Config = DefaultReprConfig, std::intmax_t Num, std::intmax_t Denom>
std::string stator::repr ( const sym::C< Num, Denom >  )
inline

Definition at line 24 of file print.hpp.

◆ repr() [2/18]

template<class Config = DefaultReprConfig, class ... Args>
std::string stator::repr ( const sym::Var< Args... > &  v)
inline

Definition at line 34 of file print.hpp.

◆ repr() [3/18]

template<class Config = DefaultReprConfig, class Var , class Arg >
std::string stator::repr ( const sym::Relation< Var, Arg > &  sub)
inline

Definition at line 39 of file print.hpp.

◆ repr() [4/18]

template<class Config = DefaultReprConfig, class Arg >
std::string stator::repr ( const sym::UnaryOp< Arg, sym::detail::Sine > &  f)
inline

Definition at line 44 of file print.hpp.

◆ repr() [5/18]

template<class Config = DefaultReprConfig, class Arg >
std::string stator::repr ( const sym::UnaryOp< Arg, sym::detail::Cosine > &  f)
inline

Definition at line 53 of file print.hpp.

◆ repr() [6/18]

template<class Config = DefaultReprConfig, class Arg >
std::string stator::repr ( const sym::UnaryOp< Arg, sym::detail::Exp > &  f)
inline

Definition at line 62 of file print.hpp.

◆ repr() [7/18]

template<class Config = DefaultReprConfig, class Arg >
std::string stator::repr ( const sym::UnaryOp< Arg, sym::detail::Log > &  f)
inline

Definition at line 72 of file print.hpp.

◆ repr() [8/18]

template<class Config = DefaultReprConfig, class Arg >
std::string stator::repr ( const sym::UnaryOp< Arg, sym::detail::Absolute > &  f)
inline

Definition at line 82 of file print.hpp.

◆ repr() [9/18]

template<class Config = DefaultReprConfig, class Arg >
std::string stator::repr ( const sym::UnaryOp< Arg, sym::detail::Arbsign > &  f)
inline

Definition at line 92 of file print.hpp.

◆ repr() [10/18]

template<class Config = DefaultReprConfig, class T , typename = typename std::enable_if<std::is_base_of<Eigen::EigenBase<T>, T>::value>::type>
std::string stator::repr ( const T &  val)

Definition at line 102 of file print.hpp.

◆ repr() [11/18]

template<class Config = DefaultReprConfig, typename T >
std::enable_if<std::is_integral<T>::value, std::string>::type stator::repr ( a)

Definition at line 111 of file repr.hpp.

◆ repr() [12/18]

template<class Config , class Float >
std::enable_if<std::is_floating_point<Float>::value, std::string>::type stator::repr ( Float  a)
inline

Definition at line 116 of file repr.hpp.

◆ repr() [13/18]

template<class Config = DefaultReprConfig, class LHS , class RHS , class Op >
std::string stator::repr ( const sym::BinaryOp< LHS, Op, RHS > &  op)
inline

Definition at line 207 of file print.hpp.

◆ repr() [14/18]

template<class Config = DefaultReprConfig, class LHS , class RHS >
std::string stator::repr ( const sym::BinaryOp< LHS, sym::detail::Power, RHS > &  op)
inline

Definition at line 222 of file print.hpp.

◆ repr() [15/18]

template<class Config = DefaultReprConfig, class LHS , class RHS >
std::string stator::repr ( const sym::BinaryOp< LHS, sym::detail::Divide, RHS > &  op)
inline

Definition at line 241 of file print.hpp.

◆ repr() [16/18]

template<class Config = DefaultReprConfig, class LHS , class RHS >
std::string stator::repr ( const sym::BinaryOp< LHS, sym::detail::Multiply, RHS > &  op)
inline

Definition at line 259 of file print.hpp.

◆ repr() [17/18]

template<class Config >
std::string stator::repr ( const sym::RTBase b)

Definition at line 293 of file print.hpp.

◆ repr() [18/18]

template<class Config >
std::string stator::repr ( const sym::Expr b)

Definition at line 300 of file print.hpp.

◆ search_replace()

std::pair<std::string, size_t> stator::search_replace ( std::string  in,
const std::string &  from,
const std::string &  to 
)
inline
Parameters
inThe string to search within.
fromA string giving the text sequence to replace.
toA string with the replacement text sequence.
Returns
The string "in" with all occurences of "from" replaced with "to".

Definition at line 65 of file repr.hpp.

◆ string_format()

template<typename ... Args>
std::string stator::string_format ( const std::string &  format,
Args ...  args 
)
Returns
The final resultant string.

Definition at line 51 of file repr.hpp.

◆ strip()

std::string stator::strip ( const std::string &  str,
const std::string &  whitespace = " \t" 
)
inline
Returns
The final resultant string.

Definition at line 33 of file repr.hpp.