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

True white-noise stimulus with seeded RNG and complex support. More...

#include "oakfield/operator_split.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for white_noise.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SimStimulusWhiteNoiseConfig
 Configuration for seeded Gaussian white-noise stimulus injection. More...
 

Typedefs

typedef struct SimStimulusWhiteNoiseConfig SimStimulusWhiteNoiseConfig
 Configuration for seeded Gaussian white-noise stimulus injection.
 

Functions

SimResult sim_add_stimulus_white_noise_operator (struct SimContext *context, const SimStimulusWhiteNoiseConfig *config, size_t *out_index)
 Register a seeded white-noise stimulus operator.
 
SimResult sim_stimulus_white_noise_config (struct SimContext *context, size_t operator_index, SimStimulusWhiteNoiseConfig *out_config)
 Copy the current white-noise configuration from a registered operator.
 
SimResult sim_stimulus_white_noise_update (struct SimContext *context, size_t operator_index, const SimStimulusWhiteNoiseConfig *config)
 Replace or renormalize a registered white-noise stimulus configuration.
 

Detailed Description

True white-noise stimulus with seeded RNG and complex support.

Injects independent Gaussian white noise into a target field each step. For complex fields, independent noise is applied to real and imaginary components. The operator is deterministic given its seed.

Function Documentation

◆ sim_add_stimulus_white_noise_operator()

SimResult sim_add_stimulus_white_noise_operator ( struct SimContext context,
const SimStimulusWhiteNoiseConfig config,
size_t *  out_index 
)

Register a seeded white-noise stimulus operator.

The implementation copies and normalizes config, derives a deterministic stream when the seed is zero, and registers the noise operator on the target field.

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

◆ sim_stimulus_white_noise_config()

SimResult sim_stimulus_white_noise_config ( struct SimContext context,
size_t  operator_index,
SimStimulusWhiteNoiseConfig out_config 
)

Copy the current white-noise configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_stimulus_white_noise_operator().
[out]out_configReceives the operator's 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 stimulus state.

◆ sim_stimulus_white_noise_update()

SimResult sim_stimulus_white_noise_update ( struct SimContext context,
size_t  operator_index,
const SimStimulusWhiteNoiseConfig config 
)

Replace or renormalize a registered white-noise stimulus configuration.

Passing NULL for config keeps the existing configuration and reapplies normalization. A successful update refreshes RNG state when needed and invalidates the scheduler plan.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the white-noise operator to update.
configOptional replacement configuration.
Returns
SIM_RESULT_OK on success, or an error code if lookup or state validation fails.