ecl_math Documentation


This package provides simple support to cmath, filling in holes or redefining in a c++ formulation where desirable.


This group includes various mathematical macros, constants and utility functions/functors.


Include the following at the top of any translation unit which requires this library:

        #include <ecl/math.hpp>

        // constants
        using ecl::pi; // also pi_2, pi_4
        // simple functions
        using ecl::EuclideanNorm;
        using ecl::isApprox;
        using ecl::isApproxOrLessThan;
        using ecl::sign; // also psign 
        using ecl::cube_root; // only for real numbers/solutions

Since it is a collection of macros and headers only, no linking is required if you are only utilising this functionality.


Macros for PI

Usually there will always be macros for pi defined in math.h, namely M_PI, M_PI_2, etc... (sometimes they're unavailable, e.g. windoze!). For typesafe definitions, the ecl defines a couple of these similarly in the ecl::math namespace.

Simple Functions

Various regularly used functions are also present - usually in the form of functors (useful for passing around should it ever be necessary).



Author(s): Daniel Stonier
autogenerated on Mon Jul 3 2017 02:21:34