Class SymFunction

java.lang.Object
org.ddogleg.chainrule.sym.SymFunction

public class SymFunction extends Object
A compiled Sym expression. The caller binds each terminal to storage with feed(Sym, double[]) once, then mutates that storage — contents or offset — inside its loop and calls run(CRArray). There is no per-iteration lookup: the handles are raw CRArrays and the loop touches them directly.
  • Field Details

    • jacobianOut

      Where Jacobian entries land, and the row the caller says the current observation starts at. The row is a raw field for the same reason the feeds are raw arrays
    • jacobianRow

      public int jacobianRow
  • Method Details

    • feed

      public CRArray<double[]> feed(Sym terminal, double[] data)
      Binds the terminal to the caller's own storage. No copy is ever made: the caller updates the array's contents, and the offset is the caller's responsibility
    • feed

      public CRArray<double[]> feed(Sym terminal)
      Binds the terminal to a freshly allocated array of its declared size. Whether the caller walks the offset or copies values in is the caller's knowledge, not tracked here
    • mapParamColumns

      public void mapParamColumns()
      Declares the Jacobian column of every param side feed from its handle's current offset. Call once after binding, and again whenever a handle's offset moved (a new view's pose). Columns are the offsets themselves, so params must be slices of the solver's parameter array
    • mapParamColumn

      public void mapParamColumn(Sym terminal, int column)
      Declares where a parameter's column is, for a terminal whose storage is not the solver's parameter array. A column below zero says the value is not being estimated, so nothing is published for it and it is left undifferentiated
    • jacobianTo

      public void jacobianTo(LeastSquaresSwitcher.JacobianOut out)
      Publishes Jacobian entries to out. Static columns come from mapParamColumns(); a grid read's knot columns move per observation, so they are captured from the operator, which knows where its knots were sliced from
    • runJacobian

      public void runJacobian()
      Runs forward then differentiates, publishing rows at jacobianRow. The caller advances the row between observations, mirroring how it advances the residual output's offset
    • run

      public void run(CRArray<double[]> out)
      Runs the forward pass with the current terminal values and writes the residual rows at the output's offset
    • addMovingCapture

      public void addMovingCapture(Sym terminal, int block, int slot, IntSupplier column)
      Declares an input whose Jacobian column moves as the evaluation walks, published from the supplier when the entry is captured. For extensions choosing parameters per evaluation. The terminal is what mapParamColumn(Sym, int) disables the capture through when the values it reads are not parameters of the solve
    • terminal

      public CRArray<double[]> terminal(Sym node)
      The handle backing a terminal, creating it on first use. Constants arrive already filled