/** * @file src/tableau/lu-factorization.ts * @description LU factorization for efficient simplex pivoting * * Maintains LU factors of the basis matrix to avoid O(n*m) dense row operations. * Uses Forrest-Tomlin updates to modify factors when basis changes. * * Key operations: * - FTRAN: Solve Bx = b (used to compute pivot column) * - BTRAN: Solve B^T y = c (used to compute reduced costs) * - UPDATE: Modify L,U when one column of B changes */ /** * LU Factorization with partial pivoting. * Stores L and U in compact form, with permutation vector. */ export declare class LUFactorization { readonly n: number; L: Float64Array; U: Float64Array; perm: Int32Array; permInv: Int32Array; private work; private etaVectors; private etaIndices; private etaCount; private readonly maxEtaCount; private readonly tol; constructor(n: number); /** * Factorize a dense matrix A into LU with partial pivoting. * A is stored row-major with given width (stride). */ factorize(A: Float64Array, width: number, colIndices: number[]): boolean; /** * FTRAN: Solve Bx = b * Returns solution in the result array. */ ftran(b: Float64Array, result: Float64Array): void; /** * BTRAN: Solve B^T y = c * Returns solution in the result array. */ btran(c: Float64Array, result: Float64Array): void; /** * Update factors after basis change (Forrest-Tomlin style). * The column at position `leavingIdx` in the basis is replaced. * `newColumn` is the entering column (after FTRAN transformation). * * Returns true if update succeeded, false if refactorization needed. */ update(leavingIdx: number, newColumn: Float64Array): boolean; /** * Check if refactorization is needed. */ needsRefactorization(): boolean; /** * Get the number of eta vectors (update count since last factorization). */ getUpdateCount(): number; }