Hello,
We are building a computational software in C++ using gsl. The application
is giving different answers for a 32 bit machine and for 64 bit machines.
We tried with different processors and machines (intel and AMD) and came
to conclusion that there is discrepancy in gsl. We have attached a small
g++ program. It gives 2.07388e-317 as output for 64 bit machine and
4.86094e-270 as output for 32 bit machine.
GSL Version: 1.9
Processor: Intel Dual Core
Operating System: Ubuntu in all machines (64 bit machine has 64 bit ubuntu
and 32 bit has 32 bit ubuntu)
Compiler: g++ (GCC) 4.1.2
Problem: Different output for 64 bit and 32 bit machines.
Sample Program attached.
Raamesh Deshpande
Junior Research Fellow
National Center for Biological Research
Banagalore, India.
#include <iostream>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_odeiv.h>
using namespace std;
class F{
public:
F(){;};
static int f(double t, const double* y, double* yprime, void* s ){
return 0;
}
};
int main(){
double t = 0;
double nextt = 100;
double internalStepSize_ = 0.01;
const gsl_odeiv_step_type* gslStepType_ = gsl_odeiv_step_rkf45;
gsl_odeiv_step* gslStep_ = 0;
gsl_odeiv_control* gslControl_;
gsl_odeiv_evolve* gslEvolve_;
gsl_odeiv_system gslSys_;
double *y_ = 0;
double absAccuracy_ = 1.0e-6;
double relAccuracy_ = 1.0e-6;
int nVarMols_ = 19;
F *g = new F();
y_ = new double[ nVarMols_ ];
double d;
memcpy( y_, &d, nVarMols_ * sizeof( double ) );
if ( gslStep_ ) gsl_odeiv_step_free( gslStep_ );
gslStep_ = gsl_odeiv_step_alloc( gslStepType_, nVarMols_ );
gslControl_ = gsl_odeiv_control_y_new( absAccuracy_, relAccuracy_ );
gslEvolve_ = gsl_odeiv_evolve_alloc( nVarMols_ );
gslSys_.function = &F::f;
gslSys_.jacobian = 0;
gslSys_.dimension = nVarMols_;
gslSys_.params = g;
if ( gslStep_ ) gsl_odeiv_step_reset( gslStep_ );
int status = gsl_odeiv_evolve_apply ( gslEvolve_, gslControl_, gslStep_, &gslSys_, &t, nextt, &internalStepSize_, y_);
cout << *y_ << endl;
return 0;
}_______________________________________________
Bug-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gsl