export type CoordinateConstraintConsistency = 'compatible' | 'conflicting'; export type CoordinateConstraintDetermination = 'unique' | 'rank-deficient'; /** * One auditable block of linear equations `A x = b`. * * Coefficients are packed row-major. `scale` names the block's units: the * solver minimizes `weight * ||(A x - b) / scale||^2`. Multiplying the * coefficients, targets, and scale by the same positive value therefore * leaves the problem unchanged. */ export interface LinearCoordinateConstraintBlockN { /** The matrix `A`, packed row-major: `rowCount` rows of `coordinateDim`. */ readonly coefficients: ArrayLike; /** The right-hand side `b`, one entry per row. */ readonly targets: ArrayLike; /** Rows in this block, fixing how the packed arrays are read. */ readonly rowCount: number; /** How much this block matters relative to the others. Default 1. */ readonly weight?: number; /** The block's units. Residuals are divided by it, so blocks measuring * different quantities become comparable before they are weighed against * one another — scale makes blocks commensurable, weight prioritises them, * and the two are not interchangeable. Default 1. */ readonly scale?: number; /** Human-readable name, for diagnostics only. */ readonly label?: string; } export interface LinearCoordinateConstraintOptions { /** Null-space preference. Default is the zero coordinate. */ readonly prior?: ArrayLike; /** Weighted normalized residual tolerance. Default `1e-9`. */ readonly tolerance?: number; /** Relative singular-value rank tolerance. Default `1e-10`. */ readonly rankTolerance?: number; } /** * What one block contributed to a solve, and how well it came out. * * `rank` against `rowCount` is the first thing to read: a rank below the row * count means the block's own rows are not independent, so some of what it * asked for was already implied. Residuals are normalized by `scale`, and so * are comparable across blocks measuring different quantities — which is the * point of separating scale from weight. */ export interface LinearCoordinateConstraintBlockDiagnosticN { /** The block's name, if it was given one. */ readonly label?: string; /** Rows it contributed. */ readonly rowCount: number; /** The weight actually applied, after defaulting. */ readonly weight: number; /** The scale actually applied, after defaulting. */ readonly scale: number; /** Independent directions among its rows; below `rowCount` when they are * not independent. */ readonly rank: number; /** RMS of its scale-normalized residuals, comparable across blocks. */ readonly normalizedResidualRms: number; /** The largest of them; one badly satisfied row shows here while the RMS * still looks acceptable. */ readonly maxNormalizedResidual: number; } export interface LinearCoordinateConstraintFitN { readonly solution: Float64Array; readonly consistency: CoordinateConstraintConsistency; readonly determination: CoordinateConstraintDetermination; readonly coordinateDim: number; readonly totalRows: number; readonly rank: number; readonly unresolvedDegreesOfFreedom: number; /** Smallest/largest resolved singular-value ratio; zero when rank is zero. */ readonly rankConditioning: number; /** Singular values in ascending order. */ readonly singularValues: Float64Array; readonly rankThreshold: number; /** Sum of `weight * squared normalized residual` over every row. */ readonly objective: number; /** RMS using `sum(weight * rowCount)` as its denominator. */ readonly normalizedResidualRms: number; readonly maxNormalizedResidual: number; /** Euclidean norm of the normalized normal-equation residual `A^T(Ax-b)`. */ readonly normalResidual: number; readonly blocks: readonly LinearCoordinateConstraintBlockDiagnosticN[]; } /** * Deterministic Float64 golden solver for dimension-independent linear * coordinate constraints. * * Resolved spectral components minimize the weighted normalized least-squares * objective. Rank-deficient components are copied from `prior`, so a prior can * select a point inside the unresolved affine family without perturbing any * component established by the observations. */ export declare function solveLinearCoordinateConstraintsN(coordinateDim: number, blocks: readonly LinearCoordinateConstraintBlockN[], options?: LinearCoordinateConstraintOptions): LinearCoordinateConstraintFitN; //# sourceMappingURL=coordinate-constraints.d.ts.map