Changeset 1226 in Sophya for trunk/SophyaLib
- Timestamp:
- Oct 11, 2000, 7:28:52 PM (25 years ago)
- Location:
- trunk/SophyaLib/TArray
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/matharr.cc
r1156 r1226 148 148 mean /= dsz; 149 149 sig = sig/dsz - mean*mean; 150 #if !defined(__GNUG__) && !defined (__MWERKS__)151 150 if (sig >= 0.) sig = sqrt(sig); 152 #else153 #if defined (__MWERKS__)154 // le std pour que CW comprenne que sqrt(double) vient de math.h!155 if (sig >= 0.) sig = std::sqrt(sig);156 #else157 // va comprendre pourquoi g++ veut ca pour faire la generation158 // de template !!!!159 if (sig >= 0.) sig = _Sqrt_(sig);160 #endif161 #endif162 151 return(mean); 163 152 } -
trunk/SophyaLib/TArray/matharr.h
r958 r1226 30 30 // Calcul de fonctions usuelles 31 31 32 // #if !defined(OS_LINUX) && !defined (__KCC__)33 #if !defined(__GNUG__)34 32 // see below for g++ 35 /*! \ingroup TArray \fn fabs(const TArray<T>& a)33 /*! \ingroup TArray \fn Fabs(const TArray<T>& a) 36 34 \brief computation on TArray */ 37 35 template <class T> 38 inline TArray<T> fabs(const TArray<T>& a)36 inline TArray<T> Fabs(const TArray<T>& a) 39 37 { MathArray<T> ma; return( ma.ApplyFunction(a, fabs) ); } 40 38 41 /*! \ingroup TArray \fn sqrt(const TArray<T>& a)39 /*! \ingroup TArray \fn Sqrt(const TArray<T>& a) 42 40 \brief computation on TArray */ 43 41 template <class T> 44 inline TArray<T> sqrt(const TArray<T>& a)42 inline TArray<T> Sqrt(const TArray<T>& a) 45 43 { MathArray<T> ma; return( ma.ApplyFunction(a, sqrt) ); } 46 44 47 /*! \ingroup TArray \fn sin(const TArray<T>& a)45 /*! \ingroup TArray \fn Sin(const TArray<T>& a) 48 46 \brief computation on TArray */ 49 47 template <class T> 50 inline TArray<T> sin(const TArray<T>& a)48 inline TArray<T> Sin(const TArray<T>& a) 51 49 { MathArray<T> ma; return( ma.ApplyFunction(a, sin) ); } 52 50 53 /*! \ingroup TArray \fn cos(const TArray<T>& a)51 /*! \ingroup TArray \fn Cos(const TArray<T>& a) 54 52 \brief computation on TArray */ 55 53 template <class T> 56 inline TArray<T> cos(const TArray<T>& a)54 inline TArray<T> Cos(const TArray<T>& a) 57 55 { MathArray<T> ma; return( ma.ApplyFunction(a, cos) ); } 58 56 … … 60 58 \brief computation on TArray */ 61 59 template <class T> 62 inline TArray<T> tan(const TArray<T>& a)60 inline TArray<T> Tan(const TArray<T>& a) 63 61 { MathArray<T> ma; return( ma.ApplyFunction(a, tan) ); } 64 62 65 /*! \ingroup TArray \fn asin(const TArray<T>& a)63 /*! \ingroup TArray \fn Asin(const TArray<T>& a) 66 64 \brief computation on TArray */ 67 65 template <class T> 68 inline TArray<T> asin(const TArray<T>& a)66 inline TArray<T> Asin(const TArray<T>& a) 69 67 { MathArray<T> ma; return( ma.ApplyFunction(a, asin) ); } 70 68 71 /*! \ingroup TArray \fn acos(const TArray<T>& a)69 /*! \ingroup TArray \fn Acos(const TArray<T>& a) 72 70 \brief computation on TArray */ 73 71 template <class T> 74 inline TArray<T> acos(const TArray<T>& a)72 inline TArray<T> Acos(const TArray<T>& a) 75 73 { MathArray<T> ma; return( ma.ApplyFunction(a, acos) ); } 76 74 77 /*! \ingroup TArray \fn atan(const TArray<T>& a)75 /*! \ingroup TArray \fn Atan(const TArray<T>& a) 78 76 \brief computation on TArray */ 79 77 template <class T> 80 inline TArray<T> atan(const TArray<T>& a)78 inline TArray<T> Atan(const TArray<T>& a) 81 79 { MathArray<T> ma; return( ma.ApplyFunction(a, atan) ); } 82 80 83 /*! \ingroup TArray \fn exp(const TArray<T>& a)81 /*! \ingroup TArray \fn Exp(const TArray<T>& a) 84 82 \brief computation on TArray */ 85 83 template <class T> 86 inline TArray<T> exp(const TArray<T>& a)84 inline TArray<T> Exp(const TArray<T>& a) 87 85 { MathArray<T> ma; return( ma.ApplyFunction(a, exp) ); } 88 86 89 /*! \ingroup TArray \fn lof(const TArray<T>& a)87 /*! \ingroup TArray \fn Log(const TArray<T>& a) 90 88 \brief computation on TArray */ 91 89 template <class T> 92 inline TArray<T> log(const TArray<T>& a)90 inline TArray<T> Log(const TArray<T>& a) 93 91 { MathArray<T> ma; return( ma.ApplyFunction(a, log) ); } 94 92 95 /*! \ingroup TArray \fn log10(const TArray<T>& a)93 /*! \ingroup TArray \fn Log10(const TArray<T>& a) 96 94 \brief computation on TArray */ 97 95 template <class T> 98 inline TArray<T> log10(const TArray<T>& a)96 inline TArray<T> Log10(const TArray<T>& a) 99 97 { MathArray<T> ma; return( ma.ApplyFunction(a, log10) ); } 100 98 101 #else102 // g++ (up to 2.95.1) doesn't handle these inline template103 // functions correctly - with math functions defined in math.h104 #include "gcc_arrmath_pb.h"105 #endif106 99 107 100 /*! \ingroup TArray \fn MeanSigma(const TArray<T>&,double&,double&)
Note:
See TracChangeset
for help on using the changeset viewer.