Mercurial > octave-nkf
comparison liboctave/ODESSA.cc @ 4043:6fae69a1796e
[project @ 2002-08-15 03:36:27 by jwe]
author | jwe |
---|---|
date | Thu, 15 Aug 2002 03:36:27 +0000 |
parents | f6df65db67f9 |
children | b79da8779a0e |
comparison
equal
deleted
inserted
replaced
4042:8bc97120fbd5 | 4043:6fae69a1796e |
---|---|
26 | 26 |
27 #ifdef HAVE_CONFIG_H | 27 #ifdef HAVE_CONFIG_H |
28 #include <config.h> | 28 #include <config.h> |
29 #endif | 29 #endif |
30 | 30 |
31 #include <iostream.h> | |
32 | |
33 #include <cstdlib> | 31 #include <cstdlib> |
34 #include <cfloat> | 32 #include <cfloat> |
35 #include <cmath> | 33 #include <cmath> |
34 | |
35 #include <strstream> | |
36 | 36 |
37 // For instantiating the Array<Matrix> object. | 37 // For instantiating the Array<Matrix> object. |
38 #include "Array.h" | 38 #include "Array.h" |
39 #include "Array.cc" | 39 #include "Array.cc" |
40 | 40 |
455 std::string | 455 std::string |
456 ODESSA::error_message (void) const | 456 ODESSA::error_message (void) const |
457 { | 457 { |
458 std::string retval; | 458 std::string retval; |
459 | 459 |
460 std::ostrstream buf; | |
461 buf << t << ends; | |
462 const char *t = buf.str (); | |
463 std::string t_curr = t; | |
464 delete [] t; | |
465 | |
460 switch (istate) | 466 switch (istate) |
461 { | 467 { |
462 case 1: | 468 case 1: |
463 retval = "prior to initial integration step"; | 469 retval = "prior to initial integration step"; |
464 break; | 470 break; |
470 case 3: | 476 case 3: |
471 retval = "prior to continuation call with modified parameters"; | 477 retval = "prior to continuation call with modified parameters"; |
472 break; | 478 break; |
473 | 479 |
474 case -1: | 480 case -1: |
475 retval = "excess work on this call (perhaps wrong integration method)"; | 481 retval = std::string ("excess work on this call (t = ") |
482 + t_curr + "; perhaps wrong integration method)"; | |
476 break; | 483 break; |
477 | 484 |
478 case -2: | 485 case -2: |
479 retval = "excess accuracy requested (tolerances too small)"; | 486 retval = "excess accuracy requested (tolerances too small)"; |
480 break; | 487 break; |
482 case -3: | 489 case -3: |
483 retval = "invalid input detected (see printed message)"; | 490 retval = "invalid input detected (see printed message)"; |
484 break; | 491 break; |
485 | 492 |
486 case -4: | 493 case -4: |
487 retval = "repeated error test failures (check all inputs)"; | 494 retval = std::string ("repeated error test failures (t = ") |
495 + t_curr + "check all inputs)"; | |
488 break; | 496 break; |
489 | 497 |
490 case -5: | 498 case -5: |
491 retval = "repeated convergence failures (perhaps bad jacobian\ | 499 retval = std::string ("repeated convergence failures (t = ") |
492 supplied or wrong choice of integration method or tolerances)"; | 500 + t_curr |
501 + "perhaps bad jacobian supplied or wrong choice of integration method or tolerances)"; | |
493 break; | 502 break; |
494 | 503 |
495 case -6: | 504 case -6: |
496 retval = "Error weight became zero during problem.\ | 505 retval = std::string ("error weight became zero during problem. (t = ") |
497 (solution component i vanished, and atol or atol(i) == 0)"; | 506 + t_curr |
507 + "; solution component i vanished, and atol or atol(i) == 0)"; | |
498 break; | 508 break; |
499 | 509 |
500 case -13: | 510 case -13: |
501 retval = "return requested in user-supplied function"; | 511 retval = "return requested in user-supplied function (t = " |
512 + t_curr + ")"; | |
502 break; | 513 break; |
503 | 514 |
504 default: | 515 default: |
505 retval = "unknown error state"; | 516 retval = "unknown error state"; |
506 break; | 517 break; |