numbl 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Selection + ordering logic for `eigs` (a subset of eigenvalues).
3
+ *
4
+ * `eigs` in numbl piggybacks on the dense `eig`: the runtime computes every
5
+ * eigenvalue, then this module picks the requested `k` of them according to
6
+ * `sigma` and returns their original indices in the order `eigs` reports
7
+ * them. It is pure (operates on plain number arrays) so it can be unit
8
+ * tested without the runtime.
9
+ */
10
+ export type SigmaKind = "largestabs" | "smallestabs" | "largestreal" | "smallestreal" | "bothendsreal" | "largestimag" | "smallestimag" | "bothendsimag";
11
+ export type SigmaSpec = {
12
+ kind: SigmaKind;
13
+ } | {
14
+ kind: "scalar";
15
+ re: number;
16
+ im: number;
17
+ };
18
+ /** Map a text sigma value to a canonical kind, or `null` if unrecognized. */
19
+ export declare function normalizeSigmaString(s: string): SigmaKind | null;
20
+ /**
21
+ * Pick `k` eigenvalues (by original index) and return them in the order
22
+ * `eigs` reports for the given `sigma`. `re`/`im` are the real/imaginary
23
+ * parts of all `n` eigenvalues.
24
+ */
25
+ export declare function selectEigsIndices(re: number[], im: number[], k: number, sigma: SigmaSpec): number[];
@@ -0,0 +1,34 @@
1
+ /**
2
+ * `axis(...)` argument parsing — the single place that turns every `axis`
3
+ * call form into `PlotInstruction`s.
4
+ *
5
+ * Supported forms (evaluated left to right, later options overriding earlier
6
+ * ones):
7
+ * - a limit vector `[xmin xmax ymin ymax (zmin zmax (cmin cmax))]`, where a
8
+ * non-finite bound (`inf`/`-inf`) leaves that bound automatic;
9
+ * - a scalar `0/1` or logical `false/true` toggling axes visibility;
10
+ * - a style word (`tight`, `padded`, `fill`, `equal`, `image`, `square`,
11
+ * `vis3d`, `normal`, `tickaligned`);
12
+ * - a limit mode (`manual`, `auto`, `'auto x'`, `'auto y'`, `'auto z'`,
13
+ * `'auto xy'`, `'auto xz'`, `'auto yz'`);
14
+ * - a y-direction (`xy`, `ij`);
15
+ * - a visibility word (`on`, `off`).
16
+ *
17
+ * A leading axes handle (numbl has no real axes handles) is accepted and
18
+ * skipped, so `axis(ax, ...)` works. The query forms `lim = axis` /
19
+ * `lim = axis(ax)` carry no setting argument; the runtime detects them via
20
+ * the `false` return value and computes the limits separately.
21
+ */
22
+ import type { RuntimeValue } from "./types.js";
23
+ import type { PlotInstruction } from "../../graphics/types.js";
24
+ /**
25
+ * Process an `axis(...)` call, pushing instructions onto `instructions`.
26
+ *
27
+ * @param freezeLimits Optional provider of the current limit vector
28
+ * `[xmin xmax ymin ymax (zmin zmax)]`, used to implement `axis manual`
29
+ * (freeze the current limits). When omitted, `axis manual` records the
30
+ * request without concrete values.
31
+ * @returns `true` if any setting was applied. `false` means the call carried
32
+ * no setting argument (a query, e.g. `lim = axis`).
33
+ */
34
+ export declare function applyAxisCommand(args: RuntimeValue[], instructions: PlotInstruction[], freezeLimits?: () => number[]): boolean;
@@ -308,6 +308,11 @@ export declare class Runtime {
308
308
  nargoutchk(actualNargout: unknown, minArgs: unknown, maxArgs: unknown): void;
309
309
  /** Read the hold state, for `ishold()` queries. */
310
310
  ishold(): RuntimeValue;
311
+ /** Current axis limits of the active axes, as MATLAB's `axis` query
312
+ * returns them: `[xmin xmax ymin ymax]` (2-D) or with `zmin zmax`
313
+ * appended (3-D). Reduces the accumulated plot instructions into a figure
314
+ * state and reads the current axes' explicit/data-derived limits. */
315
+ currentAxisLimits(): number[];
311
316
  drawnow(): void;
312
317
  pause(seconds: unknown): void;
313
318
  readInput(prompt: string): string;
@@ -1,2 +1,2 @@
1
1
  /** Numbl version, used for JIT disk cache invalidation. */
2
- export declare const NUMBL_VERSION = "0.4.2";
2
+ export declare const NUMBL_VERSION = "0.4.3";