diff --git a/src/tests/dynGaussKT_LF/dynGaussKT_LF.pro b/src/tests/dynGaussKT_LF/dynGaussKT_LF.pro deleted file mode 100644 index b4e57901..00000000 --- a/src/tests/dynGaussKT_LF/dynGaussKT_LF.pro +++ /dev/null @@ -1,20 +0,0 @@ -#------------------------------------------------------ -# dynGaussKT_LF.pro -# qmake file for dynGaussKT_LF -# -# Andreas Suter, 2009/01/13 -# -# $Id$ -# -#------------------------------------------------------ - -MAKEFILE = Makefile - -CONFIG -= qt -CONFIG += warn_on console debug - -SOURCES = dynGaussKT_LF.cpp - -TARGET=dynGaussKT_LF - -unix:LIBS += -lgsl -lgslcblas -lm diff --git a/src/tests/dynGaussKT_LF/nr/lubksb.cpp b/src/tests/dynGaussKT_LF/nr/lubksb.cpp deleted file mode 100644 index c16c4914..00000000 --- a/src/tests/dynGaussKT_LF/nr/lubksb.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "nr.h" - -void NR::lubksb(Mat_I_DP &a, Vec_I_INT &indx, Vec_IO_DP &b) -{ - int i,ii=0,ip,j; - DP sum; - - int n=a.nrows(); - for (i=0;i=0;i--) { - sum=b[i]; - for (j=i+1;j -#include "nr.h" -using namespace std; - -void NR::ludcmp(Mat_IO_DP &a, Vec_O_INT &indx, DP &d) -{ - const DP TINY=1.0e-20; - int i,imax,j,k; - DP big,dum,sum,temp; - - int n=a.nrows(); - Vec_DP vv(n); - d=1.0; - for (i=0;i big) big=temp; - if (big == 0.0) nrerror("Singular matrix in routine ludcmp"); - vv[i]=1.0/big; - } - for (j=0;j= big) { - big=dum; - imax=i; - } - } - if (j != imax) { - for (k=0;k -#include -#include -#include "nr.h" -using namespace std; - -// Driver for routine voltra - -DP g(const int k, const DP t) -{ - return (k == 0 ? cosh(t)+t*sin(t) : - 2.0*sin(t)+t*(SQR(sin(t))+exp(t))); -} - -DP ak(const int k, const int l, const DP t, const DP s) -{ - return ((k == 0) ? - (l == 0 ? -exp(t-s) : -cos(t-s)) : - (l == 0 ? -exp(t+s) : -t*cos(s))); -} - -int main(void) -{ - const int N=10,M=2; - const DP H=0.05; - int nn; - DP t0=0.0; - Vec_DP t(N); - Mat_DP f(M,N); - - NR::voltra(t0,H,t,f,g,ak); - // exact soln is f[1]=exp(-t), f[2]=2sin(t) - cout << " abscissa voltra real"; - cout << " voltra real" << endl; - cout << " answer1 answer1"; - cout << " answer2 answer2" << endl << endl; - cout << fixed << setprecision(6); - for (nn=0;nn -#include - -#include -#include -#include -#include -using namespace std; - -#include - -typedef vector PDoubleVector; - -#define PI 3.14159265359 - -// NR p.797 -void voltra(const double h, PDoubleVector &t, PDoubleVector ¶m, PDoubleVector &f, - double g(const int, const PDoubleVector &, const PDoubleVector &, const PDoubleVector &), PDoubleVector &gi) -{ - int i,j; - double sum; - - int n = f.size(); - double a; - t[0] = 0.0; - f[0]=g(0,t,param,gi); - - for (i=1; i(val); - - // nu/Delta criteria - if (param[1] != 0.0) { // Delta != 0 - val = param[2]/param[1]; // nu/Delta - if (val > 5.0) { - useKeren = true; - N = 3000; - } - } - } - - if (argc > 4) { - if (*argv[4] == 'L') { - gaussian = false; - } - } - - const double H = Tmax/N; - - PDoubleVector t(N); - PDoubleVector f(N); - PDoubleVector gi(N); - PDoubleVector keren(N); - - // get start time - struct timeval tv_start, tv_stop; - double t1, t2; - gettimeofday(&tv_start, 0); - - // feed time vector - for (unsigned int i=0; i #include #include +#include using namespace std; #include @@ -165,6 +166,12 @@ int main(int argc, char *argv[]) } } + char fln[128]; + if (gaussian) + sprintf(fln, "dynKT_LF_w0_%1.1f_width%1.1f_nu%1.1f_N%d_G.dat", param[0], param[1], param[2], N); + else + sprintf(fln, "dynKT_LF_w0_%1.1f_width%1.1f_nu%1.1f_N%d_L.dat", param[0], param[1], param[2], N); + const double H = Tmax/N; PDoubleVector t(N); @@ -202,49 +209,51 @@ int main(int argc, char *argv[]) t2 = (tv_stop.tv_sec - tv_start.tv_sec)*1000.0 + (tv_stop.tv_usec - tv_start.tv_usec)/1000.0; // calculate keren LF - double w02, nu2, Delta2, Gamma_t; + double w02, nu2, width2, Gamma_t; for (unsigned int i=0; i