comparison liboctave/LSODE.h @ 3945:b050da7f9994

[project @ 2002-05-20 19:40:07 by jwe]
author jwe
date Mon, 20 May 2002 19:40:07 +0000
parents 0486f50a8ecb
children 945e8c160191
comparison
equal deleted inserted replaced
3944:818f5aec1db5 3945:b050da7f9994
51 51
52 ~LSODE_options (void) { } 52 ~LSODE_options (void) { }
53 53
54 void init (void) 54 void init (void)
55 { 55 {
56 x_absolute_tolerance = DBL_EPSILON * DBL_EPSILON; 56 double sqrt_eps = ::sqrt (DBL_EPSILON);
57 x_absolute_tolerance = sqrt_eps;
57 x_initial_step_size = -1.0; 58 x_initial_step_size = -1.0;
58 x_maximum_step_size = -1.0; 59 x_maximum_step_size = -1.0;
59 x_minimum_step_size = 0.0; 60 x_minimum_step_size = 0.0;
60 x_relative_tolerance = ::sqrt (DBL_EPSILON); 61 x_relative_tolerance = sqrt_eps;
61 62
62 // This is consistent with earlier versions of Octave, and is 63 // This is consistent with earlier versions of Octave, and is
63 // much larger than the default of 500 specified in the LSODE 64 // much larger than the default of 500 specified in the LSODE
64 // sources. 65 // sources.
65 x_step_limit = 100000; 66 x_step_limit = 100000;
77 } 78 }
78 79
79 void set_default_options (void) { init (); } 80 void set_default_options (void) { init (); }
80 81
81 void set_absolute_tolerance (double val) 82 void set_absolute_tolerance (double val)
82 { x_absolute_tolerance = (val > 0.0) ? val : DBL_EPSILON * DBL_EPSILON; } 83 { x_absolute_tolerance = (val > 0.0) ? val : ::sqrt (DBL_EPSILON); }
83 84
84 void set_initial_step_size (double val) 85 void set_initial_step_size (double val)
85 { x_initial_step_size = (val >= 0.0) ? val : -1.0; } 86 { x_initial_step_size = (val >= 0.0) ? val : -1.0; }
86 87
87 void set_maximum_step_size (double val) 88 void set_maximum_step_size (double val)