import { VecN } from './vecn.js'; /** * A dense square N×N matrix backed by a Float64Array, row-major. * * Convention: vectors are columns and transforms act on the left, * `w = M · v`. Entry (row, col) lives at `data[row * n + col]`. * * Rotations are represented directly as orthonormal matrices. This is the * dimension-generic baseline backend; optimized representations (paired * quaternion Rotor4, Givens factor lists, so(n) bivectors) will plug in * behind the same interface later. */ export declare class MatN { readonly n: number; readonly data: Float64Array; constructor(n: number, data?: ArrayLike); static identity(n: number): MatN; /** * Rotation in the coordinate plane spanned by axes i and j, rotating * axis i toward axis j by `angle` radians (a Givens rotation). * * For n = 3, rotationInPlane(3, 0, 1, θ) equals a rotation about the * z axis by θ in the usual right-handed convention. */ static rotationInPlane(n: number, i: number, j: number, angle: number): MatN; get(row: number, col: number): number; set(row: number, col: number, value: number): this; clone(): MatN; copy(m: MatN): this; /** Returns a new matrix `this · m`. */ multiply(m: MatN): MatN; transpose(): MatN; /** Applies `M · v`, writing into `out` (allocated if omitted). */ applyTo(v: VecN, out?: VecN): VecN; /** * Applies the matrix to `count` packed n-vectors from `src` into `dst`. * Both arrays are laid out as [x0…x(n-1), x0…x(n-1), …]. `src` and `dst` * must not alias. */ applyToPositions(src: Float64Array, dst: Float64Array, count: number): void; /** Determinant via Gaussian elimination with partial pivoting. */ determinant(): number; /** Max absolute entry of Mᵀ·M − I; ~0 for orthonormal matrices. */ orthogonalityError(): number; /** * Re-orthonormalizes the columns in place using modified Gram–Schmidt. * Call periodically on rotation matrices accumulated by repeated * multiplication to correct floating-point drift. */ orthonormalizeInPlace(): this; } /** One rotation plane (axis pair) with an angle, e.g. { i: 0, j: 3 } = xw. */ export interface PlaneRotation { i: number; j: number; angle: number; } /** * Composes plane rotations left-to-right into a single rotation matrix: * the first entry is applied to a vector first. Order matters — plane * rotations do not commute in general. */ export declare function rotationFromPlanes(n: number, planes: readonly PlaneRotation[]): MatN; //# sourceMappingURL=matn.d.ts.map