/** * Public entry point of the univariate factorization engine: parse an * expression string into an integer polynomial, run the Zassenhaus pipeline * (`factorUnivariateZ`), and render the irreducible factorization back to a * string that matches `algebra.ts`'s `factor()` output conventions. * * This module is deliberately self-contained (it does not import `algebra.ts`) * so wiring it into `factor()` introduces no import cycle. It reuses the shared * polynomial parser from `../polynomial-ideal.js` and the `bigint` engine from * this directory. * * Part of the univariate factorization engine * (`functions/src/typed/factorization/`). */ import { type IntPoly } from './integer-poly.js'; /** * Render a dense integer-coefficient univariate polynomial as a bare (no outer * parentheses) human-readable string with the repo's spacing/`*`/`^` style and * unit coefficients elided: `[1,0,1] → "x^2 + 1"`, `[-1,0,2] → "2*x^2 - 1"`. * Coefficients are rounded for display; zero terms are omitted. Exported so * `algebra.ts` can render an unfactorable higher-degree remainder consistently. */ export declare function cleanUnivariatePoly(coeffs: number[], v: string): string; /** * Render one irreducible factor: linears via {@link renderLinearFactor}, * higher via {@link renderIntPoly} (bigint-native — see its doc comment for * why this must not go through `Number()`) wrapped in parentheses. Exported * for direct unit testing of the bigint-fidelity path. */ export declare function renderFactor(poly: IntPoly, v: string): string; /** * Factor a univariate integer polynomial given as an expression string into * its irreducible factors over ℤ/ℚ, rendered to a `*`-joined string matching * `factor()`'s conventions (constant prefix when ≠ 1, degree-1 factors via the * linear formatter, degree ≥ 2 factors wrapped in parentheses, repeated factors * for multiplicity > 1). * * Returns `null` when the input is not an integer polynomial in `v` (parse * failure, another variable, non-integer coefficients, degree < 1) OR when the * polynomial is already irreducible over ℚ (a single primitive factor with * multiplicity 1) — in that "nothing gained" case the caller keeps its existing * behavior (leaving the expression whole / doing plain content extraction). * Factor order is `factorUnivariateZ`'s deterministic (degree, coefficients) * order. */ export declare function factorPolynomialUnivariate(expr: string, v: string): string | null; /** * Factor a MULTIVARIATE (`n ≥ 2` variable) integer polynomial given as an * expression string, completely over ℤ/ℚ via the Kronecker-substitution engine * ({@link factorMultivariateKronecker}), rendered to a string matching * `factor()`'s multivariate conventions. * * Returns `null` when the input is not an integer multivariate polynomial in * `vars` (parse failure, non-integer coefficients, single variable, constant, * or the degree cap is exceeded — the engine declines) OR when the * factorization is not worth substituting for the caller's current output. * * The "worth it" threshold is `minFactors` (default 2): a result is returned * only when it has at least `minFactors` irreducible POLYNOMIAL factors. * - Default (the caller's fast path already declined): require ≥ 2 factors — * a genuine multi-factor factorization. A single polynomial factor (an * irreducible, or a bare integer-content extraction like `2·(3x + 2y)`) is * declined so the caller's legacy content-extraction path keeps its exact * byte output; the Kronecker rendering's monomial order differs and must not * override that contract. * - Provided (the caller's fast path produced a partial factorization with * `minFactors − 1` irreducible factors): return a result ONLY if it has at * least `minFactors` factors, i.e. the engine strictly refined a reducible * cofactor the fast path left whole. */ export declare function factorMultivariateString(expr: string, vars: string[], minFactors?: number): string | null; //# sourceMappingURL=index.d.ts.map