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

Minimal convolution operator with small odd-length kernels (1D/2D). More...

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

Go to the source code of this file.

Classes

struct  SimMinimalConvolutionOperatorConfig
 Configuration for the minimal convolution operator. More...
 

Typedefs

typedef enum SimMinimalConvolutionMode SimMinimalConvolutionMode
 Supported minimal-convolution kernel layouts.
 
typedef enum SimMinimalConvolutionAxis SimMinimalConvolutionAxis
 Axis selection for one-dimensional kernels on two-dimensional fields.
 
typedef struct SimMinimalConvolutionOperatorConfig SimMinimalConvolutionOperatorConfig
 Configuration for the minimal convolution operator.
 

Enumerations

enum  { SIM_MINIMAL_CONVOLUTION_MAX_TAPS = 9 , SIM_MINIMAL_CONVOLUTION_MAX_TAPS_2D }
 
enum  SimMinimalConvolutionMode { SIM_MINIMAL_CONVOLUTION_MODE_AXIS = 0 , SIM_MINIMAL_CONVOLUTION_MODE_SEPARABLE , SIM_MINIMAL_CONVOLUTION_MODE_KERNEL_2D }
 Supported minimal-convolution kernel layouts. More...
 
enum  SimMinimalConvolutionAxis { SIM_MINIMAL_CONVOLUTION_AXIS_X = 0 , SIM_MINIMAL_CONVOLUTION_AXIS_Y }
 Axis selection for one-dimensional kernels on two-dimensional fields. More...
 

Functions

SimResult sim_add_minimal_convolution_operator (struct SimContext *context, const SimMinimalConvolutionOperatorConfig *config, size_t *out_index)
 Register a minimal convolution operator.
 
SimResult sim_minimal_convolution_config (struct SimContext *context, size_t operator_index, SimMinimalConvolutionOperatorConfig *out_config)
 Copy the current minimal-convolution configuration from a registered operator.
 
SimResult sim_minimal_convolution_update (struct SimContext *context, size_t operator_index, const SimMinimalConvolutionOperatorConfig *config)
 Replace the configuration of a registered minimal-convolution operator.
 

Detailed Description

Minimal convolution operator with small odd-length kernels (1D/2D).

Enumeration Type Documentation

◆ SimMinimalConvolutionAxis

Axis selection for one-dimensional kernels on two-dimensional fields.

Enumerator
SIM_MINIMAL_CONVOLUTION_AXIS_X 

Convolve along the X axis.

SIM_MINIMAL_CONVOLUTION_AXIS_Y 

Convolve along the Y axis.

◆ SimMinimalConvolutionMode

Supported minimal-convolution kernel layouts.

Enumerator
SIM_MINIMAL_CONVOLUTION_MODE_AXIS 

Apply a one-dimensional kernel along one axis.

SIM_MINIMAL_CONVOLUTION_MODE_SEPARABLE 

Apply separable row/column kernels.

SIM_MINIMAL_CONVOLUTION_MODE_KERNEL_2D 

Apply a full two-dimensional kernel.

Function Documentation

◆ sim_add_minimal_convolution_operator()

SimResult sim_add_minimal_convolution_operator ( struct SimContext context,
const SimMinimalConvolutionOperatorConfig config,
size_t *  out_index 
)

Register a minimal convolution operator.

The implementation copies and normalizes config, validates kernel shape and field compatibility, and registers a split operator over matching real or complex fields.

Parameters
contextSimulation context that will own the operator.
configOptional convolution 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, kernel validation, field compatibility checks, allocation, or registration.

◆ sim_minimal_convolution_config()

SimResult sim_minimal_convolution_config ( struct SimContext context,
size_t  operator_index,
SimMinimalConvolutionOperatorConfig out_config 
)

Copy the current minimal-convolution configuration from a registered operator.

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

◆ sim_minimal_convolution_update()

SimResult sim_minimal_convolution_update ( struct SimContext context,
size_t  operator_index,
const SimMinimalConvolutionOperatorConfig config 
)

Replace the configuration of a registered minimal-convolution operator.

config is required. The replacement is normalized and kernel/field compatibility is checked before storing it.

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