deepbox 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +344 -0
- package/dist/CSRMatrix-CwGwQRea.d.cts +219 -0
- package/dist/CSRMatrix-KzNt6QpS.d.ts +219 -0
- package/dist/Tensor-BQLk1ltW.d.cts +147 -0
- package/dist/Tensor-g8mUClel.d.ts +147 -0
- package/dist/chunk-4S73VUBD.js +677 -0
- package/dist/chunk-4S73VUBD.js.map +1 -0
- package/dist/chunk-5R4S63PF.js +2925 -0
- package/dist/chunk-5R4S63PF.js.map +1 -0
- package/dist/chunk-6AE5FKKQ.cjs +9264 -0
- package/dist/chunk-6AE5FKKQ.cjs.map +1 -0
- package/dist/chunk-AD436M45.js +3854 -0
- package/dist/chunk-AD436M45.js.map +1 -0
- package/dist/chunk-ALS7ETWZ.cjs +4263 -0
- package/dist/chunk-ALS7ETWZ.cjs.map +1 -0
- package/dist/chunk-AU7XHGKJ.js +2092 -0
- package/dist/chunk-AU7XHGKJ.js.map +1 -0
- package/dist/chunk-B5TNKUEY.js +1481 -0
- package/dist/chunk-B5TNKUEY.js.map +1 -0
- package/dist/chunk-BCR7G3A6.js +9136 -0
- package/dist/chunk-BCR7G3A6.js.map +1 -0
- package/dist/chunk-C4PKXY74.cjs +1917 -0
- package/dist/chunk-C4PKXY74.cjs.map +1 -0
- package/dist/chunk-DWZY6PIP.cjs +6400 -0
- package/dist/chunk-DWZY6PIP.cjs.map +1 -0
- package/dist/chunk-E3EU5FZO.cjs +2113 -0
- package/dist/chunk-E3EU5FZO.cjs.map +1 -0
- package/dist/chunk-F3JWBINJ.js +1054 -0
- package/dist/chunk-F3JWBINJ.js.map +1 -0
- package/dist/chunk-FJYLIGJX.js +1940 -0
- package/dist/chunk-FJYLIGJX.js.map +1 -0
- package/dist/chunk-JSCDE774.cjs +729 -0
- package/dist/chunk-JSCDE774.cjs.map +1 -0
- package/dist/chunk-LWECRCW2.cjs +2412 -0
- package/dist/chunk-LWECRCW2.cjs.map +1 -0
- package/dist/chunk-MLBMYKCG.js +6379 -0
- package/dist/chunk-MLBMYKCG.js.map +1 -0
- package/dist/chunk-OX6QXFMV.cjs +3874 -0
- package/dist/chunk-OX6QXFMV.cjs.map +1 -0
- package/dist/chunk-PHV2DKRS.cjs +1072 -0
- package/dist/chunk-PHV2DKRS.cjs.map +1 -0
- package/dist/chunk-PL7TAYKI.js +4056 -0
- package/dist/chunk-PL7TAYKI.js.map +1 -0
- package/dist/chunk-PR647I7R.js +1898 -0
- package/dist/chunk-PR647I7R.js.map +1 -0
- package/dist/chunk-QERHVCHC.cjs +2960 -0
- package/dist/chunk-QERHVCHC.cjs.map +1 -0
- package/dist/chunk-XEG44RF6.cjs +1514 -0
- package/dist/chunk-XEG44RF6.cjs.map +1 -0
- package/dist/chunk-XMWVME2W.js +2377 -0
- package/dist/chunk-XMWVME2W.js.map +1 -0
- package/dist/chunk-ZB75FESB.cjs +1979 -0
- package/dist/chunk-ZB75FESB.cjs.map +1 -0
- package/dist/chunk-ZLW62TJG.cjs +4061 -0
- package/dist/chunk-ZLW62TJG.cjs.map +1 -0
- package/dist/chunk-ZXKBDFP3.js +4235 -0
- package/dist/chunk-ZXKBDFP3.js.map +1 -0
- package/dist/core/index.cjs +204 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +2 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -0
- package/dist/dataframe/index.cjs +22 -0
- package/dist/dataframe/index.cjs.map +1 -0
- package/dist/dataframe/index.d.cts +3 -0
- package/dist/dataframe/index.d.ts +3 -0
- package/dist/dataframe/index.js +5 -0
- package/dist/dataframe/index.js.map +1 -0
- package/dist/datasets/index.cjs +134 -0
- package/dist/datasets/index.cjs.map +1 -0
- package/dist/datasets/index.d.cts +3 -0
- package/dist/datasets/index.d.ts +3 -0
- package/dist/datasets/index.js +5 -0
- package/dist/datasets/index.js.map +1 -0
- package/dist/index-74AB8Cyh.d.cts +1126 -0
- package/dist/index-9oQx1HgV.d.cts +1180 -0
- package/dist/index-BJY2SI4i.d.ts +483 -0
- package/dist/index-BWGhrDlr.d.ts +733 -0
- package/dist/index-B_DK4FKY.d.cts +242 -0
- package/dist/index-BbA2Gxfl.d.ts +456 -0
- package/dist/index-BgHYAoSS.d.cts +837 -0
- package/dist/index-BndMbqsM.d.ts +1439 -0
- package/dist/index-C1mfVYoo.d.ts +2517 -0
- package/dist/index-CCvlwAmL.d.cts +809 -0
- package/dist/index-CDw5CnOU.d.ts +785 -0
- package/dist/index-Cn3SdB0O.d.ts +1126 -0
- package/dist/index-CrqLlS-a.d.ts +776 -0
- package/dist/index-D61yaSMY.d.cts +483 -0
- package/dist/index-D9Loo1_A.d.cts +2517 -0
- package/dist/index-DIT_OO9C.d.cts +785 -0
- package/dist/index-DIp_RrRt.d.ts +242 -0
- package/dist/index-DbultU6X.d.cts +1427 -0
- package/dist/index-DmEg_LCm.d.cts +776 -0
- package/dist/index-DoPWVxPo.d.cts +1439 -0
- package/dist/index-DuCxd-8d.d.ts +837 -0
- package/dist/index-Dx42TZaY.d.ts +809 -0
- package/dist/index-DyZ4QQf5.d.cts +456 -0
- package/dist/index-GFAVyOWO.d.ts +1427 -0
- package/dist/index-WHQLn0e8.d.cts +733 -0
- package/dist/index-ZtI1Iy4L.d.ts +1180 -0
- package/dist/index-eJgeni9c.d.cts +1911 -0
- package/dist/index-tk4lSYod.d.ts +1911 -0
- package/dist/index.cjs +72 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/linalg/index.cjs +86 -0
- package/dist/linalg/index.cjs.map +1 -0
- package/dist/linalg/index.d.cts +3 -0
- package/dist/linalg/index.d.ts +3 -0
- package/dist/linalg/index.js +5 -0
- package/dist/linalg/index.js.map +1 -0
- package/dist/metrics/index.cjs +158 -0
- package/dist/metrics/index.cjs.map +1 -0
- package/dist/metrics/index.d.cts +3 -0
- package/dist/metrics/index.d.ts +3 -0
- package/dist/metrics/index.js +5 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/ml/index.cjs +87 -0
- package/dist/ml/index.cjs.map +1 -0
- package/dist/ml/index.d.cts +3 -0
- package/dist/ml/index.d.ts +3 -0
- package/dist/ml/index.js +6 -0
- package/dist/ml/index.js.map +1 -0
- package/dist/ndarray/index.cjs +501 -0
- package/dist/ndarray/index.cjs.map +1 -0
- package/dist/ndarray/index.d.cts +5 -0
- package/dist/ndarray/index.d.ts +5 -0
- package/dist/ndarray/index.js +4 -0
- package/dist/ndarray/index.js.map +1 -0
- package/dist/nn/index.cjs +142 -0
- package/dist/nn/index.cjs.map +1 -0
- package/dist/nn/index.d.cts +6 -0
- package/dist/nn/index.d.ts +6 -0
- package/dist/nn/index.js +5 -0
- package/dist/nn/index.js.map +1 -0
- package/dist/optim/index.cjs +77 -0
- package/dist/optim/index.cjs.map +1 -0
- package/dist/optim/index.d.cts +4 -0
- package/dist/optim/index.d.ts +4 -0
- package/dist/optim/index.js +4 -0
- package/dist/optim/index.js.map +1 -0
- package/dist/plot/index.cjs +114 -0
- package/dist/plot/index.cjs.map +1 -0
- package/dist/plot/index.d.cts +6 -0
- package/dist/plot/index.d.ts +6 -0
- package/dist/plot/index.js +5 -0
- package/dist/plot/index.js.map +1 -0
- package/dist/preprocess/index.cjs +82 -0
- package/dist/preprocess/index.cjs.map +1 -0
- package/dist/preprocess/index.d.cts +4 -0
- package/dist/preprocess/index.d.ts +4 -0
- package/dist/preprocess/index.js +5 -0
- package/dist/preprocess/index.js.map +1 -0
- package/dist/random/index.cjs +74 -0
- package/dist/random/index.cjs.map +1 -0
- package/dist/random/index.d.cts +3 -0
- package/dist/random/index.d.ts +3 -0
- package/dist/random/index.js +5 -0
- package/dist/random/index.js.map +1 -0
- package/dist/stats/index.cjs +142 -0
- package/dist/stats/index.cjs.map +1 -0
- package/dist/stats/index.d.cts +3 -0
- package/dist/stats/index.d.ts +3 -0
- package/dist/stats/index.js +5 -0
- package/dist/stats/index.js.map +1 -0
- package/dist/tensor-B96jjJLQ.d.cts +205 -0
- package/dist/tensor-B96jjJLQ.d.ts +205 -0
- package/package.json +226 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/index.ts","../src/core/errors/base.ts","../src/core/errors/validation.ts","../src/core/types/device.ts","../src/core/types/dtype.ts","../src/core/utils/validation.ts","../src/core/config/global.ts","../src/core/errors/broadcast.ts","../src/core/errors/convergence.ts","../src/core/errors/device.ts","../src/core/errors/dtype.ts","../src/core/errors/indexError.ts","../src/core/errors/invalidParameter.ts","../src/core/errors/memory.ts","../src/core/errors/notFitted.ts","../src/core/errors/notImplemented.ts","../src/core/errors/shape.ts","../src/core/utils/axis.ts","../src/core/utils/dtypeUtils.ts","../src/core/utils/typedArrayAccess.ts","../src/core/utils/typeGuards.ts"],"names":["cloneShape","value"],"mappings":";;;;;;;AAAA,IAAA,YAAA,GAAA;AAAA,QAAA,CAAA,YAAA,EAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,gBAAA,EAAA,MAAA,gBAAA;AAAA,EAAA,OAAA,EAAA,MAAA,OAAA;AAAA,EAAA,MAAA,EAAA,MAAA,MAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,WAAA,EAAA,MAAA,WAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,qBAAA,EAAA,MAAA,qBAAA;AAAA,EAAA,WAAA,EAAA,MAAA,WAAA;AAAA,EAAA,cAAA,EAAA,MAAA,cAAA;AAAA,EAAA,mBAAA,EAAA,MAAA,mBAAA;AAAA,EAAA,UAAA,EAAA,MAAA,UAAA;AAAA,EAAA,eAAA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AAA;AACvC;AAWO,SAAS,eAAA,CAAgB,GAAA,EAAwB,KAAA,EAAe,YAAA,GAAe,CAAA,EAAW;AAC/F,EAAA,MAAM,KAAA,GAAQ,IAAI,KAAK,CAAA;AACvB,EAAA,OAAO,KAAA,KAAU,SAAY,KAAA,GAAQ,YAAA;AACvC;AAUO,SAAS,gBAAA,CAAiB,KAAwB,KAAA,EAAuB;AAC9E,EAAA,MAAM,KAAA,GAAQ,IAAI,KAAK,CAAA;AACvB,EAAA,OAAO,KAAA,KAAU,SAAY,KAAA,GAAQ,EAAA;AACvC;AASO,SAAS,gBAAoC,GAAA,EAA2B;AAC7E,EAAA,OAAO,GAAA;AACT;AAQO,SAAS,gBAAgB,GAAA,EAAuC;AACrE,EAAA,OAAO,GAAA,YAAe,aAAA;AACxB;AAQO,SAAS,oBAAoB,GAAA,EAA2C;AAC7E,EAAA,OAAO,EAAE,GAAA,YAAe,aAAA,CAAA;AAC1B;;;ACjJO,SAAS,aAAa,KAAA,EAAqC;AAChE,EAAA,OACE,KAAA,YAAiB,gBACjB,KAAA,YAAiB,YAAA,IACjB,iBAAiB,UAAA,IACjB,KAAA,YAAiB,iBACjB,KAAA,YAAiB,UAAA;AAErB","file":"chunk-4S73VUBD.js","sourcesContent":["/**\n * Deepbox Core\n *\n * This module is the stable, dependency-light foundation shared by all other Deepbox\n * subpackages. It exposes:\n * - configuration helpers\n * - error types\n * - foundational types/constants\n * - runtime validation and utility helpers\n */\n\n// Config\nexport type { DeepboxConfig } from \"./config/index\";\nexport {\n getConfig,\n getDevice,\n getDtype,\n getSeed,\n resetConfig,\n setConfig,\n setDevice,\n setDtype,\n setSeed,\n} from \"./config/index\";\n\n// Errors\nexport {\n BroadcastError,\n ConvergenceError,\n type ConvergenceErrorDetails,\n DataValidationError,\n DeepboxError,\n DeviceError,\n DTypeError,\n IndexError,\n InvalidParameterError,\n MemoryError,\n NotFittedError,\n NotImplementedError,\n ShapeError,\n type ShapeErrorDetails,\n} from \"./errors/index\";\n\n// Types\nexport type {\n Axis,\n Device,\n DType,\n Shape,\n TensorLike,\n TensorStorage,\n TypedArray,\n} from \"./types/index\";\n\n// Constants\nexport { DEVICES, DTYPES, isDevice, isDType } from \"./types/index\";\n\n// Utilities\nexport {\n asReadonlyArray,\n dtypeToTypedArrayCtor,\n ensureNumericDType,\n getArrayElement,\n getBigIntElement,\n getElementAsNumber,\n getNumericElement,\n getShapeDim,\n getStringElement,\n isBigInt64Array,\n isNumericTypedArray,\n isTypedArray,\n type NumericDType,\n type NumericTypedArray,\n normalizeAxes,\n normalizeAxis,\n shapeToSize,\n validateArray,\n validateDevice,\n validateDtype,\n validateInteger,\n validateNonNegative,\n validateOneOf,\n validatePositive,\n validateRange,\n validateShape,\n} from \"./utils/index\";\n","/**\n * Base class for all Deepbox-specific errors.\n *\n * Provides a stable `instanceof DeepboxError` discriminator\n * and consistent `cause` chaining.\n */\nexport class DeepboxError extends Error {\n override name = \"DeepboxError\";\n override cause?: unknown;\n\n constructor(message?: string, options?: { readonly cause?: unknown }) {\n super(message);\n if (options?.cause !== undefined) {\n this.cause = options.cause;\n }\n // Required when extending built-in classes in TypeScript\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Error thrown when data validation fails.\n *\n * Used for input data that doesn't meet expected format or constraints.\n *\n * @example\n * ```ts\n * if (!Array.isArray(data)) {\n * throw new DataValidationError('Expected array input');\n * }\n * ```\n */\nexport class DataValidationError extends DeepboxError {\n override name = \"DataValidationError\";\n}\n","/**\n * Supported compute devices for tensor operations.\n *\n * - `cpu`: Standard CPU execution (always available)\n * - `webgpu`: GPU acceleration via WebGPU API (when supported)\n * - `wasm`: WebAssembly acceleration for better CPU performance\n *\n * @example\n * ```ts\n * import type { Device } from 'deepbox/core';\n * import { setDevice } from 'deepbox/core';\n *\n * const device: Device = 'cpu';\n * setDevice(device);\n * ```\n */\nexport type Device = \"cpu\" | \"webgpu\" | \"wasm\";\n\n/**\n * Array of all supported device types.\n *\n * Use this constant for validation or UI selection.\n *\n * @example\n * ```ts\n * import { DEVICES } from 'deepbox/core';\n *\n * console.log(DEVICES); // ['cpu', 'webgpu', 'wasm']\n * ```\n */\nexport const DEVICES: readonly Device[] = [\"cpu\", \"webgpu\", \"wasm\"];\n\n/**\n * Type guard to check if a value is a valid Device.\n *\n * @param value - The value to check\n * @returns True if value is a valid Device, false otherwise\n *\n * @example\n * ```ts\n * import { isDevice } from 'deepbox/core';\n *\n * if (isDevice('cpu')) {\n * console.log('Valid device');\n * }\n *\n * isDevice('gpu'); // false\n * isDevice('cpu'); // true\n * ```\n */\nexport function isDevice(value: unknown): value is Device {\n if (typeof value !== \"string\") {\n return false;\n }\n for (const d of DEVICES) {\n if (d === value) {\n return true;\n }\n }\n return false;\n}\n","/**\n * Supported data types for tensors.\n *\n * - `float32`: 32-bit floating point (single precision)\n * - `float64`: 64-bit floating point (double precision)\n * - `int32`: 32-bit signed integer\n * - `int64`: 64-bit signed integer (BigInt)\n * - `uint8`: 8-bit unsigned integer\n * - `bool`: Boolean values (stored as uint8)\n * - `string`: String values (limited support)\n *\n * @example\n * ```ts\n * import type { DType } from 'deepbox/core';\n * import { tensor } from 'deepbox/ndarray';\n *\n * const dtype: DType = 'float32';\n * const x = tensor([1, 2, 3], { dtype });\n * ```\n *\n * @see {@link https://numpy.org/doc/stable/user/basics.types.html | NumPy Data Types}\n */\nexport type DType = \"float32\" | \"float64\" | \"int32\" | \"int64\" | \"uint8\" | \"bool\" | \"string\";\n\n/**\n * Array of all supported data types.\n *\n * Use this constant for validation or UI selection.\n *\n * @example\n * ```ts\n * import { DTYPES } from 'deepbox/core';\n *\n * console.log(DTYPES);\n * // ['float32', 'float64', 'int32', 'int64', 'uint8', 'bool', 'string']\n * ```\n */\nexport const DTYPES: readonly DType[] = [\n \"float32\",\n \"float64\",\n \"int32\",\n \"int64\",\n \"uint8\",\n \"bool\",\n \"string\",\n];\n\n/**\n * Type guard to check if a value is a valid DType.\n *\n * @param value - The value to check\n * @returns True if value is a valid DType, false otherwise\n *\n * @example\n * ```ts\n * import { isDType } from 'deepbox/core';\n *\n * if (isDType('float32')) {\n * console.log('Valid dtype');\n * }\n *\n * isDType('float128'); // false\n * isDType('int32'); // true\n * ```\n */\nexport function isDType(value: unknown): value is DType {\n if (typeof value !== \"string\") {\n return false;\n }\n for (const d of DTYPES) {\n if (d === value) {\n return true;\n }\n }\n return false;\n}\n","import { DataValidationError } from \"../errors/validation\";\nimport type { Shape } from \"../types/common\";\nimport { DEVICES, type Device, isDevice } from \"../types/device\";\nimport { DTYPES, type DType, isDType } from \"../types/dtype\";\n\n/**\n * Calculate the total number of elements from a shape.\n *\n * @param shape - The shape to calculate size from\n * @param name - Parameter name for error messages (default: 'shape')\n * @returns Total number of elements\n * @throws {DataValidationError} If shape is invalid or size exceeds safe integer range\n */\nexport function shapeToSize(shape: Shape): number;\nexport function shapeToSize(shape: unknown, name?: string): number;\nexport function shapeToSize(shape: unknown, name = \"shape\"): number {\n const validated = validateShape(shape, name);\n let size = 1;\n\n for (const dim of validated) {\n if (dim === 0) return 0;\n\n if (size > Number.MAX_SAFE_INTEGER / dim) {\n throw new DataValidationError(\n `${name} is too large; total size exceeds ${Number.MAX_SAFE_INTEGER}`\n );\n }\n size *= dim;\n }\n return size;\n}\n\n/**\n * Validate that a shape is well-formed.\n *\n * Checks that:\n * - Value is an array\n * - All elements are finite non-negative integers\n * - All elements are safe integers\n *\n * @param shape - The shape to validate\n * @param name - Parameter name for error messages (default: 'shape')\n * @returns The validated shape\n * @throws {DataValidationError} If shape is invalid\n */\nexport function validateShape(shape: Shape, name?: string): Shape;\nexport function validateShape(shape: unknown, name?: string): Shape;\nexport function validateShape(shape: unknown, name = \"shape\"): Shape {\n if (!Array.isArray(shape)) {\n throw new DataValidationError(`${name} must be an array of integers`);\n }\n\n const validated: number[] = [];\n for (let i = 0; i < shape.length; i++) {\n const dim: unknown = shape[i];\n\n if (typeof dim !== \"number\" || !Number.isFinite(dim) || !Number.isInteger(dim)) {\n throw new DataValidationError(\n `${name}[${i}] must be a finite integer; received ${String(dim)}`\n );\n }\n if (dim < 0) {\n throw new DataValidationError(`${name}[${i}] must be >= 0; received ${dim}`);\n }\n if (!Number.isSafeInteger(dim)) {\n throw new DataValidationError(\n `${name}[${i}] must be a safe integer (<= ${Number.MAX_SAFE_INTEGER}); received ${dim}`\n );\n }\n validated.push(dim);\n }\n\n return validated;\n}\n\n/**\n * Validate that a `dtype` is supported.\n *\n * @param dtype - The data type to validate\n * @param name - The parameter name for error messages\n * @returns The validated dtype (typed as {@link DType})\n * @throws {DataValidationError} If dtype is not valid\n */\nexport function validateDtype(dtype: DType, name?: string): DType;\nexport function validateDtype(dtype: unknown, name?: string): DType;\nexport function validateDtype(dtype: unknown, name = \"dtype\"): DType {\n if (!isDType(dtype)) {\n throw new DataValidationError(\n `${name} must be one of [${DTYPES.join(\", \")}]; received ${String(dtype)}`\n );\n }\n return dtype;\n}\n\n/**\n * Validate that a `device` is supported.\n *\n * @param device - The device to validate\n * @param name - The parameter name for error messages\n * @returns The validated device (typed as {@link Device})\n * @throws {DataValidationError} If device is not valid\n */\nexport function validateDevice(device: Device, name?: string): Device;\nexport function validateDevice(device: unknown, name?: string): Device;\nexport function validateDevice(device: unknown, name = \"device\"): Device {\n if (!isDevice(device)) {\n throw new DataValidationError(\n `${name} must be one of [${DEVICES.join(\", \")}]; received ${String(device)}`\n );\n }\n return device;\n}\n\n/**\n * Validate that a value is positive (> 0).\n *\n * @param value - The value to validate\n * @param name - The parameter name for error messages\n * @throws {DataValidationError} If value is not positive\n */\nexport function validatePositive(value: number, name: string): void {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n throw new DataValidationError(`${name} must be a finite number; received ${String(value)}`);\n }\n if (value <= 0) {\n throw new DataValidationError(`${name} must be positive (> 0); received ${value}`);\n }\n}\n\n/**\n * Validate that a value is non-negative (>= 0).\n *\n * @param value - The value to validate\n * @param name - The parameter name for error messages\n * @throws {DataValidationError} If value is negative\n */\nexport function validateNonNegative(value: number, name: string): void {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n throw new DataValidationError(`${name} must be a finite number; received ${String(value)}`);\n }\n if (value < 0) {\n throw new DataValidationError(`${name} must be non-negative (>= 0); received ${value}`);\n }\n}\n\n/**\n * Validate that a value is within a specified range [min, max].\n *\n * @param value - The value to validate\n * @param min - The minimum allowed value (inclusive)\n * @param max - The maximum allowed value (inclusive)\n * @param name - The parameter name for error messages\n * @throws {DataValidationError} If value is out of range or bounds are invalid\n */\nexport function validateRange(value: number, min: number, max: number, name: string): void {\n if (typeof min !== \"number\" || !Number.isFinite(min)) {\n throw new DataValidationError(`${name} min must be a finite number; received ${String(min)}`);\n }\n if (typeof max !== \"number\" || !Number.isFinite(max)) {\n throw new DataValidationError(`${name} max must be a finite number; received ${String(max)}`);\n }\n if (min > max) {\n throw new DataValidationError(`${name} min must be <= max; received min=${min}, max=${max}`);\n }\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n throw new DataValidationError(`${name} must be a finite number; received ${String(value)}`);\n }\n if (value < min || value > max) {\n throw new DataValidationError(`${name} must be in range [${min}, ${max}]; received ${value}`);\n }\n}\n\n/**\n * Validate that a value is a safe integer.\n *\n * @param value - The value to validate\n * @param name - The parameter name for error messages\n * @throws {DataValidationError} If value is not a safe integer\n */\nexport function validateInteger(value: number, name: string): void {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n throw new DataValidationError(`${name} must be a finite number; received ${String(value)}`);\n }\n if (!Number.isInteger(value)) {\n throw new DataValidationError(`${name} must be an integer; received ${value}`);\n }\n if (!Number.isSafeInteger(value)) {\n throw new DataValidationError(\n `${name} must be a safe integer (<= ${Number.MAX_SAFE_INTEGER}); received ${value}`\n );\n }\n}\n\n/**\n * Validate that a value is one of the allowed options.\n *\n * @param value - The value to validate\n * @param options - The array of allowed values\n * @param name - The parameter name for error messages\n * @throws {DataValidationError} If value is not in options\n */\nexport function validateOneOf<T extends string>(\n value: unknown,\n options: readonly T[],\n name: string\n): asserts value is T {\n if (typeof value !== \"string\") {\n throw new DataValidationError(`${name} must be a string; received ${typeof value}`);\n }\n let found = false;\n for (const opt of options) {\n if (opt === value) {\n found = true;\n break;\n }\n }\n if (!found) {\n throw new DataValidationError(\n `${name} must be one of [${options.join(\", \")}]; received ${String(value)}`\n );\n }\n}\n\n/**\n * Validate that a value is an array.\n *\n * @param arr - The value to validate\n * @param name - The parameter name for error messages\n * @throws {DataValidationError} If value is not an array\n */\nexport function validateArray(arr: unknown, name: string): asserts arr is unknown[] {\n if (!Array.isArray(arr)) {\n throw new DataValidationError(`${name} must be an array; received ${typeof arr}`);\n }\n}\n","import { DataValidationError } from \"../errors/validation\";\nimport type { Device } from \"../types/device\";\nimport type { DType } from \"../types/dtype\";\nimport { validateDevice, validateDtype, validateInteger } from \"../utils/validation\";\n\n/**\n * Global configuration for Deepbox.\n *\n * @property defaultDtype - Default data type for new tensors\n * @property defaultDevice - Default compute device\n * @property seed - Random seed for reproducibility (null = not set)\n */\nexport type DeepboxConfig = {\n readonly defaultDtype: DType;\n readonly defaultDevice: Device;\n readonly seed: number | null;\n};\n\nconst DEFAULT_CONFIG: DeepboxConfig = {\n defaultDtype: \"float32\",\n defaultDevice: \"cpu\",\n seed: null,\n};\n\ntype ConfigKey = keyof DeepboxConfig;\n\n/**\n * Allowed config keys (used for defensive validation of user-provided config objects).\n *\n * Kept as a readonly array for stable iteration and clear error messaging.\n */\nconst CONFIG_KEYS: readonly ConfigKey[] = [\"defaultDtype\", \"defaultDevice\", \"seed\"];\n\nlet config: DeepboxConfig = { ...DEFAULT_CONFIG };\n\nfunction isPlainConfigObject(value: object): boolean {\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction hasOwnConfigKey(source: Partial<DeepboxConfig>, key: ConfigKey): boolean {\n return Object.hasOwn(source, key);\n}\n\nfunction normalizeSeed(value: unknown, name: string, allowNull: true): number | null;\nfunction normalizeSeed(value: unknown, name: string, allowNull: false): number;\nfunction normalizeSeed(value: unknown, name: string, allowNull: boolean): number | null {\n // Accept explicit null only when allowed by the caller (seed in global config supports null).\n if (value === null) {\n if (allowNull) {\n return null;\n }\n throw new DataValidationError(`${name} must be a safe integer; received null`);\n }\n\n // Reject non-numeric values early with a descriptive message.\n if (typeof value !== \"number\") {\n throw new DataValidationError(`${name} must be a finite number; received ${String(value)}`);\n }\n\n // validateInteger enforces finite, integer, and safe-integer constraints.\n validateInteger(value, name);\n return value;\n}\n\n/**\n * Get the current global configuration.\n *\n * Returns a copy of the configuration to prevent external mutation.\n *\n * @returns Current configuration object\n *\n * @example\n * ```ts\n * import { getConfig } from 'deepbox/core';\n *\n * const config = getConfig();\n * console.log(config.defaultDtype); // 'float32'\n * ```\n */\nexport function getConfig(): Readonly<DeepboxConfig> {\n return { ...config };\n}\n\n/**\n * Update global configuration.\n *\n * Merges provided settings with current configuration.\n * Only specified fields are updated.\n *\n * @param next - Partial configuration to merge\n * @throws {DataValidationError} If config is invalid or contains unknown keys\n *\n * @example\n * ```ts\n * import { setConfig } from 'deepbox/core';\n *\n * setConfig({\n * defaultDtype: 'float64',\n * seed: 42\n * });\n * ```\n */\nexport function setConfig(next: Partial<DeepboxConfig>): void {\n // Validate the incoming value is an object (not null / array).\n if (next === null || typeof next !== \"object\" || Array.isArray(next)) {\n throw new DataValidationError(`config must be an object with keys [${CONFIG_KEYS.join(\", \")}]`);\n }\n\n // Reject non-plain objects (e.g., class instances) to avoid prototype surprises.\n if (!isPlainConfigObject(next)) {\n throw new DataValidationError(\n `config must be a plain object with keys [${CONFIG_KEYS.join(\", \")}]`\n );\n }\n\n // Find unsupported keys explicitly (defensive API design).\n const keys = Object.keys(next);\n const unknownKeys: string[] = [];\n for (const key of keys) {\n let isKnown = false;\n for (const allowed of CONFIG_KEYS) {\n if (allowed === key) {\n isKnown = true;\n break;\n }\n }\n if (!isKnown) {\n unknownKeys.push(key);\n }\n }\n\n // Fail fast with an actionable message listing allowed keys.\n if (unknownKeys.length > 0) {\n throw new DataValidationError(\n `config contains unsupported keys: ${unknownKeys.join(\", \")}. Allowed keys are [${CONFIG_KEYS.join(\n \", \"\n )}]`\n );\n }\n\n // Apply validated updates field-by-field (only if explicitly provided).\n const nextDefaultDtype = hasOwnConfigKey(next, \"defaultDtype\")\n ? validateDtype(next.defaultDtype, \"defaultDtype\")\n : config.defaultDtype;\n\n const nextDefaultDevice = hasOwnConfigKey(next, \"defaultDevice\")\n ? validateDevice(next.defaultDevice, \"defaultDevice\")\n : config.defaultDevice;\n\n const nextSeed = hasOwnConfigKey(next, \"seed\")\n ? normalizeSeed(next.seed, \"seed\", true)\n : config.seed;\n\n // Commit the new immutable config snapshot.\n config = {\n defaultDtype: nextDefaultDtype,\n defaultDevice: nextDefaultDevice,\n seed: nextSeed,\n };\n}\n\n/**\n * Reset configuration to default values.\n *\n * @example\n * ```ts\n * import { resetConfig } from 'deepbox/core';\n *\n * resetConfig(); // Back to defaults\n * ```\n */\nexport function resetConfig(): void {\n config = { ...DEFAULT_CONFIG };\n}\n\n/**\n * Set the global random seed for reproducibility.\n *\n * @param seed - Integer seed value\n * @throws {DataValidationError} If seed is not a safe integer\n *\n * @example\n * ```ts\n * import { setSeed } from 'deepbox/core';\n *\n * setSeed(42); // All random operations now reproducible\n * ```\n */\nexport function setSeed(seed: number): void {\n const normalized = normalizeSeed(seed, \"seed\", false);\n config = { ...config, seed: normalized };\n}\n\n/**\n * Get the current random seed.\n *\n * @returns Current seed value or null if not set\n */\nexport function getSeed(): number | null {\n return config.seed;\n}\n\n/**\n * Set the default compute device.\n *\n * @param device - Device to use ('cpu', 'webgpu', or 'wasm')\n * @throws {DataValidationError} If device is not supported\n *\n * @example\n * ```ts\n * import { setDevice } from 'deepbox/core';\n *\n * setDevice('cpu'); // Use CPU for all operations\n * ```\n */\nexport function setDevice(device: Device): void {\n const normalized = validateDevice(device, \"device\");\n config = { ...config, defaultDevice: normalized };\n}\n\n/**\n * Get the current default device.\n *\n * @returns Current default device\n */\nexport function getDevice(): Device {\n return config.defaultDevice;\n}\n\n/**\n * Set the default data type for new tensors.\n *\n * @param dtype - Data type to use as default\n * @throws {DataValidationError} If dtype is not supported\n *\n * @example\n * ```ts\n * import { setDtype } from 'deepbox/core';\n *\n * setDtype('float64'); // Use double precision by default\n * ```\n */\nexport function setDtype(dtype: DType): void {\n const normalized = validateDtype(dtype, \"dtype\");\n config = { ...config, defaultDtype: normalized };\n}\n\n/**\n * Get the current default data type.\n *\n * @returns Current default dtype\n */\nexport function getDtype(): DType {\n return config.defaultDtype;\n}\n","import type { Shape } from \"../types/common\";\nimport { DeepboxError } from \"./base\";\n\nfunction cloneShape(shape: Shape): Shape {\n return Object.freeze([...shape]);\n}\n\n/**\n * Error thrown when tensor shapes cannot be broadcast together.\n *\n * Broadcasting allows operations on tensors of different shapes by automatically\n * expanding dimensions. This error occurs when shapes are incompatible.\n *\n * @example\n * ```ts\n * // Broadcasting (3, 4) and (4,) works -> (3, 4)\n * // Broadcasting (3, 4) and (3,) fails\n * if (!canBroadcast(shape1, shape2)) {\n * throw new BroadcastError(shape1, shape2);\n * }\n * ```\n *\n * References:\n * - NumPy broadcasting: https://numpy.org/doc/stable/user/basics.broadcasting.html\n */\nexport class BroadcastError extends DeepboxError {\n override name = \"BroadcastError\";\n\n /** The first shape involved in the broadcast operation */\n readonly shape1: Shape;\n\n /** The second shape involved in the broadcast operation */\n readonly shape2: Shape;\n\n constructor(shape1: Shape, shape2: Shape, context?: string) {\n // Build context string if provided (e.g., \"in matrix multiplication\")\n const ctx = context ? ` (${context})` : \"\";\n // Create descriptive error message showing both incompatible shapes\n super(`Shapes [${shape1}] and [${shape2}] cannot be broadcast together${ctx}`);\n // Store shapes for programmatic error handling\n this.shape1 = cloneShape(shape1);\n this.shape2 = cloneShape(shape2);\n }\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Details for convergence failures.\n *\n * @property iterations - Number of iterations completed before failure\n * @property tolerance - Tolerance value used for convergence checks\n */\nexport type ConvergenceErrorDetails = {\n readonly iterations?: number;\n readonly tolerance?: number;\n};\n\n/**\n * Error thrown when an iterative algorithm fails to converge within\n * the maximum allowed iterations.\n *\n * This is a thrown exception that extends {@link DeepboxError}; callers\n * should handle it with standard try/catch.\n *\n * @example\n * ```ts\n * if (iterations >= maxIterations) {\n * throw new ConvergenceError(\n * `Algorithm did not converge after ${maxIterations} iterations`\n * );\n * }\n * ```\n *\n * References:\n * - scikit-learn convergence diagnostics:\n * https://scikit-learn.org/stable/modules/generated/sklearn.exceptions.ConvergenceWarning.html\n */\nexport class ConvergenceError extends DeepboxError {\n override name = \"ConvergenceError\";\n\n /** Number of iterations completed before convergence failure */\n readonly iterations?: number;\n\n /** Tolerance value used for convergence check */\n readonly tolerance?: number;\n\n constructor(message: string, details?: ConvergenceErrorDetails) {\n super(message);\n if (details?.iterations !== undefined) {\n this.iterations = details.iterations;\n }\n if (details?.tolerance !== undefined) {\n this.tolerance = details.tolerance;\n }\n }\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Error thrown when an operation is requested on an unsupported or unavailable compute device.\n *\n * This is intended for device selection / dispatch layers (e.g. attempting to use `webgpu`\n * in an environment where WebGPU is not available).\n */\nexport class DeviceError extends DeepboxError {\n /**\n * Discriminator name for this error type.\n */\n override name = \"DeviceError\";\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Error thrown when a requested dtype is unsupported or cannot be handled by the current\n * implementation.\n *\n * This is used in low-level dtype utilities (e.g. mapping a `DType` to a TypedArray\n * constructor) to provide a stable, package-specific error type.\n */\nexport class DTypeError extends DeepboxError {\n /**\n * Discriminator name for this error type.\n */\n override name = \"DTypeError\";\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Error thrown when an invalid index is used to access tensor elements.\n *\n * @example\n * ```ts\n * if (index < 0 || index >= length) {\n * throw new IndexError(`Index ${index} is out of bounds for length ${length}`);\n * }\n * ```\n */\nexport class IndexError extends DeepboxError {\n override name = \"IndexError\";\n\n /** The invalid index value */\n readonly index?: number;\n\n /** The valid range for the index */\n readonly validRange?: readonly [number, number];\n\n constructor(\n message: string,\n details?: {\n readonly index?: number;\n readonly validRange?: readonly [number, number];\n }\n ) {\n super(message);\n if (details?.index !== undefined) {\n this.index = details.index;\n }\n if (details?.validRange !== undefined) {\n this.validRange = details.validRange;\n }\n }\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Error thrown when invalid parameters are passed to a function or method.\n *\n * @example\n * ```ts\n * function kmeans(k: number, maxIter: number) {\n * if (k <= 0) {\n * throw new InvalidParameterError('k must be positive', 'k', k);\n * }\n * // ... algorithm logic\n * }\n * ```\n */\nexport class InvalidParameterError extends DeepboxError {\n override name = \"InvalidParameterError\";\n\n /** The name of the invalid parameter */\n readonly parameterName?: string;\n\n /** The invalid value that was provided */\n readonly value?: unknown;\n\n constructor(message: string, parameterName?: string, value?: unknown) {\n super(message);\n if (parameterName !== undefined) {\n this.parameterName = parameterName;\n }\n if (value !== undefined) {\n this.value = value;\n }\n }\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Error thrown when memory allocation fails or memory limits are exceeded.\n *\n * @example\n * ```ts\n * if (requestedBytes > MAX_MEMORY) {\n * throw new MemoryError(`Cannot allocate ${requestedBytes} bytes`);\n * }\n * ```\n */\nexport class MemoryError extends DeepboxError {\n override name = \"MemoryError\";\n\n /** The amount of memory requested in bytes */\n readonly requestedBytes?: number;\n\n /** The amount of memory available in bytes */\n readonly availableBytes?: number;\n\n constructor(\n message: string,\n details?: {\n readonly requestedBytes?: number;\n readonly availableBytes?: number;\n }\n ) {\n super(message);\n if (details?.requestedBytes !== undefined) {\n this.requestedBytes = details.requestedBytes;\n }\n if (details?.availableBytes !== undefined) {\n this.availableBytes = details.availableBytes;\n }\n }\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Error thrown when a model or estimator is used before being fitted.\n *\n * This is analogous to sklearn's NotFittedError.\n *\n * @example\n * ```ts\n * class MyModel {\n * private fitted = false;\n *\n * fit(X: Tensor, y: Tensor) {\n * // ... fitting logic\n * this.fitted = true;\n * }\n *\n * predict(X: Tensor) {\n * if (!this.fitted) {\n * throw new NotFittedError('Model must be fitted before prediction');\n * }\n * // ... prediction logic\n * }\n * }\n * ```\n *\n * References:\n * - scikit-learn NotFittedError: https://scikit-learn.org/stable/modules/generated/sklearn.exceptions.NotFittedError.html\n */\nexport class NotFittedError extends DeepboxError {\n override name = \"NotFittedError\";\n\n /** The name of the model or estimator that was not fitted */\n readonly modelName?: string;\n\n constructor(message: string, modelName?: string) {\n super(message);\n if (modelName !== undefined) {\n this.modelName = modelName;\n }\n }\n}\n","import { DeepboxError } from \"./base\";\n\n/**\n * Error thrown when a method or code path exists in the public API but is not implemented yet.\n *\n * Use this instead of a generic `Error` so callers can reliably detect this specific\n * capability gap.\n */\nexport class NotImplementedError extends DeepboxError {\n /**\n * Discriminator name for this error type.\n */\n override name = \"NotImplementedError\";\n\n /**\n * Create a new NotImplementedError.\n *\n * @param message - Optional error message.\n */\n constructor(message = \"Not implemented\") {\n super(message);\n }\n}\n","import type { Shape } from \"../types/common\";\nimport { DeepboxError } from \"./base\";\n\nfunction cloneShape(shape: Shape): Shape {\n return Object.freeze([...shape]);\n}\n\n/**\n * Details about a shape mismatch error.\n *\n * @property expected - The expected shape\n * @property received - The actual shape that was received\n * @property context - Additional context about where the error occurred\n */\nexport type ShapeErrorDetails = {\n readonly expected?: Shape;\n readonly received?: Shape;\n readonly context?: string;\n};\n\n/**\n * Error thrown when tensor shapes are incompatible or invalid.\n *\n * This error is used throughout the library when operations require specific\n * tensor shapes that don't match the provided tensors.\n *\n * @example\n * ```ts\n * import { ShapeError } from 'deepbox/core';\n *\n * if (tensor.shape[0] !== expectedRows) {\n * throw ShapeError.mismatch([expectedRows, cols], tensor.shape, 'matrix multiplication');\n * }\n * ```\n */\nexport class ShapeError extends DeepboxError {\n override name = \"ShapeError\";\n\n readonly expected: Shape | undefined;\n readonly received: Shape | undefined;\n readonly context: string | undefined;\n\n constructor(message: string, details: ShapeErrorDetails = {}) {\n // Call parent constructor with error message\n super(message);\n // Store optional shape details for programmatic error handling\n this.expected = details.expected === undefined ? undefined : cloneShape(details.expected);\n this.received = details.received === undefined ? undefined : cloneShape(details.received);\n this.context = details.context;\n }\n\n /**\n * Create a ShapeError for a shape mismatch.\n *\n * Convenience factory method for the common case of shape mismatches.\n *\n * @param expected - The expected shape\n * @param received - The actual shape that was received\n * @param context - Optional context about where the mismatch occurred\n * @returns A new ShapeError with formatted message and details\n *\n * @example\n * ```ts\n * throw ShapeError.mismatch([3, 4], [3, 5], 'matrix multiplication');\n * // Error: Shape mismatch (matrix multiplication): expected [3,4], received [3,5]\n * ```\n */\n static mismatch(expected: Shape, received: Shape, context?: string): ShapeError {\n // Build context string if provided\n const ctx = context ? ` (${context})` : \"\";\n // Construct details object with conditional context field\n // Using satisfies ensures type safety without widening types\n const details = {\n expected,\n received,\n ...(context !== undefined ? { context } : {}),\n } satisfies ShapeErrorDetails;\n // Create and return a new ShapeError with formatted message\n return new ShapeError(\n `Shape mismatch${ctx}: expected [${expected}], received [${received}]`,\n details\n );\n }\n}\n","import { InvalidParameterError } from \"../errors\";\nimport type { Axis } from \"../types/common\";\n\n/**\n * Normalize an axis argument to a valid dimension index.\n *\n * Supports negative indexing (Python-style) and string aliases:\n * - \"index\" or \"rows\" -> 0\n * - \"columns\" -> 1\n *\n * @param axis - Axis identifier (index or alias)\n * @param ndim - Number of dimensions in the tensor\n * @returns Non-negative integer dimension index\n * @throws {InvalidParameterError} If axis is out of bounds\n * @throws {InvalidParameterError} If axis alias is invalid\n */\nexport function normalizeAxis(axis: Axis, ndim: number): number {\n if (!Number.isInteger(ndim) || ndim < 0) {\n throw new InvalidParameterError(\n `ndim must be a non-negative integer; received ${ndim}`,\n \"ndim\",\n ndim\n );\n }\n\n let ax: number;\n if (typeof axis === \"string\") {\n if (axis === \"index\" || axis === \"rows\") {\n ax = 0;\n } else if (axis === \"columns\") {\n ax = 1;\n } else {\n throw new InvalidParameterError(\n `Invalid axis: '${axis}'. Must be 'index', 'rows', or 'columns'`,\n \"axis\",\n axis\n );\n }\n } else {\n if (!Number.isInteger(axis)) {\n throw new InvalidParameterError(`axis must be an integer; received ${axis}`, \"axis\", axis);\n }\n ax = axis;\n }\n\n // Handle negative indexing\n const normalized = ax < 0 ? ndim + ax : ax;\n\n if (normalized < 0 || normalized >= ndim) {\n throw new InvalidParameterError(`axis ${axis} is out of bounds for ndim=${ndim}`, \"axis\", axis);\n }\n\n return normalized;\n}\n\n/**\n * Normalize a list of axes to valid dimension indices.\n *\n * Checks for duplicates and validity of each axis.\n *\n * @param axis - Single axis or array of axes\n * @param ndim - Number of dimensions\n * @returns Array of unique non-negative integer dimension indices\n * @throws {InvalidParameterError} If any axis is invalid, out of bounds, or duplicated\n */\nexport function normalizeAxes(axis: Axis | Axis[], ndim: number): number[] {\n if (!Number.isInteger(ndim) || ndim < 0) {\n throw new InvalidParameterError(\n `ndim must be a non-negative integer; received ${ndim}`,\n \"ndim\",\n ndim\n );\n }\n\n const axes = Array.isArray(axis) ? axis : [axis];\n const seen = new Set<number>();\n const normalized: number[] = [];\n for (const ax of axes) {\n const norm = normalizeAxis(ax, ndim);\n if (seen.has(norm)) {\n throw new InvalidParameterError(\"duplicate axis\", \"axis\", axis);\n }\n seen.add(norm);\n normalized.push(norm);\n }\n return normalized;\n}\n","import { DTypeError } from \"../errors/dtype\";\nimport type { DType } from \"../types/index\";\n\nexport type NumericDType = Exclude<DType, \"string\">;\n\n/**\n * Ensure a dtype is numeric (non-string).\n *\n * @param dtype - Data type identifier\n * @param context - Context string for error messages\n * @returns The same dtype narrowed to numeric types\n * @throws {DTypeError} If dtype is 'string'\n */\nexport function ensureNumericDType(dtype: DType, context: string): NumericDType {\n if (dtype === \"string\") {\n throw new DTypeError(`${context} does not support string dtype`);\n }\n return dtype;\n}\n\n/**\n * Get TypedArray constructor for a given DType.\n *\n * Maps Deepbox dtype strings to JavaScript TypedArray constructors.\n * Used internally for allocating tensor storage.\n *\n * **Mapping:**\n * - `float32` → `Float32Array`\n * - `float64` → `Float64Array`\n * - `int32` → `Int32Array`\n * - `int64` → `BigInt64Array`\n * - `uint8` → `Uint8Array`\n * - `bool` → `Uint8Array` (1 byte per boolean)\n * - `string` → Not supported (throws error)\n *\n * @param dtype - Data type identifier\n * @returns TypedArray constructor for the given dtype\n * @throws {DTypeError} If dtype is 'string' (not yet supported)\n *\n * @example\n * ```ts\n * const Ctor = dtypeToTypedArrayCtor('float32');\n * const arr = new Ctor(10); // Float32Array with 10 elements\n * ```\n */\nexport function dtypeToTypedArrayCtor(\n dtype: DType\n):\n | Float32ArrayConstructor\n | Float64ArrayConstructor\n | Int32ArrayConstructor\n | BigInt64ArrayConstructor\n | Uint8ArrayConstructor {\n switch (dtype) {\n case \"float32\":\n return Float32Array;\n case \"float64\":\n return Float64Array;\n case \"int32\":\n return Int32Array;\n case \"int64\":\n return BigInt64Array;\n case \"uint8\":\n return Uint8Array;\n case \"bool\":\n return Uint8Array;\n case \"string\":\n throw new DTypeError(\"string dtype is not supported for TypedArray storage\");\n default: {\n const _exhaustive: never = dtype;\n throw new DTypeError(`Unsupported dtype: ${String(_exhaustive)}`);\n }\n }\n}\n","/**\n * Type-safe typed array accessor utilities.\n *\n * These utilities provide safe access to TypedArray elements without\n * requiring unsafe type assertions. They handle the `noUncheckedIndexedAccess`\n * TypeScript configuration properly.\n *\n * Element accessors for TypedArray storage throw {@link IndexError} on\n * out-of-bounds access to surface stride/index bugs immediately rather\n * than silently returning zero.\n */\n\nimport { IndexError } from \"../errors/indexError\";\nimport { DataValidationError } from \"../errors/validation\";\nimport type { TypedArray } from \"../types/common\";\n\nconst MAX_SAFE_BIGINT = BigInt(Number.MAX_SAFE_INTEGER);\nconst MIN_SAFE_BIGINT = BigInt(Number.MIN_SAFE_INTEGER);\n\n/**\n * Numeric typed arrays (excludes BigInt64Array).\n */\nexport type NumericTypedArray = Float32Array | Float64Array | Int32Array | Uint8Array;\n\n/**\n * Get an element from a numeric typed array at the specified index.\n *\n * @param arr - The numeric typed array\n * @param index - The index to access\n * @returns The element at the index\n * @throws {IndexError} If the index is out of bounds\n */\nexport function getNumericElement(arr: NumericTypedArray, index: number): number {\n const value = arr[index];\n if (value === undefined) {\n throw new IndexError(\n `Index ${index} is out of bounds for typed array of length ${arr.length}`,\n { index, validRange: [0, arr.length - 1] }\n );\n }\n return value;\n}\n\n/**\n * Get an element from a BigInt64Array at the specified index.\n *\n * @param arr - The BigInt64Array\n * @param index - The index to access\n * @returns The element at the index\n * @throws {IndexError} If the index is out of bounds\n */\nexport function getBigIntElement(arr: BigInt64Array, index: number): bigint {\n const value = arr[index];\n if (value === undefined) {\n throw new IndexError(\n `Index ${index} is out of bounds for BigInt64Array of length ${arr.length}`,\n { index, validRange: [0, arr.length - 1] }\n );\n }\n return value;\n}\n\n/**\n * Get an element from a TypedArray, returning as number.\n * For BigInt64Array, converts to number (throws if out of safe integer range).\n *\n * @param arr - The typed array\n * @param index - The index to access\n * @returns The element at the index as a number\n * @throws {IndexError} If the index is out of bounds\n * @throws {DataValidationError} If a bigint value exceeds the safe integer range\n */\nexport function getElementAsNumber(arr: TypedArray, index: number): number {\n if (arr instanceof BigInt64Array) {\n const value = arr[index];\n if (value === undefined) {\n throw new IndexError(\n `Index ${index} is out of bounds for BigInt64Array of length ${arr.length}`,\n { index, validRange: [0, arr.length - 1] }\n );\n }\n if (value > MAX_SAFE_BIGINT || value < MIN_SAFE_BIGINT) {\n throw new DataValidationError(\n `BigInt value at index ${index} exceeds safe integer range; received ${value.toString()}`\n );\n }\n return Number(value);\n }\n const value = arr[index];\n if (value === undefined) {\n throw new IndexError(\n `Index ${index} is out of bounds for typed array of length ${arr.length}`,\n { index, validRange: [0, arr.length - 1] }\n );\n }\n return value;\n}\n\n/**\n * Get an element from a shape array at the specified index.\n * Returns 1 if the index is out of bounds (used in broadcasting where\n * missing leading dimensions are treated as size 1).\n *\n * @param shape - The shape array\n * @param index - The index to access\n * @returns The dimension at the index, or 1 if out of bounds\n */\nexport function getShapeDim(shape: readonly number[], index: number): number {\n const value = shape[index];\n return value !== undefined ? value : 1;\n}\n\n/**\n * Get an element from a number array at the specified index.\n * Returns the provided default value if the index is out of bounds.\n *\n * @param arr - The number array\n * @param index - The index to access\n * @param defaultValue - The default value to return if out of bounds (default: 0)\n * @returns The element at the index, or the default value if out of bounds\n */\nexport function getArrayElement(arr: readonly number[], index: number, defaultValue = 0): number {\n const value = arr[index];\n return value !== undefined ? value : defaultValue;\n}\n\n/**\n * Safely get a string from a string array at the specified index.\n * Returns empty string if the index is out of bounds.\n *\n * @param arr - The string array\n * @param index - The index to access\n * @returns The string at the index, or empty string if out of bounds\n */\nexport function getStringElement(arr: readonly string[], index: number): string {\n const value = arr[index];\n return value !== undefined ? value : \"\";\n}\n\n/**\n * Create a readonly number array from mutable array with proper typing.\n * This avoids the need for `as Shape` assertions.\n *\n * @param arr - The mutable number array\n * @returns The same array typed as readonly\n */\nexport function asReadonlyArray<T extends number[]>(arr: T): readonly number[] {\n return arr;\n}\n\n/**\n * Type guard to check if a typed array is a BigInt64Array.\n *\n * @param arr - The typed array to check\n * @returns True if the array is a BigInt64Array\n */\nexport function isBigInt64Array(arr: TypedArray): arr is BigInt64Array {\n return arr instanceof BigInt64Array;\n}\n\n/**\n * Type guard to check if a typed array is a numeric (non-BigInt) array.\n *\n * @param arr - The typed array to check\n * @returns True if the array is a numeric typed array\n */\nexport function isNumericTypedArray(arr: TypedArray): arr is NumericTypedArray {\n return !(arr instanceof BigInt64Array);\n}\n","import type { TypedArray } from \"../types/common\";\n\n/**\n * Type guard to check if a value is one of the supported TypedArray types.\n *\n * Returns true only for the exact TypedArray subclasses in the Deepbox\n * {@link TypedArray} union: Float32Array, Float64Array, Int32Array,\n * BigInt64Array, and Uint8Array. Returns false for unsupported typed arrays\n * (e.g. Uint16Array, Int16Array), DataView, and regular arrays.\n *\n * @param value - The value to check\n * @returns True if value is a supported TypedArray, false otherwise\n *\n * @example\n * ```ts\n * import { isTypedArray } from 'deepbox/core';\n *\n * isTypedArray(new Float32Array(10)); // true\n * isTypedArray(new Uint16Array(10)); // false (unsupported)\n * isTypedArray([1, 2, 3]); // false\n * isTypedArray(new DataView(new ArrayBuffer(10))); // false\n * ```\n */\nexport function isTypedArray(value: unknown): value is TypedArray {\n return (\n value instanceof Float32Array ||\n value instanceof Float64Array ||\n value instanceof Int32Array ||\n value instanceof BigInt64Array ||\n value instanceof Uint8Array\n );\n}\n"]}
|