00001 #ifndef SYNAPS_ARITHM_NORM_H
00002 #define SYNAPS_ARITHM_NORM_H
00003
00004 #include <complex>
00005 #include <synaps/init.h>
00006
00007
00008 __BEGIN_NAMESPACE_SYNAPS
00009
00010 inline float Norm(float s) {return std::fabs(s);}
00011 inline double Norm(double s) {return std::fabs(s);}
00012
00013 template<class R> unsigned size(const R & x) {return x.size();}
00014 inline float size(float s) {return std::fabs(s);}
00015 inline long size(long s) {return std::abs(s);}
00016 inline double size(const double & s) {return fabs(s);}
00017 inline double size(const std::complex<double> & s) {return fabs(s.real()) +fabs(s.imag());}
00018 inline double Size( double s ) { return Norm(s); };
00019
00020
00021 __END_NAMESPACE_SYNAPS
00022
00023 #endif // SYNAPS_ARITHM_NORM_H