Post Reply 
[50G] Question
03-22-2015, 11:16 AM (This post was last modified: 03-22-2015 11:31 AM by Tugdual.)
Post: #31
RE: [50G] Question
I have reimplemented the LU decomposition using Crout method as described on Wikipedia with one limit, the P matrix is not built (nor used) so it will crash in some cases.
Code:
%%HP: T(3)A(R)F(,);
\<< DUPDUP SIZE LIST\-> DROP2 \-> A L N
  \<< 'L' IDN 1 N 1 -
    FOR n n 1 + N
      FOR i 'A' i n 2 \->LIST GET 'A' n DUP 2 \->LIST GET / NEG
      NEXT N n - 1 2 \->LIST \->ARRY n DUP 1 + SWAP 2 \->LIST A IDN SWAP ROT REPL DUP A * 'A' STO L SWAP INV * 'L' STO
    NEXT L A
  \>>
\>>
Usage:
Have the matrix on 1: and call this function.
Returns 2 matrices, 2:L and 1:U

Comments
Returns the exact same result as the Prime CAS in the few samples I tried.
Much slower than native LU() method but acceptable for normal use.
Also the native LU() has a diagonal of 1 on U while common use is to have it on L which is the case with this implementation
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[50G] Question - Tugdual - 03-09-2015, 06:49 AM
RE: [50G] Question - Massimo Gnerucci - 03-09-2015, 07:09 AM
RE: [50G] Question - Tugdual - 03-09-2015, 06:02 PM
RE: [50G] Question - BartDB - 03-12-2015, 09:38 AM
RE: [50G] Question - MarkMason - 03-12-2015, 03:55 PM
RM - Tugdual - 03-09-2015, 09:36 PM
RE: [50G] Question - Marcus von Cube - 03-09-2015, 09:50 PM
RE: [50G] Question - Tugdual - 03-10-2015, 02:41 AM
RE: [50G] Question - cutterjohn - 03-22-2015, 11:18 PM
RE: [50G] Question - Tugdual - 03-24-2015, 06:51 AM
RE: [50G] Question - Tim Wessman - 03-25-2015, 04:33 AM
RE: [50G] Question - Tugdual - 03-25-2015, 12:08 PM
RE: [50G] Question - Claudio L. - 03-26-2015, 02:50 PM
RE: [50G] Question - Tugdual - 03-11-2015, 09:24 PM
RE: [50G] Question - Massimo Gnerucci - 03-11-2015, 09:54 PM
RE: [50G] Question - BartDB - 03-12-2015, 09:34 AM
RE: [50G] Question - Massimo Gnerucci - 03-12-2015, 12:58 PM
RE: [50G] Question - BartDB - 03-12-2015, 05:26 PM
RE: [50G] Question - matthiaspaul - 03-11-2015, 11:08 PM
RE: [50G] Question - Tugdual - 03-12-2015, 08:28 PM
RE: [50G] Question - Marcus von Cube - 03-12-2015, 09:47 PM
RE: [50G] Question - Tugdual - 03-12-2015, 10:08 PM
RE: [50G] Question - Massimo Gnerucci - 03-12-2015, 10:16 PM
RE: [50G] Question - Jlouis - 03-25-2015, 01:26 AM
RE: [50G] Question - Massimo Gnerucci - 03-25-2015, 06:55 AM
RE: [50G] Question - Jlouis - 03-25-2015, 11:17 AM
RE: [50G] Question - Gerald H - 03-25-2015, 12:00 PM
RE: [50G] Question - rprosperi - 03-12-2015, 11:22 PM
RE: [50G] Question - MarkMason - 03-13-2015, 01:30 AM
RE: [50G] Question - Marcio - 03-12-2015, 09:04 PM
RE: [50G] Question - Tugdual - 03-12-2015, 09:44 PM
RE: [50G] Question - Marcio - 03-12-2015, 10:00 PM
RE: [50G] Question - Tugdual - 03-12-2015, 10:16 PM
RE: [50G] Question - Marcio - 03-12-2015, 10:26 PM
RE: [50G] Question - Tugdual - 03-13-2015, 12:04 AM
RE: [50G] Question - Tugdual - 03-14-2015, 10:11 AM
RE: [50G] Question - Han - 03-14-2015, 10:12 AM
RE: [50G] Question - Tugdual - 03-18-2015, 09:31 PM
RE: [50G] Question - Gilles - 03-19-2015, 06:04 PM
RE: [50G] Question - Han - 03-22-2015, 11:33 PM
RE: [50G] Question - Tugdual - 03-22-2015 11:16 AM
RE: [50G] Question - Gilles - 03-23-2015, 12:39 PM
RE: [50G] Question - Tugdual - 03-24-2015, 06:41 AM
RE: [50G] Question - Gilles - 03-28-2015, 12:42 PM
RE: [50G] Question - Tugdual - 03-29-2015, 09:59 PM
RE: [50G] Question - Tugdual - 03-27-2015, 12:44 PM
RE: [50G] Question - rprosperi - 03-27-2015, 01:02 PM
RE: [50G] Question - Tugdual - 03-27-2015, 09:57 PM
RE: [50G] Question - Han - 03-27-2015, 03:02 PM
RE: [50G] Question - Tugdual - 03-27-2015, 10:04 PM
RE: [50G] Question - Tugdual - 04-08-2015, 06:21 AM
RE: [50G] Question - BartDB - 04-08-2015, 09:01 AM
RE: [50G] Question - Sukiari - 04-08-2015, 06:19 PM
RE: [50G] Question - Guenter Schink - 04-08-2015, 06:43 PM
RE: [50G] Question - Tugdual - 04-08-2015, 08:59 PM
RE: [50G] Question - Massimo Gnerucci - 04-08-2015, 09:23 PM
RE: [50G] Question - zx81 - 04-09-2015, 03:01 AM
RE: [50G] Question - Tugdual - 04-21-2015, 06:45 PM
RE: [50G] Question - Voldemar - 04-21-2015, 08:32 PM
RE: [50G] Question - Tugdual - 04-21-2015, 08:37 PM
RE: [50G] Question - DavidM - 04-23-2015, 02:15 AM
RE: [50G] Question - Claudio L. - 05-03-2015, 12:50 AM
RE: [50G] Question - HrastProgrammer - 05-03-2015, 08:10 AM
RE: [50G] Question - Tugdual - 05-03-2015, 09:30 AM
RE: [50G] Question - HrastProgrammer - 05-03-2015, 10:25 AM
RE: [50G] Question - DavidM - 05-04-2015, 05:40 PM
RE: [50G] Question - DavidM - 05-03-2015, 04:17 PM
RE: [50G] Question - HrastProgrammer - 05-03-2015, 05:14 PM
RE: [50G] Question - Massimo Gnerucci - 05-03-2015, 06:00 PM
RE: [50G] Question - DavidM - 05-03-2015, 06:17 PM
RE: [50G] Question - Massimo Gnerucci - 05-03-2015, 06:30 PM
RE: [50G] Question - HrastProgrammer - 05-03-2015, 06:38 PM
RE: [50G] Question - DavidM - 05-03-2015, 08:47 PM
RE: [50G] Question - HrastProgrammer - 05-04-2015, 04:52 AM
RE: [50G] Question - DavidM - 05-04-2015, 06:52 PM
RE: [50G] Question - HrastProgrammer - 05-03-2015, 06:39 PM
RE: [50G] Question - Tugdual - 05-01-2015, 05:09 PM
RE: [50G] Question - Gilles - 05-01-2015, 05:29 PM
RE: [50G] Question - Tugdual - 05-01-2015, 06:41 PM
RE: [50G] Question - Gerald H - 05-03-2015, 08:49 AM
RE: [50G] Question - HrastProgrammer - 05-03-2015, 09:25 AM
RE: [50G] Question - Gerald H - 05-03-2015, 09:51 AM
RE: [50G] Question - HrastProgrammer - 05-03-2015, 10:55 AM
RE: [50G] Question - Gerald H - 05-03-2015, 08:31 PM
RE: [50G] Question - HrastProgrammer - 05-04-2015, 04:35 AM
RE: [50G] Question - Gerald H - 05-03-2015, 05:07 PM



User(s) browsing this thread: 7 Guest(s)