RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • chol
    • decomposition
    • eig
    • eigs
    • lu
    • qr
    • svd

decomposition — Create matrix decomposition objects for reusable linear solves, with explicitly gated RunMat extensions.

dA = decomposition(A) creates a decomposition object that can be reused with dA \ b and b / dA. RunMat stores a validated coefficient matrix and routes solves through the same MATLAB-compatible mldivide and mrdivide engines used by ordinary matrix division.

Syntax

dA = decomposition(A)
dA = decomposition(A, type)
dA = decomposition(A, type, triangularFlag)
dA = decomposition(___, Name, Value)

Inputs

NameTypeRequiredDefaultDescription
argsAnyVariadic—Coefficient matrix, optional type, triangular flag, and name-value options.

Returns

NameTypeDescription
dAAnyMatrix decomposition object.

Errors

IdentifierWhenMessage
RunMat:decomposition:InvalidInputThe matrix, type, option, or object operation is invalid.decomposition: invalid input
RunMat:decomposition:InternalRuntime cannot materialize a decomposition object or transformed coefficient matrix.decomposition: internal runtime failure

How decomposition works

  • The MATLAB-compatible surface accepts full real or complex coefficient matrices of class single or double. With RunMat extensions enabled, all eight integer coefficient classes and logical coefficients are accepted and retained exactly in the object; strict compatibility mode rejects those forms before gathering a resident value. Sparse inputs remain rejected until RunMat has a sparse solve path behind the decomposition object.
  • Supported type strings are 'auto', 'lu', 'qr', 'chol', 'triangular', and 'diagonal'. The default 'auto' selects diagonal, triangular, lu, or qr based on the matrix shape and structure.
  • Square-only types reject rectangular matrices. The diagonal and triangular types validate the corresponding structure. The optional 'upper' or 'lower' triangular flag is supported for decomposition(A, 'triangular', flag) and ignores the opposite triangle.
  • Name-value options include CheckCondition and RankTolerance. MATLAB-compatible CheckCondition values are logical; accepting an integer scalar is a separately gated RunMat extension. CheckCondition is exposed as an object property, while RankTolerance is accepted and stored for QR compatibility metadata.
  • Typed-integer RankTolerance and real or paired-complex typed-integer scale factors are independently gated RunMat extensions. Each authoritative integer component must be exactly representable before crossing into binary64 scale or tolerance metadata.
  • Object properties include MatrixSize, Type, CheckCondition, Datatype, IsConjugateTransposed, IsReal, IsSparse, and ScaleFactor. Internal coefficient storage is not publicly readable.
  • Unary plus returns the same decomposition. Unary minus, scalar multiplication, and scalar division return a new decomposition with an adjusted scale factor. GPU scalar operands are gated before provider access because the public decomposition surface does not document GPU Arrays.
  • Conjugate transpose (dA') toggles IsConjugateTransposed, conjugates the scale factor, and solves against the conjugate-transposed coefficient matrix. Gated integer and logical objects retain exact coefficient storage through this structural operation.
  • Left division (dA \ b) and right division (b / dA) support the same real, complex, square, rectangular, and least-squares behavior as RunMat's mldivide and mrdivide builtins. Integer and logical coefficients are promoted explicitly to binary64 only at this solve boundary, so their solutions are double or complex double.
  • Element-wise left division (ldivide or .\) is not a decomposition-object method, and decomposition.ldivide is absent from the builtin registry.

Does RunMat run decomposition on the GPU?

The compatibility target does not document GPU Array support for decomposition. RunMat retains gpuArray arguments behind its explicit extension mode and gathers them to host storage because the object owns normalized matrix metadata.

Solves through dA \ b and b / dA call the existing mldivide and mrdivide implementations with the effective coefficient matrix. If a provider accepts that solve, residency follows the same provider behavior as direct matrix division; otherwise RunMat uses the host fallback.

Examples

Solving a square system with a reusable decomposition

A = [2 0; 0 4];
dA = decomposition(A);
x = dA \ [8; 12]

Expected output:

x =
     4
     3

Right division through a decomposition object

A = [2 0; 0 4];
dA = decomposition(A);
y = [8 12] / dA

Expected output:

y =
     4     3

Declaring a triangular matrix and using only the upper triangle

A = [2 0; 99 4];
dA = decomposition(A, 'triangular', 'upper');
x = dA \ [8; 12]

Expected output:

x =
     4
     3

Scaling and transposing a decomposition

A = [1 2; 0 1];
dA = decomposition(A);
z = (2*dA)' \ [3; 1]

Expected output:

z =
     1.5
    -2.5

Using decomposition with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how decomposition changes the result.

Run a small decomposition example, explain the result, then change one input and compare the output.

FAQ

Does decomposition expose the raw LU or QR factors?⌄

No. MATLAB's decomposition object is an opaque solve object, and RunMat follows that surface. Use lu, qr, chol, or svd when you need explicit factors.

Does RunMat cache native factor arrays internally?⌄

The current implementation stores the normalized coefficient matrix plus decomposition metadata and delegates each solve to the shared matrix-division solvers. This preserves MATLAB solve semantics across square, rectangular, and complex cases; dedicated cached factor storage can be added behind the same object surface later.

Which object operations are supported?⌄

RunMat supports property access, unary plus/minus, conjugate transpose, scalar multiplication, scalar division, left division, and right division for decomposition objects.

How are integer and logical coefficient matrices handled?⌄

They are RunMat-only extensions. With extensions enabled, construction and structural transpose preserve exact host storage for all eight integer classes and logical arrays. A solve promotes the effective coefficient matrix to double at the solve boundary and reports a double or complex-double solution. With extensions disabled, construction and later object methods reject the extended object with a stable compatibility identifier.

Are condition warnings emitted?⌄

No. The CheckCondition property is parsed and preserved, but RunMat does not yet emit MATLAB-compatible condition warnings during decomposition construction or solve.

Are sparse decomposition objects supported?⌄

Not yet. RunMat rejects sparse coefficient matrices instead of silently densifying them, because large sparse matrices need a dedicated sparse solve path to be safe and MATLAB-compatible.

Which broader decomposition features are still incomplete?⌄

The current object does not implement sparse decomposition, cached native factor storage, condition warnings, algorithmic use of RankTolerance, or the additional banded, Hessenberg, LDL, COD, and permuted-triangular forms. Unsupported type strings are rejected explicitly.

Related Linalg functions

Factor

chol · eig · eigs · lu · qr · svd

Structure

bandwidth · isdiag · ishermitian · issymmetric · istril · istriu · symrcm

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref · vecnorm

Ops

cross · ctranspose · dot · mldivide · mpower · mrdivide · mtimes · pagemtimes · pagetranspose · trace · transpose

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how decomposition is executed, line by line, in Rust.

  • View the source for decomposition in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How decomposition works
  • Does RunMat run decomposition on the GPU?
  • Examples
  • Solving a square system with a reusable decomposition
  • Right division through a decomposition object
  • Declaring a triangular matrix and using only the upper triangle
  • Scaling and transposing a decomposition
  • Using decomposition with coding agents
  • FAQ
  • Related Linalg functions
  • Factor
  • Structure
  • Solve
  • Ops
  • Open-source implementation
  • About RunMat