Skip to contentSkip to Content

spires_num_inputs

Return the number of input channels for the reservoir.


Signature

size_t spires_num_inputs(const spires_reservoir *r);

Parameters

ParameterTypeDescription
rconst spires_reservoir *Handle to the reservoir. Must not be NULL.

Returns

size_t — The number of input channels, equal to the num_inputs field of the spires_reservoir_config used at creation time. This is the expected length of the input vector passed to spires_step.


Example

size_t ni = spires_num_inputs(r); double *u = calloc(ni, sizeof(double)); u[0] = 1.0; /* drive only the first input channel */ spires_step(r, u); free(u);

Notes

  • Const-qualified. This function takes a const pointer and does not modify the reservoir. It is safe to call concurrently with other read-only functions.
  • Immutable. The return value is fixed at creation time and never changes for the lifetime of the reservoir.

See Also

Last updated on