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

Mask/apply operator to gate a field by a mask. More...

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

Go to the source code of this file.

Classes

struct  SimMaskOperatorConfig
 Configuration for the mask/apply operator. More...
 

Typedefs

typedef enum SimMaskMode SimMaskMode
 Mask application mode.
 
typedef struct SimMaskOperatorConfig SimMaskOperatorConfig
 Configuration for the mask/apply operator.
 

Enumerations

enum  SimMaskMode { SIM_MASK_MODE_APPLY = 0 , SIM_MASK_MODE_INVERT }
 Mask application mode.
 

Functions

SimResult sim_add_mask_operator (struct SimContext *context, const SimMaskOperatorConfig *config, size_t *out_index)
 Register a mask/apply operator with the provided configuration.
 
SimResult sim_mask_config (struct SimContext *context, size_t operator_index, SimMaskOperatorConfig *out_config)
 Retrieve the configuration currently bound to a mask operator.
 
SimResult sim_mask_update (struct SimContext *context, size_t operator_index, const SimMaskOperatorConfig *config)
 Update an existing mask operator in-place.
 

Detailed Description

Mask/apply operator to gate a field by a mask.

Function Documentation

◆ sim_add_mask_operator()

SimResult sim_add_mask_operator ( struct SimContext context,
const SimMaskOperatorConfig config,
size_t *  out_index 
)

Register a mask/apply operator with the provided configuration.

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

◆ sim_mask_config()

SimResult sim_mask_config ( struct SimContext context,
size_t  operator_index,
SimMaskOperatorConfig out_config 
)

Retrieve the configuration currently bound to a mask operator.

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

◆ sim_mask_update()

SimResult sim_mask_update ( struct SimContext context,
size_t  operator_index,
const SimMaskOperatorConfig config 
)

Update an existing mask operator in-place.

Passing NULL for config keeps the current configuration and reapplies normalization. A successful update refreshes symbolic state and invalidates the scheduler plan.

Parameters
contextSimulation context containing the operator.
operator_indexIndex of the mask operator to update.
configOptional replacement configuration.
Returns
SIM_RESULT_OK on success, or an error code from lookup, field compatibility checks, or state validation.