Skip to contentSkip to Content
DocsAPI ReferenceIntrospectionspires_num_neurons

spires_num_neurons

Return the number of neurons in the reservoir.


Signature

size_t spires_num_neurons(const spires_reservoir *r);

Parameters

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

Returns

size_t — The number of neurons, equal to the num_neurons field of the spires_reservoir_config used at creation time. This is the length of the internal state vector and the required buffer size for spires_read_reservoir_state and spires_copy_reservoir_state.


Example

size_t N = spires_num_neurons(r); double *state = malloc(N * sizeof(double)); spires_read_reservoir_state(r, state); /* ... */ free(state);

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