Oakfield API Documentation 1.0.0
Numerical core APIs
Loading...
Searching...
No Matches
stochastic_noise.h File Reference

Additive stochastic noise operator (OU/pink/blue via spectral shaping and calculus law). More...

Include dependency graph for stochastic_noise.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StochasticNoiseOperatorConfig
 Configuration parameters for the additive stochastic noise operator. More...
 

Typedefs

typedef struct StochasticNoiseOperatorConfig StochasticNoiseOperatorConfig
 Configuration parameters for the additive stochastic noise operator.
 

Functions

SimResult sim_add_stochastic_noise_operator (struct SimContext *context, const StochasticNoiseOperatorConfig *config, size_t *out_index)
 Register an additive stochastic noise operator.
 
SimResult sim_stochastic_noise_config (struct SimContext *context, size_t operator_index, StochasticNoiseOperatorConfig *out_config)
 Copy the current stochastic noise configuration from a registered operator.
 
SimResult sim_stochastic_noise_update (struct SimContext *context, size_t operator_index, const StochasticNoiseOperatorConfig *config)
 Replace or renormalize a registered stochastic noise configuration.
 

Detailed Description

Additive stochastic noise operator (OU/pink/blue via spectral shaping and calculus law).

Noise can be interpreted under Ito/Stratonovich (see SimIRNoiseLaw). Real and complex fields are both supported; complex fields receive independent real/imaginary draws.

Function Documentation

◆ sim_add_stochastic_noise_operator()

SimResult sim_add_stochastic_noise_operator ( struct SimContext context,
const StochasticNoiseOperatorConfig config,
size_t *  out_index 
)

Register an additive stochastic noise operator.

Parameters
contextSimulation context that will own the operator.
configOptional noise generation parameters; NULL selects normalized defaults.
[out]out_indexOptional destination for the registered operator index.
Returns
SIM_RESULT_OK on success, or an error code from argument validation, allocation, kernel registration, or split registration.

◆ sim_stochastic_noise_config()

SimResult sim_stochastic_noise_config ( struct SimContext context,
size_t  operator_index,
StochasticNoiseOperatorConfig out_config 
)

Copy the current stochastic noise configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_stochastic_noise_operator().
[out]out_configReceives the normalized configuration.
Returns
SIM_RESULT_OK on success, SIM_RESULT_INVALID_ARGUMENT for NULL pointers, SIM_RESULT_NOT_FOUND for a missing operator, or SIM_RESULT_INVALID_STATE when the operator has no noise state.

◆ sim_stochastic_noise_update()

SimResult sim_stochastic_noise_update ( struct SimContext context,
size_t  operator_index,
const StochasticNoiseOperatorConfig config 
)

Replace or renormalize a registered stochastic noise configuration.

Passing NULL for config keeps the current configuration and reapplies normalization. A successful update reseeds the RNG and clears cached noise state buffers.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the stochastic noise operator to update.
configOptional replacement noise configuration.
Returns
SIM_RESULT_OK on success, or an error code from argument validation, lookup, or state validation.