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

MathView rendering helpers for KernelIR graphs. More...

#include "kernel_ir.h"
Include dependency graph for kernel_ir_mathview.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SIM_IR_MATHVIEW_SCHEMA_VERSION   "1.0"
 
#define SIM_IR_MATHVIEW_COMPLEX_SEMANTICS   "cartesian"
 
#define SIM_IR_MATHVIEW_COMPLEX_BRANCH   "principal"
 

Functions

SimResult sim_ir_mathview_render (const SimIRBuilder *builder, SimIRNodeId root, char *buffer, size_t capacity, size_t *out_length)
 Render a KernelIR expression into a canonical MathView string.
 
SimResult sim_ir_mathview_render_json (const SimIRBuilder *builder, SimIRNodeId root, char *buffer, size_t capacity, size_t *out_length)
 Render a KernelIR expression into a Math IR JSON AST.
 
SimResult sim_ir_mathview_render_latex (const SimIRBuilder *builder, SimIRNodeId root, char *buffer, size_t capacity, size_t *out_length)
 Render a KernelIR expression into a LaTeX outline string.
 
SimResult sim_ir_mathview_hash (const SimIRBuilder *builder, SimIRNodeId root, uint64_t *out_hash)
 Hash a KernelIR expression based on its canonical MathView string.
 
SimResult sim_ir_mathview_hash_sha256 (const SimIRBuilder *builder, SimIRNodeId root, unsigned char out_hash[32])
 Hash a KernelIR expression based on its canonical MathView string.
 

Detailed Description

MathView rendering helpers for KernelIR graphs.

Function Documentation

◆ sim_ir_mathview_hash()

SimResult sim_ir_mathview_hash ( const SimIRBuilder builder,
SimIRNodeId  root,
uint64_t *  out_hash 
)

Hash a KernelIR expression based on its canonical MathView string.

Parameters
builderBuilder containing the referenced nodes.
rootRoot node identifier.
[out]out_hashReceives the computed 64-bit hash.
Returns
SIM_RESULT_OK on success.

◆ sim_ir_mathview_hash_sha256()

SimResult sim_ir_mathview_hash_sha256 ( const SimIRBuilder builder,
SimIRNodeId  root,
unsigned char  out_hash[32] 
)

Hash a KernelIR expression based on its canonical MathView string.

Uses SHA-256 over the canonical string (including header).

Parameters
builderBuilder containing the referenced nodes.
rootRoot node identifier.
[out]out_hashReceives the 32-byte SHA-256 digest.
Returns
SIM_RESULT_OK on success.

◆ sim_ir_mathview_render()

SimResult sim_ir_mathview_render ( const SimIRBuilder builder,
SimIRNodeId  root,
char *  buffer,
size_t  capacity,
size_t *  out_length 
)

Render a KernelIR expression into a canonical MathView string.

The canonical string includes a schema header with complex semantics.

Parameters
builderBuilder containing the referenced nodes.
rootRoot node identifier.
bufferOutput buffer (may be NULL to query required length).
capacityCapacity of buffer in bytes.
[out]out_lengthReceives the required length (without NUL) when non-NULL.
Returns
SIM_RESULT_OK on success, SIM_RESULT_OUT_OF_MEMORY if buffer is too small.

◆ sim_ir_mathview_render_json()

SimResult sim_ir_mathview_render_json ( const SimIRBuilder builder,
SimIRNodeId  root,
char *  buffer,
size_t  capacity,
size_t *  out_length 
)

Render a KernelIR expression into a Math IR JSON AST.

Parameters
builderBuilder containing the referenced nodes.
rootRoot node identifier.
bufferOutput buffer (may be NULL to query required length).
capacityCapacity of buffer in bytes.
[out]out_lengthReceives the required length (without NUL) when non-NULL.
Returns
SIM_RESULT_OK on success, SIM_RESULT_OUT_OF_MEMORY if buffer is too small.

◆ sim_ir_mathview_render_latex()

SimResult sim_ir_mathview_render_latex ( const SimIRBuilder builder,
SimIRNodeId  root,
char *  buffer,
size_t  capacity,
size_t *  out_length 
)

Render a KernelIR expression into a LaTeX outline string.

Parameters
builderBuilder containing the referenced nodes.
rootRoot node identifier.
bufferOutput buffer (may be NULL to query required length).
capacityCapacity of buffer in bytes.
[out]out_lengthReceives the required length (without NUL) when non-NULL.
Returns
SIM_RESULT_OK on success, SIM_RESULT_OUT_OF_MEMORY if buffer is too small.