@@ -59,29 +59,29 @@ static const double TriggerThreshold = 0.0;
59
59
static SrcFinfo1<double > *valueOut ()
60
60
{
61
61
static SrcFinfo1<double > valueOut (" valueOut" ,
62
- " Evaluated value of the function for the current variable values." );
62
+ " Evaluated value of the function for the current variable values." );
63
63
return &valueOut;
64
64
}
65
65
66
66
static SrcFinfo1< double > *derivativeOut ()
67
67
{
68
68
static SrcFinfo1< double > derivativeOut (" derivativeOut" ,
69
- " Value of derivative of the function for the current variable values" );
69
+ " Value of derivative of the function for the current variable values" );
70
70
return &derivativeOut;
71
71
}
72
72
73
73
static SrcFinfo1< double > *rateOut ()
74
74
{
75
75
static SrcFinfo1< double > rateOut (" rateOut" ,
76
- " Value of time-derivative of the function for the current variable values" );
76
+ " Value of time-derivative of the function for the current variable values" );
77
77
return &rateOut;
78
78
}
79
79
80
80
static SrcFinfo1< vector < double > *> *requestOut ()
81
81
{
82
82
static SrcFinfo1< vector < double > * > requestOut (
83
- " requestOut" ,
84
- " Sends request for input variable from a field on target object" );
83
+ " requestOut" ,
84
+ " Sends request for input variable from a field on target object" );
85
85
return &requestOut;
86
86
87
87
}
@@ -168,8 +168,9 @@ const Cinfo * Function::initCinfo()
168
168
" max var. max of all arguments\n "
169
169
" sum var. sum of all arguments\n "
170
170
" avg var. mean value of all arguments\n "
171
+ " rnd 0 rand(), random float between 0 and 1, honors global moose.seed.\n "
171
172
" rand 1 rand(seed), random float between 0 and 1, \n "
172
- " if seed = -1, then a 'random' seed is created .\n "
173
+ " if seed = -1, then a 'random' seed is used .\n "
173
174
" rand2 3 rand(a, b, seed), random float between a and b, \n "
174
175
" if seed = -1, a 'random' seed is created using either\n "
175
176
" by random_device or by reading system clock\n "
@@ -235,89 +236,89 @@ const Cinfo * Function::initCinfo()
235
236
// Shared messages
236
237
// /////////////////////////////////////////////////////////////////
237
238
static DestFinfo process ( " process" ,
238
- " Handles process call, updates internal time stamp." ,
239
- new ProcOpFunc< Function >( &Function::process ) );
239
+ " Handles process call, updates internal time stamp." ,
240
+ new ProcOpFunc< Function >( &Function::process ) );
240
241
static DestFinfo reinit ( " reinit" ,
241
- " Handles reinit call." ,
242
- new ProcOpFunc< Function >( &Function::reinit ) );
242
+ " Handles reinit call." ,
243
+ new ProcOpFunc< Function >( &Function::reinit ) );
243
244
static Finfo* processShared[] = { &process, &reinit };
244
245
245
246
static SharedFinfo proc ( " proc" ,
246
- " This is a shared message to receive Process messages "
247
- " from the scheduler objects."
248
- " The first entry in the shared msg is a MsgDest "
249
- " for the Process operation. It has a single argument, "
250
- " ProcInfo, which holds lots of information about current "
251
- " time, thread, dt and so on. The second entry is a MsgDest "
252
- " for the Reinit operation. It also uses ProcInfo. " ,
253
- processShared, sizeof ( processShared ) / sizeof ( Finfo* )
254
- );
255
- /*
256
- static DestFinfo trigger( "trigger",
257
- "Handles trigger input. Argument is timestamp of event. This is "
258
- "compatible with spike events as well as chemical ones. ",
259
- new OpFunc1< Function, double >( &Function::trigger ) );
260
- */
247
+ " This is a shared message to receive Process messages "
248
+ " from the scheduler objects."
249
+ " The first entry in the shared msg is a MsgDest "
250
+ " for the Process operation. It has a single argument, "
251
+ " ProcInfo, which holds lots of information about current "
252
+ " time, thread, dt and so on. The second entry is a MsgDest "
253
+ " for the Reinit operation. It also uses ProcInfo. " ,
254
+ processShared, sizeof ( processShared ) / sizeof ( Finfo* )
255
+ );
256
+ /*
257
+ static DestFinfo trigger( "trigger",
258
+ "Handles trigger input. Argument is timestamp of event. This is "
259
+ "compatible with spike events as well as chemical ones. ",
260
+ new OpFunc1< Function, double >( &Function::trigger ) );
261
+ */
261
262
262
263
static Finfo *functionFinfos[] =
263
- {
264
- &value,
265
- &rate,
266
- &derivative,
267
- &mode,
268
- &useTrigger,
269
- &doEvalAtReinit,
270
- &expr,
271
- &numVars,
272
- &inputs,
273
- &constants,
274
- &independent,
275
- &proc,
276
- requestOut (),
277
- valueOut (),
278
- rateOut (),
279
- derivativeOut (),
280
- };
264
+ {
265
+ &value,
266
+ &rate,
267
+ &derivative,
268
+ &mode,
269
+ &useTrigger,
270
+ &doEvalAtReinit,
271
+ &expr,
272
+ &numVars,
273
+ &inputs,
274
+ &constants,
275
+ &independent,
276
+ &proc,
277
+ requestOut (),
278
+ valueOut (),
279
+ rateOut (),
280
+ derivativeOut (),
281
+ };
281
282
282
283
static string doc[] =
283
- {
284
- " Name" , " Function" ,
285
- " Author" , " Subhasis Ray" ,
286
- " Description" ,
287
- " General purpose function calculator using real numbers.\n "
288
- " It can parse mathematical expression defining a function and evaluate"
289
- " it and/or its derivative for specified variable values."
290
- " You can assign expressions of the form::\n "
291
- " \n "
292
- " f(c0, c1, ..., cM, x0, x1, ..., xN, y0,..., yP ) \n "
293
- " \n "
294
- " where `ci`'s are constants and `xi`'s and `yi`'s are variables."
295
-
296
- " The constants must be defined before setting the expression and"
297
- " variables are connected via messages. The constants can have any"
298
- " name, but the variable names must be of the form x{i} or y{i}"
299
- " where i is increasing integer starting from 0.\n "
300
- " The variables can be input from other moose objects."
301
- " Such variables must be named `x{i}` in the expression and the source"
302
- " field is connected to Function.x[i]'s `input` destination field.\n "
303
- " In case the input variable is not available as a source field, but is"
304
- " a value field, then the value can be requested by connecting the"
305
- " `requestOut` message to the `get{Field}` destination on the target"
306
- " object. Such variables must be specified in the expression as y{i}"
307
- " and connecting the messages should happen in the same order as the"
308
- " y indices.\n "
309
- " This class handles only real numbers (C-double). Predefined constants"
310
- " are: pi=3.141592..., e=2.718281..."
311
- };
284
+ {
285
+ " Name" , " Function" ,
286
+ " Author" , " Subhasis Ray" ,
287
+ " Description" ,
288
+ " General purpose function calculator using real numbers.\n "
289
+ " It can parse mathematical expression defining a function and evaluate"
290
+ " it and/or its derivative for specified variable values."
291
+ " You can assign expressions of the form::\n "
292
+ " \n "
293
+ " f(c0, c1, ..., cM, x0, x1, ..., xN, y0,..., yP ) \n "
294
+ " \n "
295
+ " where `ci`'s are constants and `xi`'s and `yi`'s are variables."
296
+
297
+ " The constants must be defined before setting the expression and"
298
+ " variables are connected via messages. The constants can have any"
299
+ " name, but the variable names must be of the form x{i} or y{i}"
300
+ " where i is increasing integer starting from 0.\n "
301
+ " The variables can be input from other moose objects."
302
+ " Such variables must be named `x{i}` in the expression and the source"
303
+ " field is connected to Function.x[i]'s `input` destination field.\n "
304
+ " In case the input variable is not available as a source field, but is"
305
+ " a value field, then the value can be requested by connecting the"
306
+ " `requestOut` message to the `get{Field}` destination on the target"
307
+ " object. Such variables must be specified in the expression as y{i}"
308
+ " and connecting the messages should happen in the same order as the"
309
+ " y indices.\n "
310
+ " This class handles only real numbers (C-double). Predefined constants"
311
+ " are: pi=3.141592..., e=2.718281..."
312
+ };
312
313
313
314
static Dinfo< Function > dinfo;
314
315
static Cinfo functionCinfo (" Function" ,
315
- Neutral::initCinfo (),
316
- functionFinfos,
317
- sizeof (functionFinfos) / sizeof (Finfo*),
318
- &dinfo,
319
- doc,
320
- sizeof (doc)/sizeof (string));
316
+ Neutral::initCinfo (),
317
+ functionFinfos,
318
+ sizeof (functionFinfos) / sizeof (Finfo*),
319
+ &dinfo,
320
+ doc,
321
+ sizeof (doc)/sizeof (string));
321
322
return &functionCinfo;
322
323
323
324
}
0 commit comments