SandMatrix Routine of the week: Pseudo-Inverse - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP-41C Software Library (/forum-11.html) +--- Thread: SandMatrix Routine of the week: Pseudo-Inverse (/thread-2718.html) |
SandMatrix Routine of the week: Pseudo-Inverse - Ángel Martin - 12-28-2014 11:37 AM Even if the convergence is finicky, using the BenIsrael-Cohen algorithm it takes a relatively short program to calculate the Moore-Penrose matrix pseudo-inverse. Once the initial estimation is calculated it's a matter of a few iterations until the final result is obtained - although each iteration also takes its time. For additional references see: http://benisrael.net/COHEN-BI-ITER-GI.pdf and JM Baillard's page: http://hp41programs.yolasite.com/pseudoinverse.php The code is listed below; lots of Alpha stuff as they are the input control strings that drive the matrix operations. Also note three auxiliary matrices are needed - mostly due to the M*M instruction that requires a result matrix different from the operands. Code:
You'll need the SandMatrix for functions I<>J, MTRACE and MAT= Auxiliary matrices "P" and "Q" are purged upon completion. The result matrix "#" will not overwrite the initial one. Cheers, 'AM RE: SandMatrix Routine of the week: Pseudo-Inverse - Gene - 12-28-2014 08:48 PM Thanks for this and all the work you have done on the modules for the 41. They make the 41CL a joy to use. I'm sure the surface hasn't even been scratched with the abilities of the roms you have created. Many thanks! |