import type { ExactRing, ExactValue } from '../coxeter/exact.js'; /** A finite-rank lattice embedded exactly in a module over one supported ring. */ export declare class LatticeN { readonly ring: ExactRing; readonly rank: number; readonly ambientDim: number; /** Basis vectors, one ambient-space vector per lattice coefficient. */ readonly basis: ReadonlyArray>; constructor(ring: ExactRing, basis: ReadonlyArray>); /** The identity lattice Z^n represented in the selected exact ring. */ static integer(ring: ExactRing, dim: number): LatticeN; /** Exact ambient point for an integer coefficient vector. */ point(coefficients: readonly bigint[]): ExactValue[]; } export interface FlatNOptions { ring: ExactRing; /** Row-major exact map from ambient coordinates to physical coordinates. */ parallelProjection: ReadonlyArray>; /** Row-major exact map from ambient coordinates to internal coordinates. */ perpendicularProjection: ReadonlyArray>; parallelOffset?: readonly ExactValue[]; perpendicularOffset?: readonly ExactValue[]; /** Positive common denominator for parallel exact coordinates. Default 1. */ parallelDenominator?: bigint; /** Positive common denominator for perpendicular exact coordinates. Default 1. */ perpendicularDenominator?: bigint; } /** * An exact parallel/perpendicular coordinate splitting of one ambient * module. It is the algebraic data of a cut-and-project flat; orthonormal * Float64 frames are a later rendering concern. */ export declare class FlatN { readonly ring: ExactRing; readonly ambientDim: number; readonly parallelDim: number; readonly perpendicularDim: number; readonly parallelProjection: ReadonlyArray>; readonly perpendicularProjection: ReadonlyArray>; readonly parallelOffset: readonly ExactValue[]; readonly perpendicularOffset: readonly ExactValue[]; readonly parallelDenominator: bigint; readonly perpendicularDenominator: bigint; constructor(options: FlatNOptions); private project; projectParallel(point: readonly ExactValue[]): ExactValue[]; projectPerpendicular(point: readonly ExactValue[]): ExactValue[]; } export interface ExactHalfspace { /** The accepted side is `normal dot point <= bound`. */ readonly normal: readonly ExactValue[]; readonly bound: ExactValue; /** Facet convention; `defer` delegates equality to the model-set policy. */ readonly boundary?: 'defer' | 'include' | 'exclude'; } export type WindowLocation = 'inside' | 'boundary' | 'outside'; /** A convex exact window represented by ring-valued halfspaces. */ export declare class ConvexWindow { readonly ring: ExactRing; readonly dim: number; readonly halfspaces: readonly ExactHalfspace[]; constructor(ring: ExactRing, dim: number, halfspaces: readonly ExactHalfspace[]); classify(point: readonly ExactValue[]): WindowLocation; /** * Decision supplied by facets touched by a boundary point. Exclusion * wins at corners; `null` means at least one facet deferred to policy. */ boundaryDecision(point: readonly ExactValue[]): boolean | null; } export type WindowBoundaryPolicy = 'include' | 'exclude' | 'error'; export interface CoefficientRange { /** Inclusive integer bounds. */ readonly min: bigint | number; readonly max: bigint | number; } export interface ModelPoint { /** Integer lattice coefficients: exact provenance of this point. */ readonly coefficients: readonly bigint[]; readonly ambient: readonly ExactValue[]; readonly parallelExact: readonly ExactValue[]; readonly perpendicularExact: readonly ExactValue[]; /** Common exact-coordinate denominator used by `parallelExact`. */ readonly parallelDenominator: bigint; /** Common exact-coordinate denominator used by `perpendicularExact`. */ readonly perpendicularDenominator: bigint; readonly parallel: Float64Array; readonly perpendicular: Float64Array; readonly windowLocation: 'inside' | 'boundary'; } export interface ModelSetPatch { readonly points: readonly ModelPoint[]; /** Number of coefficient tuples in the explicitly requested finite box. */ readonly candidateCount: number; readonly boundaryCount: number; /** Present only when exact window pruning was requested. */ readonly enumeration?: ModelSetWindowPrunedEnumeration; } /** Shared options for samplers that exhaust an explicitly bounded coefficient box. */ export interface CoefficientBoxSampleOptions { /** One inclusive range per lattice coefficient. */ readonly coefficientRanges: readonly CoefficientRange[]; /** Safety cap on coefficient-box size. Default 1,000,000. */ readonly maxCandidates?: number; } /** Compatibility sampling path: test every tuple in the coefficient box. */ export interface ModelSetBoxSampleOptions extends CoefficientBoxSampleOptions { /** Exhaustively test the coefficient box; this is the compatibility default. */ readonly strategy?: 'box'; /** Window-pruned traversal budgets are invalid on the exhaustive path. */ readonly maxTraversalNodes?: never; } /** * Exact branch-and-bound sampling for a single convex window. * * The traversal budget counts feasible prefix nodes plus roots of subtrees * rejected by exact halfspace bounds. It does not change membership. * * @example * Choosing the strategy changes the work, never the answer. Both calls * return the same points in the same order, with the same boundary * classification — pruning rejects only coefficient prefixes whose every * completion is already outside a window halfspace, and equality is never * pruned: * ```ts * const aperiodic = createAKNModelSet(); * const coefficientRanges = Array(6).fill({ min: -4, max: 4 }); * * const exhaustive = aperiodic.sample({ coefficientRanges }); * const pruned = aperiodic.sample({ coefficientRanges, strategy: 'window-pruned' }); * * pruned.points.length === exhaustive.points.length; // true — 6623 either way * pruned.boundaryCount === exhaustive.boundaryCount; // true — 960 either way * ``` * * @example * The evidence is auditable: how many feasible prefixes were entered, and * how many subtrees were proved outside without descending. The saving * grows with the number of coefficients, since a rejected prefix stands for * a whole product of the remaining ranges: * ```ts * const aperiodic = createAKNModelSet(); * const patch = aperiodic.sample({ * coefficientRanges: Array(6).fill({ min: -4, max: 4 }), * strategy: 'window-pruned' * }); * * patch.candidateCount; // 531441 — the box the ranges describe * patch.enumeration?.visitedNodes; // 12065 prefixes entered * patch.enumeration?.prunedSubtrees; // 36914 subtrees proved outside * ``` */ export interface ModelSetWindowPrunedSampleOptions { /** One inclusive range per lattice coefficient. */ readonly coefficientRanges: readonly CoefficientRange[]; /** Prove whole coefficient-prefix subtrees lie outside the convex window. */ readonly strategy: 'window-pruned'; /** Safety cap on all examined traversal nodes. Default 1,000,000. */ readonly maxTraversalNodes?: number; /** Coefficient-box caps belong to the exhaustive strategy. */ readonly maxCandidates?: never; } /** Exhaustive or exact window-pruned options for a generic `ModelSet`. */ export type ModelSetSampleOptions = ModelSetBoxSampleOptions | ModelSetWindowPrunedSampleOptions; /** Auditable work evidence returned by exact window-pruned enumeration. */ export interface ModelSetWindowPrunedEnumeration { /** Identifies evidence produced by the exact convex-window pruning path. */ readonly strategy: 'window-pruned'; /** Feasible coefficient-prefix nodes entered, including root and leaves. */ readonly visitedNodes: number; /** Prefix roots rejected by an exact halfspace lower bound. */ readonly prunedSubtrees: number; } /** A lattice viewed through an exact flat and compact acceptance window. */ export declare class ModelSet { readonly lattice: LatticeN; readonly flat: FlatN; readonly window: ConvexWindow; readonly boundaryPolicy: WindowBoundaryPolicy; /** * Binds the three parts of a cut-and-project scheme, checking that they * describe one scheme: a shared exact ring, a flat of the lattice's ambient * dimension, and a window of the perpendicular space's dimension. A * mismatch is rejected here rather than producing an empty point set. * * @param lattice - Finite-rank lattice over an exact ring. * @param flat - Splits ambient space into the physical and internal * coordinates the scheme reads. * @param window - Acceptance region in internal space; a point is in the * model set when its internal coordinate lies inside. * @param boundaryPolicy - What to do when a point falls exactly on the * window boundary. `'error'` refuses, since the answer is a choice rather * than a computation, and silently including or excluding it would change * the point set without saying so. */ constructor(lattice: LatticeN, flat: FlatN, window: ConvexWindow, boundaryPolicy?: WindowBoundaryPolicy); sample(options: ModelSetSampleOptions): ModelSetPatch; } //# sourceMappingURL=model-set.d.ts.map