<< qdip QD: 32 bytes decimal arithmetics max >>

DD_QD (MuPAT) >> DD_QD (MuPAT) > QD: 32 bytes decimal arithmetics > lu

lu

LU factorization of a square QD matrix

Syntax

[L,U] = lu(A)

Parameters

A

square matrix of QD real numbers, of size [n,n].

U

Upper triangular square matrix of QD real numbers, of size [n,n].

L

square matrix of QD real numbers, of size [m,n], Lower triangular after some rows permutations.

Description

[L,U]= lu(A) computes the matrices LL and U such that A = L*U, with U Upper triangular, and L Lower triangular after some rows permutations.

The implementation for matrices of QD numbers is restricted to square matrices.

Examples

:

A = qdrand(4,4)
[L,U] = lu(A)
L*U - A
--> A = qdrand(4,4)
 A  =
[d1]
   0.2113249   0.6653811   0.8782165   0.7263507
   0.7560439   0.6283918   0.068374    0.1985144
   0.0002211   0.8497452   0.5608486   0.5442573
   0.3303271   0.685731    0.6623569   0.2320748
[d2] 10^-17 *
   0.9179115  -2.5457833   2.8569193  -0.0895016
  -0.5581342   4.4783202   0.079312    1.0642382
   0.0007956  -0.7443819   1.1313369  -5.3577353
  -1.362032   -2.042491    3.8557987  -0.7230452
[d3] 10^-34 *
  -3.1771128   5.926026   -28.470856   0.4634389
   0.9909281   11.387791   0.278016    0.5853533
  -0.0069856   4.883837    2.3716206  -9.5272717
   1.8738568  -11.904973   23.61867    6.6879229
[d4] 10^-51 *
  -5.5450448  -2.4259894   143.85887  -1.9487679
   6.3859594   39.266399  -1.5289045   4.2949033
  -0.04034     29.550156  -11.818576  -34.428087
  -7.5784425  -15.544252   63.266317  -34.142348


--> [L,U] = lu(A)
 U  =
[d1]
   0.2113249   0.6653811   0.8782165   0.7263507
   0.         -1.7521009  -3.0735666  -2.4001053
   0.          0.         -0.9294872  -0.6195676
   0.          0.          0.         -0.3587091
[d2] 10^-17 *
   0.9179115  -2.5457833   2.8569193  -0.0895016
   0.          9.1176704   4.0771268   7.7802232
   0.          0.          1.9475187  -5.3156318
   0.          0.          0.         -0.8330074
[d3] 10^-34 *
  -3.1771128   5.926026   -28.470856   0.4634389
   0.          44.225787  -30.388578  -51.514873
   0.          0.         -15.231586   6.9457524
   0.          0.          0.         -4.9963616
[d4] 10^-51 *
  -5.5450448  -2.4259894   143.85887  -1.9487679
   0.         -173.8784    90.755608  -325.22583
   0.          0.          60.278397   32.035422
   0.          0.          0.          40.514566

 L  =
[d1]
   1.          0.          0.          0.
   3.5776379   1.          0.          0.
   0.0010464  -0.4845891   1.          0.
   1.5631246   0.2022387   0.0955482   1.
[d2] 10^-17 *
   0.          0.          0.          0.
   13.646401   0.          0.          0.
   0.0086084  -0.8552402   0.          0.
  -6.5616244   0.5924347   0.6097856   0.
[d3] 10^-34 *
   0.          0.          0.          0.
   101.23008   0.          0.          0.
  -0.0090916  -1.1613989   0.          0.
   42.858922   0.3631728   2.6062432   0.
[d4] 10^-51 *
   0.          0.          0.          0.
   252.9254    0.          0.          0.
   0.0413223  -8.8502451   0.          0.
  -290.23453   0.7679612  -16.352271   0.


--> L*U - A
 ans  =
[d1] 10^-65 *
   0.          0.          0.          0.
   6.5282028   1.4243352   0.0890209   0.6528203
   0.0018546  -2.8486703  -0.2373892   0.
   1.3056406   1.186946    0.          0.
[d2] zeros(4,4)
[d3] zeros(4,4)
[d4] zeros(4,4)

See Also

Authors

Copyright (C) 2011 - Tsubasa Saito

Report an issue
<< qdip QD: 32 bytes decimal arithmetics max >>