comparison liboctave/LSODE.cc @ 4042:8bc97120fbd5

[project @ 2002-08-15 02:30:40 by jwe]
author jwe
date Thu, 15 Aug 2002 02:30:41 +0000
parents f6df65db67f9
children 6fae69a1796e
comparison
equal deleted inserted replaced
4041:3995501ce1d9 4042:8bc97120fbd5
30 30
31 #include <cfloat> 31 #include <cfloat>
32 #include <cmath> 32 #include <cmath>
33 33
34 #include <iostream> 34 #include <iostream>
35 #include <strstream>
35 36
36 #include "LSODE.h" 37 #include "LSODE.h"
37 #include "f77-fcn.h" 38 #include "f77-fcn.h"
38 #include "lo-error.h" 39 #include "lo-error.h"
39 40
296 std::string 297 std::string
297 LSODE::error_message (void) const 298 LSODE::error_message (void) const
298 { 299 {
299 std::string retval; 300 std::string retval;
300 301
302 std::ostrstream buf;
303 buf << t << ends;
304 const char *t = buf.str ();
305 std::string curr_t = t;
306 delete [] t;
307
301 switch (istate) 308 switch (istate)
302 { 309 {
303 case 1: 310 case 1:
304 retval = "prior to initial integration step"; 311 retval = "prior to initial integration step";
305 break; 312 break;
311 case 3: 318 case 3:
312 retval = "prior to continuation call with modified parameters"; 319 retval = "prior to continuation call with modified parameters";
313 break; 320 break;
314 321
315 case -1: 322 case -1:
316 retval = "excess work on this call (perhaps wrong integration method)"; 323 retval = std::string ("excess work on this call (t = ")
324 + curr_t + "; perhaps wrong integration method)";
317 break; 325 break;
318 326
319 case -2: 327 case -2:
320 retval = "excess accuracy requested (tolerances too small)"; 328 retval = "excess accuracy requested (tolerances too small)";
321 break; 329 break;
323 case -3: 331 case -3:
324 retval = "invalid input detected (see printed message)"; 332 retval = "invalid input detected (see printed message)";
325 break; 333 break;
326 334
327 case -4: 335 case -4:
328 retval = "repeated error test failures (check all inputs)"; 336 retval = std::string ("repeated error test failures (t = ")
337 + curr_t + "check all inputs)";
329 break; 338 break;
330 339
331 case -5: 340 case -5:
332 retval = "repeated convergence failures (perhaps bad jacobian\ 341 retval = std::string ("repeated convergence failures (t = ")
333 supplied or wrong choice of integration method or tolerances)"; 342 + curr_t
343 + "perhaps bad jacobian supplied or wrong choice of integration method or tolerances)";
334 break; 344 break;
335 345
336 case -6: 346 case -6:
337 retval = "error weight became zero during problem.\ 347 retval = std::string ("error weight became zero during problem. (t = ")
338 (solution component i vanished, and atol or atol(i) == 0)"; 348 + curr_t
349 + "; solution component i vanished, and atol or atol(i) == 0)";
339 break; 350 break;
340 351
341 case -13: 352 case -13:
342 retval = "return requested in user-supplied function"; 353 retval = "return requested in user-supplied function (t = "
354 + curr_t + ")";
343 break; 355 break;
344 356
345 default: 357 default:
346 retval = "unknown error state"; 358 retval = "unknown error state";
347 break; 359 break;