Changeset 882 in Sophya for trunk/SophyaLib/TArray


Ignore:
Timestamp:
Apr 11, 2000, 3:50:03 PM (25 years ago)
Author:
ansari
Message:

Pb compil matharr.h sur g++/linux , Reza 11/4/2000

Location:
trunk/SophyaLib/TArray
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/TArray/matharr.cc

    r813 r882  
    33
    44#include "machdefs.h"
    5 #include <stdlib.h>
     5#include <math.h>
    66#include "matharr.h"
    77
     
    116116  mean /= dsz;
    117117  sig = sig/dsz - mean*mean;
     118#if !defined(OS_LINUX) && !defined (__KCC__) 
    118119  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
    119125  return(mean);
    120126}
  • trunk/SophyaLib/TArray/matharr.h

    r804 r882  
    77
    88#include "machdefs.h"
     9#include <math.h>
    910#include "tarray.h"
    10 #include <math.h>
    1111
    1212namespace SOPHYA {
     
    3131////////////////////////////////////////////////
    3232//  Calcul de fonctions usuelles
     33
     34#if !defined(OS_LINUX) && !defined (__KCC__)
     35// see below for g++  on Linux
     36template <class T>
     37inline TArray<T> fabs(const TArray<T>& a)
     38  { MathArray<T> ma;   return( ma.ApplyFunction(a, fabs) ); }
     39
     40template <class T>
     41inline TArray<T> sqrt(const TArray<T>& a)
     42  { MathArray<T> ma;   return( ma.ApplyFunction(a, sqrt) ); }
     43
    3344template <class T>
    3445inline TArray<T> sin(const TArray<T>& a)
     
    6778  { MathArray<T> ma;   return( ma.ApplyFunction(a, log10) ); }
    6879
     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
    6986template <class T>
    7087inline double MeanSigma(const TArray<T>& a, double & mean, double & sig)
     
    7592  { MathArray<T> ma;  double mean, sig;  return( ma.MeanSigma(a, mean, sig) ); }
    7693
    77 
    7894} // Fin du namespace
    7995
Note: See TracChangeset for help on using the changeset viewer.