diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2003-06-13 02:45:16 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2003-06-13 02:45:16 +0000 |
commit | c0c7359304c7bb54d794c74b260d9b0bd18f02ae (patch) | |
tree | c16ff1091eb663e4483e6fffe8f2db1abc152d28 /externals/grill/vasp/source | |
parent | d1f912c93aef58acb6b69b16576792bbcd608399 (diff) |
""
svn path=/trunk/; revision=701
Diffstat (limited to 'externals/grill/vasp/source')
-rw-r--r-- | externals/grill/vasp/source/main.h | 5 | ||||
-rw-r--r-- | externals/grill/vasp/source/mixfft.cpp | 4 | ||||
-rw-r--r-- | externals/grill/vasp/source/opdefs.h | 28 | ||||
-rw-r--r-- | externals/grill/vasp/source/ops_dft.cpp | 12 | ||||
-rw-r--r-- | externals/grill/vasp/source/ops_gen.cpp | 4 |
5 files changed, 29 insertions, 24 deletions
diff --git a/externals/grill/vasp/source/main.h b/externals/grill/vasp/source/main.h index f8680dab..d8aa8a65 100644 --- a/externals/grill/vasp/source/main.h +++ b/externals/grill/vasp/source/main.h @@ -20,6 +20,11 @@ WARRANTIES, see the file, "license.txt," in this distribution. #error You need at least flext version 0.4.1 #endif +#if defined(_MSC_VER) && !defined(FLEXT_DEBUG) +// switch off warnings for the release build +#pragma warning(disable: 4244) +#endif + #include <typeinfo> #include <stdlib.h> diff --git a/externals/grill/vasp/source/mixfft.cpp b/externals/grill/vasp/source/mixfft.cpp index 975e8cb1..73d1fca7 100644 --- a/externals/grill/vasp/source/mixfft.cpp +++ b/externals/grill/vasp/source/mixfft.cpp @@ -177,7 +177,7 @@ static void factorize(int n, int *nFact, int fact[]) } if (n>1) { - for (k=2; k<sqrt(n)+1; k++) + for (k=2; k<sqrt((double)n)+1; k++) while ((n % k) == 0) { n=n / k; @@ -575,7 +575,7 @@ bool mixfft(int n, REAL *xRe, REAL *xIm,REAL *yRe, REAL *yIm) int nFactor; int count; - pi = 4*atan(1); + pi = 4*atan(1.); if(!transTableSetup(sofarRadix, actualRadix, remainRadix, &nFactor, &n)) return false; permute(n, nFactor, actualRadix, remainRadix, xRe, xIm, yRe, yIm); diff --git a/externals/grill/vasp/source/opdefs.h b/externals/grill/vasp/source/opdefs.h index 71774db6..833163dc 100644 --- a/externals/grill/vasp/source/opdefs.h +++ b/externals/grill/vasp/source/opdefs.h @@ -443,20 +443,20 @@ template<class T,class CL> inline BL _D__cop(OpParam &p) { return V__cop<T,OpPar // MSVC 6 can't handle optimization here!! (silently produces wrong code!!!) -#define _D__run(T,CL,p) V__run<T,CL>(p.rsdt,p.rss,p.rddt,p.rds,p.frames) -#define _D__cun(T,CL,p) V__cun<T,CL>(p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames) -#define _D__rbin(T,CL,p) _F__rbin<T,CL>(p) -#define _D__cbin(T,CL,p) _F__cbin<T,CL>(p) -#define _D__rop(T,CL,p) V__rop<T,OpParam &,CL>(p,p.rsdt,p.rss,p.rddt,p.rds,p.frames) -#define _D__cop(T,CL,p) V__cop<T,OpParam &,CL>(p,p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames) - -#if defined(VASP_COMPACT) || (defined(_MSC_VER) && _MSC_VER <= 1200) - #define D__run(T,CL,p) _d__run<T>(CL::run,p) - #define D__cun(T,CL,p) _d__cun<T>(CL::cun,p) - #define D__rbin(T,CL,p) _d__rbin<T>(CL::rbin,p) - #define D__cbin(T,CL,p) _d__cbin<T>(CL::cbin,p) - #define D__rop(T,CL,p) _d__rop<T>(CL::rop,p) - #define D__cop(T,CL,p) _d__cop<T>(CL::cop,p) +#define _D__run(T,CL,p) V__run< T,CL >(p.rsdt,p.rss,p.rddt,p.rds,p.frames) +#define _D__cun(T,CL,p) V__cun< T,CL >(p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames) +#define _D__rbin(T,CL,p) _F__rbin< T,CL >(p) +#define _D__cbin(T,CL,p) _F__cbin< T,CL >(p) +#define _D__rop(T,CL,p) V__rop< T,OpParam &,CL >(p,p.rsdt,p.rss,p.rddt,p.rds,p.frames) +#define _D__cop(T,CL,p) V__cop< T,OpParam &,CL >(p,p.rsdt,p.isdt,p.rss,p.iss,p.rddt,p.iddt,p.rds,p.ids,p.frames) + +#if defined(VASP_COMPACT) || (defined(_MSC_VER) && _MSC_VER < 1300) + #define D__run(T,CL,p) _d__run< T >(CL::run,p) + #define D__cun(T,CL,p) _d__cun< T >(CL::cun,p) + #define D__rbin(T,CL,p) _d__rbin< T >(CL::rbin,p) + #define D__cbin(T,CL,p) _d__cbin< T >(CL::cbin,p) + #define D__rop(T,CL,p) _d__rop< T >(CL::rop,p) + #define D__cop(T,CL,p) _d__cop< T >(CL::cop,p) #else #define D__run(T,CL,p) ( CL::run_opt()?_D__run(T,CL,p):_d__run<T>(CL::run,p) ) #define D__cun(T,CL,p) ( CL::cun_opt()?_D__cun(T,CL,p):_d__cun<T>(CL::cun,p) ) diff --git a/externals/grill/vasp/source/ops_dft.cpp b/externals/grill/vasp/source/ops_dft.cpp index 354f126b..fd00d921 100644 --- a/externals/grill/vasp/source/ops_dft.cpp +++ b/externals/grill/vasp/source/ops_dft.cpp @@ -79,7 +79,7 @@ static BL fft_fwd_real_any(I cnt,F *rsdt,I _rss,F *rddt,I _rds) #endif } if(ret) { - const F nrm = 1./sqrt(cnt); + const F nrm = 1./sqrt((F)cnt); const I n2 = cnt/2; #ifndef VASP_COMPACT @@ -158,7 +158,7 @@ static BL fft_inv_real_any(I cnt,F *rsdt,I _rss,F *rddt,I _rds) #endif } if(ret) { - const F nrm = 1./sqrt(cnt); + const F nrm = 1./sqrt((F)cnt); #ifndef VASP_COMPACT if(rds == 1) for(i = 0; i < cnt; ++i) @@ -230,7 +230,7 @@ static BL fft_fwd_complex_any(I cnt,F *rsdt,I _rss,F *isdt,I _iss,F *rddt,I _rds #endif } if(ret) { - const F nrm = 1./sqrt(cnt); + const F nrm = 1./sqrt((F)cnt); #ifdef VASP_COMPACT for(i = 0; i < cnt; ++i) { @@ -359,7 +359,7 @@ static BL fft_complex_radix2(I cnt,F *rsdt,I _rss,F *isdt,I _iss,F *rddt,I _rds, BL ret = fft_bidir_complex_radix2(cnt,rtmp,itmp,dir); if(ret) { - const F nrm = 1./sqrt(cnt); + const F nrm = 1./sqrt((F)cnt); #ifndef VASP_COMPACT if(rtmp == rddt) @@ -426,7 +426,7 @@ BL fft_fwd_real_radix2(I cnt,F *src,I _sstr,F *dst,I _dstr) register I i; const I n2 = cnt/2; - const F fn = (F)(1./sqrt(cnt)); + const F fn = (F)(1./sqrt((F)cnt)); F *stmp; if(!dst || src == dst) { // in-place @@ -502,7 +502,7 @@ BL fft_inv_real_radix2(I cnt,F *src,I _sstr,F *dst,I _dstr) register I i; const I n2 = cnt/2; - const F fn = (F)(1./sqrt(cnt)); + const F fn = (F)(1./sqrt((F)cnt)); F *stmp; if(!dst || src == dst) { // in-place diff --git a/externals/grill/vasp/source/ops_gen.cpp b/externals/grill/vasp/source/ops_gen.cpp index fb354468..73aaab5c 100644 --- a/externals/grill/vasp/source/ops_gen.cpp +++ b/externals/grill/vasp/source/ops_gen.cpp @@ -147,7 +147,7 @@ BL VecOp::d_phasor(OpParam &p) register R ph = p.gen.ph,phinc = p.gen.phinc; if(p.revdir) ph -= (p.frames-1)*(phinc = -phinc); - for(; p.frames--; ph += phinc,p.rddt += p.rds) *p.rddt = fmod(ph,1.F); + for(; p.frames--; ph += phinc,p.rddt += p.rds) *p.rddt = fmod((F)ph,1.F); return true; } @@ -158,7 +158,7 @@ BL VecOp::d_mphasor(OpParam &p) register R ph = p.gen.ph,phinc = p.gen.phinc; if(p.revdir) ph -= (p.frames-1)*(phinc = -phinc); - for(; p.frames--; ph += phinc,p.rddt += p.rds,p.rsdt += p.rss) *p.rddt = *p.rsdt * fmod(ph,1.F); + for(; p.frames--; ph += phinc,p.rddt += p.rds,p.rsdt += p.rss) *p.rddt = *p.rsdt * fmod((F)ph,1.F); return true; } |