Changeset 882 in Sophya
- Timestamp:
- Apr 11, 2000, 3:50:03 PM (25 years ago)
- Location:
- trunk/SophyaLib/TArray
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/matharr.cc
r813 r882 3 3 4 4 #include "machdefs.h" 5 #include < stdlib.h>5 #include <math.h> 6 6 #include "matharr.h" 7 7 … … 116 116 mean /= dsz; 117 117 sig = sig/dsz - mean*mean; 118 #if !defined(OS_LINUX) && !defined (__KCC__) 118 119 if (sig >= 0.) sig = sqrt(sig); 120 #else 121 // va comprendre pourquoi g++ (sur Linux) veut ca pour faire la generation 122 // de template !!!! 123 if (sig >= 0.) sig = _Sqrt_(sig); 124 #endif 119 125 return(mean); 120 126 } -
trunk/SophyaLib/TArray/matharr.h
r804 r882 7 7 8 8 #include "machdefs.h" 9 #include <math.h> 9 10 #include "tarray.h" 10 #include <math.h>11 11 12 12 namespace SOPHYA { … … 31 31 //////////////////////////////////////////////// 32 32 // Calcul de fonctions usuelles 33 34 #if !defined(OS_LINUX) && !defined (__KCC__) 35 // see below for g++ on Linux 36 template <class T> 37 inline TArray<T> fabs(const TArray<T>& a) 38 { MathArray<T> ma; return( ma.ApplyFunction(a, fabs) ); } 39 40 template <class T> 41 inline TArray<T> sqrt(const TArray<T>& a) 42 { MathArray<T> ma; return( ma.ApplyFunction(a, sqrt) ); } 43 33 44 template <class T> 34 45 inline TArray<T> sin(const TArray<T>& a) … … 67 78 { MathArray<T> ma; return( ma.ApplyFunction(a, log10) ); } 68 79 80 #else 81 // g++ (up to 2.95.1) doesn't handle these inline template 82 // functions correctly - with math functions defined in math.h 83 #include "gcc_arrmath_pb.h" 84 #endif 85 69 86 template <class T> 70 87 inline double MeanSigma(const TArray<T>& a, double & mean, double & sig) … … 75 92 { MathArray<T> ma; double mean, sig; return( ma.MeanSigma(a, mean, sig) ); } 76 93 77 78 94 } // Fin du namespace 79 95
Note:
See TracChangeset
for help on using the changeset viewer.