Templates -- Meow  1.1.2
不能,也不應該先編譯成obj-file的templates
utility.h File Reference
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cmath>

Go to the source code of this file.

Namespaces

namespace  meow
 

Functions

template<class T >
meow::noEPS (T value, T eps=1e-9)
 如果abs(輸入的數值) < eps, 則回傳0, 否則回傳輸入的數值 More...
 
template<class T >
meow::normalize (T lower, T upper, T value)
 (value-lower)/(upper-lower) More...
 
template<class T >
meow::denormalize (T lower, T upper, T _ratio)
 (lower+_ratio*(upper-lower)) More...
 
template<class T >
meow::ratioMapping (T l1, T u1, T m1, T l2, T u2)
 denormalize(l2,u2,normalize(l1,u1,m1)) More...
 
template<class T >
meow::inRange (T const &mn, T const &mx, T const &v)
 std::min(mx,std::max(mn,v)) More...
 
template<class T >
meow::squ (T const &x)
 x*x More...
 
template<class T >
meow::cub (T const &x)
 x*x*x More...
 
template<class T >
double meow::average (T const &beg, T const &end, double sigs)
 只將 sigs 個標準差以內的數據拿來取平均 More...
 
template<class T >
double meow::average (T const &beg, T const &end, T const &p, double sigs)
 只將 sigs 個標準差以內的數據拿來取平均, 不過這次用 p 來加權平均 More...
 
template<class T >
meow::tAbs (T const &t)
 就只是個取絕對值 More...
 

Variables

static const double meow::PI = 3.14159265358979323846264338327950288
 圓周率... More...