Skip to main content

Crate spectrafit_graph

Crate spectrafit_graph 

Source
Expand description

spectrafit-graph — DAG compilation and evaluation engine.

Exposes three top-level functions consumed by the solver and pyo3 bindings:

  • evaluate — sum of all node contributions at given x-points
  • evaluate_components — per-node contributions
  • jacobian — full analytical Jacobian matrix [n_points × n_free_params]

Structs§

CompiledGraph
The compiled representation of a FitGraphSpec, ready for evaluation.
TiedParam
A single tied-parameter assignment: target = expr.
TiedPlan
A dependency-ordered plan for evaluating tied parameters.

Enums§

BinOp
A binary arithmetic operator in the restricted grammar.
Expr
Parsed expression abstract syntax tree.
GraphError
Errors produced by the graph compiler and executor.

Functions§

evaluate
Evaluate the model sum across all nodes at the given x-points.
evaluate_compiled
Evaluate the model sum at each x-point.
evaluate_compiled_indexed
Evaluate the model sum using pre-computed per-node parameter buffers.
evaluate_components
Evaluate each node independently.
evaluate_components_compiled
Evaluate each node independently.
jacobian
Compute the full analytical Jacobian matrix for use by the solver.
jacobian_compiled
Compute the analytical Jacobian matrix using a pre-built flat param map.
jacobian_compiled_indexed
Compute the analytical Jacobian using pre-computed per-node param buffers.
jacobian_compiled_indexed_into
Compute the analytical Jacobian using a reusable row-major scratch buffer.
jacobian_compiled_indexed_weighted_into
Compute the weighted analytical Jacobian into a reusable row-major buffer.
parse_expr
Parse a restricted-grammar expression string into an Expr AST.
residuals_compiled_indexed_into
Compute weighted residuals r[i] = (ŷ[i] − y[i]) / σ[i] into out using pre-computed per-node parameter buffers. Honours per-node dataset_index scoping for simultaneous multi-dataset fits (a no-op for single-dataset / fully-global graphs).