---
title: "mlab-numerics-linalg-factors — Mova code model"
description: "Mova code model of mlab/src/builtins/linalg.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/mlab/src/builtins/linalg.rs.groupant/linalg-factors.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/mlab/src/builtins/linalg.rs.groupant/linalg-factors.groupant/>

# mlab-numerics-linalg-factors

The groupant beside mlab/src/builtins/linalg.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

## Facts

- **kind:** groupant_fragment
- **status:** partial source bound model
- **source:** [`mlab/src/builtins/linalg.rs`](https://github.com/ElamurAI/mova-free/blob/main/mlab/src/builtins/linalg.rs)
- **source SHA-256:** `f3579e5bd4a5ee89…`
- **covers:** lu returns packed L/U for <=1 output, P^T L and U for2, or L,U,P for3+. qr computes full/thin Q/R and zeros below R diagonal. chol symmetrizes upper input triangle, returning R with R^T R=upper-symmetric A or empty,status1 on two-output failure. eig dispatches exact symmetry then returns values or V,D and warning residuals. (bytes 19693–27310)
- **part of:** [mlab-numerics-linalg](https://md.groupants.elamur.ai/free/en/mova/mlab/src/builtins/linalg.rs.groupant/)
- **repository folder:** [`mlab/src/builtins/linalg.rs.groupant/linalg-factors.groupant`](https://github.com/ElamurAI/mova-free/tree/main/mlab/src/builtins/linalg.rs.groupant/linalg-factors.groupant)
- **repository commit:** `855da7bd4a7b`

> **Implementation material.** A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

## Components

| component | label | where |
|---|---|---|
| **approximant** | partial | [approximant](#approximant) |
| **ast** | partial | `../syntax.json` |
| **cost** | symbolic source derived | [invariant](#invariant) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | executed bounded checks | [tests](#tests) |

## Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

| id | type | label | where |
|---|---|---|---|
| `behavior_complement` | behavior_complement | partial source derived model | [behavior_complement](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |
| `lu_output_arity` | lu_output_arity | partial source derived model | [lu_output_arity](#lu-output-arity) |
| `chol_failure` | chol_failure | partial source derived model | [chol_failure](#chol-failure) |
| `eigen_symmetry` | eigen_symmetry | partial source derived model | [eigen_symmetry](#eigen-symmetry) |
| `residual_limits` | residual_limits | partial source derived model | [residual_limits](#residual-limits) |

## Model text


### descriptant

#### mlab-numerics-linalg-factors

lu returns packed L/U for <=1 output, P^T L and U for2, or L,U,P for3+. qr computes full/thin Q/R and zeros below R diagonal. chol symmetrizes upper input triangle, returning R with R^T R=upper-symmetric A or empty,status1 on two-output failure. eig dispatches exact symmetry then returns values or V,D and warning residuals.

##### Modeling epoch 2026-10-31

Prospective source reading preceded inline tests. This node records implementation behavior, not a complete MATLAB compatibility contract. Models retain limits discovered in source reading, including real-only projections and warning-only result gates. Synthetic CPU fixtures are independent of frozen suites. No external effects, teacher, corpora or benchmark main are executed.

### approximant

#### Forward relation

lu returns packed L/U for <=1 output, P^T L and U for2, or L,U,P for3+. qr computes full/thin Q/R and zeros below R diagonal. chol symmetrizes upper input triangle, returning R with R^T R=upper-symmetric A or empty,status1 on two-output failure. eig dispatches exact symmetry then returns values or V,D and warning residuals.

Executable Rust surrogate gap: no calibrated replacement is attached. Exact test calls are evidence for the reference, not a fast approximant. Numerical approximants would need a named domain, zero convention and metric at supported caps 1/2/5/10%; categorical errors/effects have no percent surrogate here.

### invariant

#### Invariants and cost

Factor shapes depend on nargout/economy. Gates use finite input and relative residual with explicit zero-reference behavior; no rejection on gate violation.

##### Cost

Decompositions O(n^3) square with O(n^2) storage; reconstruction gates add O(n^3); diagonal eigen scaling O(n^2).

Allocation failure, unchecked usize dimension arithmetic and IEEE nonfinite propagation are outside finite fixture guarantees. No measured throughput or global accuracy claim.

### models

## Typed source models: mlab-numerics-linalg-factors

### behavior_complement

LU's two-output L excludes interpreting it as unit lower triangular without permutation. chol excludes lower-triangle influence. eig nonsquare/complex/nonfinite checks precede empty/backend evaluation.

### reverse_reconstruction

Three-output LU reconstructs A=P^T L U; two-output factors reconstruct A=L2 U. chol R reconstructs symmetric upper-selected A but arbitrary lower-triangle input shares output. V,D reconstruct A only if V invertible; values-only fibers include similarity transforms.

### lu_output_arity

nargout2 uses P^T L; nargout3 emits permutation matrix.

### chol_failure

Positive-definite failure returns status1 if requested, otherwise MError; upper triangle defines the factorized symmetric matrix.

### eigen_symmetry

Symmetric branch uses exact mirrored-cell equality; nonsymmetric vectors are normalized by Euclidean column norm.

### residual_limits

Value-only eigen gate checks sum eigenvalues versus trace, which cannot detect trace-preserving errors.


### tests

#### Evidence and limits

Selected wave30_tests exercise this source; fragment-specific limits are stated in its operators.

Native command specifications, numeric exits, profile-paired logs, compiled controls and exact-restoration receipts are retained externally in the wave30 numerics run. Tests exercise actual source, not a copied model. The selected finite fixtures do not prove full convergence, backend accuracy on all matrices, resource exhaustion or side-effectful callback behavior.
