comparison src/dassl.cc @ 2086:bfb775fb6fe8

[project @ 1996-04-25 05:55:19 by jwe]
author jwe
date Thu, 25 Apr 1996 05:55:19 +0000
parents 003570e69c7b
children 36903d507b0e
comparison
equal deleted inserted replaced
2085:7603b37325db 2086:bfb775fb6fe8
51 51
52 int nstates = x.capacity (); 52 int nstates = x.capacity ();
53 53
54 assert (nstates == xdot.capacity ()); 54 assert (nstates == xdot.capacity ());
55 55
56 Octave_object args; 56 octave_value_list args;
57 args(2) = t; 57 args(2) = t;
58 58
59 if (nstates > 1) 59 if (nstates > 1)
60 { 60 {
61 Matrix m1 (nstates, 1); 61 Matrix m1 (nstates, 1);
63 for (int i = 0; i < nstates; i++) 63 for (int i = 0; i < nstates; i++)
64 { 64 {
65 m1 (i, 0) = x.elem (i); 65 m1 (i, 0) = x.elem (i);
66 m2 (i, 0) = xdot.elem (i); 66 m2 (i, 0) = xdot.elem (i);
67 } 67 }
68 tree_constant state (m1); 68 octave_value state (m1);
69 tree_constant deriv (m2); 69 octave_value deriv (m2);
70 args(1) = deriv; 70 args(1) = deriv;
71 args(0) = state; 71 args(0) = state;
72 } 72 }
73 else 73 else
74 { 74 {
75 double d1 = x.elem (0); 75 double d1 = x.elem (0);
76 double d2 = xdot.elem (0); 76 double d2 = xdot.elem (0);
77 tree_constant state (d1); 77 octave_value state (d1);
78 tree_constant deriv (d2); 78 octave_value deriv (d2);
79 args(1) = deriv; 79 args(1) = deriv;
80 args(0) = state; 80 args(0) = state;
81 } 81 }
82 82
83 if (dassl_fcn) 83 if (dassl_fcn)
84 { 84 {
85 Octave_object tmp = dassl_fcn->eval (0, 1, args); 85 octave_value_list tmp = dassl_fcn->eval (0, 1, args);
86 86
87 if (error_state) 87 if (error_state)
88 { 88 {
89 gripe_user_supplied_eval ("dassl"); 89 gripe_user_supplied_eval ("dassl");
90 return retval; 90 return retval;
113 \n\ 113 \n\
114 res = f (x, xdot, t)\n\ 114 res = f (x, xdot, t)\n\
115 \n\ 115 \n\
116 where x, xdot, and res are vectors, and t is a scalar.") 116 where x, xdot, and res are vectors, and t is a scalar.")
117 { 117 {
118 Octave_object retval; 118 octave_value_list retval;
119 119
120 int nargin = args.length (); 120 int nargin = args.length ();
121 121
122 if (nargin < 4 || nargin > 5) 122 if (nargin < 4 || nargin > 5)
123 { 123 {
292 } 292 }
293 293
294 warning ("dassl_options: no match for `%s'", keyword.c_str ()); 294 warning ("dassl_options: no match for `%s'", keyword.c_str ());
295 } 295 }
296 296
297 static Octave_object 297 static octave_value_list
298 show_dassl_option (const string& keyword) 298 show_dassl_option (const string& keyword)
299 { 299 {
300 Octave_object retval; 300 octave_value_list retval;
301 301
302 DASSL_OPTIONS *list = dassl_option_table; 302 DASSL_OPTIONS *list = dassl_option_table;
303 303
304 while (list->keyword != 0) 304 while (list->keyword != 0)
305 { 305 {
320 "dassl_options (KEYWORD, VALUE)\n\ 320 "dassl_options (KEYWORD, VALUE)\n\
321 \n\ 321 \n\
322 Set or show options for dassl. Keywords may be abbreviated\n\ 322 Set or show options for dassl. Keywords may be abbreviated\n\
323 to the shortest match.") 323 to the shortest match.")
324 { 324 {
325 Octave_object retval; 325 octave_value_list retval;
326 326
327 int nargin = args.length (); 327 int nargin = args.length ();
328 328
329 if (nargin == 0) 329 if (nargin == 0)
330 { 330 {