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

Random Fourier feature stimulus fields. More...

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

Go to the source code of this file.

Classes

struct  SimStimulusRandomFourierConfig
 Configuration for seeded random Fourier feature stimulus fields. More...
 

Typedefs

typedef struct SimStimulusRandomFourierConfig SimStimulusRandomFourierConfig
 Configuration for seeded random Fourier feature stimulus fields.
 

Functions

SimResult sim_add_stimulus_random_fourier_operator (struct SimContext *context, const SimStimulusRandomFourierConfig *config, size_t *out_index)
 Register a random Fourier feature stimulus operator.
 
SimResult sim_stimulus_random_fourier_config (struct SimContext *context, size_t operator_index, SimStimulusRandomFourierConfig *out_config)
 Copy the current random-Fourier configuration from a registered operator.
 
SimResult sim_stimulus_random_fourier_update (struct SimContext *context, size_t operator_index, const SimStimulusRandomFourierConfig *config)
 Replace or renormalize a registered random-Fourier configuration.
 

Detailed Description

Random Fourier feature stimulus fields.

Synthesizes spatially structured fields via random Fourier features: f(x, t) = sum_k a_k cos(ω_k x - Ω t + φ_k)

For complex fields, a complex-valued sum is written. For real fields, the real part is written, yielding Hermitian-symmetric spectra.

Function Documentation

◆ sim_add_stimulus_random_fourier_operator()

SimResult sim_add_stimulus_random_fourier_operator ( struct SimContext context,
const SimStimulusRandomFourierConfig config,
size_t *  out_index 
)

Register a random Fourier feature stimulus operator.

The implementation copies and normalizes config, derives deterministic features from the seed, and registers the operator on the target field.

Parameters
contextSimulation context that will own the operator.
configOptional random-Fourier 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, feature setup, or split-operator registration.

◆ sim_stimulus_random_fourier_config()

SimResult sim_stimulus_random_fourier_config ( struct SimContext context,
size_t  operator_index,
SimStimulusRandomFourierConfig out_config 
)

Copy the current random-Fourier configuration from a registered operator.

Parameters
contextSimulation context containing the operator.
operator_indexIndex returned by sim_add_stimulus_random_fourier_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_random_fourier_update()

SimResult sim_stimulus_random_fourier_update ( struct SimContext context,
size_t  operator_index,
const SimStimulusRandomFourierConfig config 
)

Replace or renormalize a registered random-Fourier configuration.

Passing NULL for config keeps the existing configuration and reapplies normalization. A successful update rebuilds features as needed and invalidates the scheduler plan.

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