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

Ornstein-Uhlenbeck stochastic process operator. More...

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

Go to the source code of this file.

Classes

struct  SimOrnsteinUhlenbeckOperatorConfig
 Configuration for the Ornstein-Uhlenbeck operator. More...
 

Typedefs

typedef enum SimOrnsteinUhlenbeckComplexMode SimOrnsteinUhlenbeckComplexMode
 Coordinate system used when applying OU noise to complex fields.
 
typedef struct SimOrnsteinUhlenbeckOperatorConfig SimOrnsteinUhlenbeckOperatorConfig
 Configuration for the Ornstein-Uhlenbeck operator.
 

Enumerations

enum  SimOrnsteinUhlenbeckComplexMode { SIM_ORNSTEIN_UHLENBECK_COMPLEX_MODE_COMPONENT , SIM_ORNSTEIN_UHLENBECK_COMPLEX_MODE_POLAR }
 Coordinate system used when applying OU noise to complex fields. More...
 

Functions

SimResult sim_add_ornstein_uhlenbeck_operator (struct SimContext *context, const SimOrnsteinUhlenbeckOperatorConfig *config, size_t *out_index)
 Register an Ornstein-Uhlenbeck process operator.
 
SimResult sim_ornstein_uhlenbeck_config (struct SimContext *context, size_t operator_index, SimOrnsteinUhlenbeckOperatorConfig *out_config)
 Copy the current OU configuration from a registered operator.
 
SimResult sim_ornstein_uhlenbeck_update (struct SimContext *context, size_t operator_index, const SimOrnsteinUhlenbeckOperatorConfig *config)
 Replace the configuration of a registered OU operator.
 

Detailed Description

Ornstein-Uhlenbeck stochastic process operator.

Enumeration Type Documentation

◆ SimOrnsteinUhlenbeckComplexMode

Coordinate system used when applying OU noise to complex fields.

Enumerator
SIM_ORNSTEIN_UHLENBECK_COMPLEX_MODE_COMPONENT 

Evolve real/imaginary scalar components independently.

SIM_ORNSTEIN_UHLENBECK_COMPLEX_MODE_POLAR 

Evolve radius/phase coordinates independently, then reconstruct.

Function Documentation

◆ sim_add_ornstein_uhlenbeck_operator()

SimResult sim_add_ornstein_uhlenbeck_operator ( struct SimContext context,
const SimOrnsteinUhlenbeckOperatorConfig config,
size_t *  out_index 
)

Register an Ornstein-Uhlenbeck process operator.

Parameters
contextSimulation context that will own the operator.
configOptional OU 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 argument validation, field validation, allocation, or split registration.

◆ sim_ornstein_uhlenbeck_config()

SimResult sim_ornstein_uhlenbeck_config ( struct SimContext context,
size_t  operator_index,
SimOrnsteinUhlenbeckOperatorConfig out_config 
)

Copy the current OU configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_ornstein_uhlenbeck_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 OU state.

◆ sim_ornstein_uhlenbeck_update()

SimResult sim_ornstein_uhlenbeck_update ( struct SimContext context,
size_t  operator_index,
const SimOrnsteinUhlenbeckOperatorConfig config 
)

Replace the configuration of a registered OU operator.

config is required. Updating reseeds the process RNG, refreshes symbolic metadata, and validates the target field before storing the replacement.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the OU operator to update.
configReplacement OU configuration.
Returns
SIM_RESULT_OK on success, or an error code from argument validation, lookup, field validation, or state validation.