PackageDescription: Smallapack-Algorithm


Smallapack - Algorithm

Last published: January 14, 2024 by 'nice'

Defines 27 Classes
Extends 26 Classes


Smallapack-Algorithm is a package part of Smallapack (The Smalltalk interface to LAPACK).

It holds classes for solving various linear algebra problems.
For example, solving a linear system of equations or finding the eigenvalues of a matrix.
There is roughly one class per algorithm with possibly subclasses for variants
(mainly for handling cases of different matrix property or storage).
All algorithms are subclasses of abstract LapackDecomposition.

Using classes instead of single messages implemented in Matrix has many pros:
- Some algorithms are not bound to a Matrix but rather to some equations involving several Matrices...
If i want to solve min(A*x-B) under C*x=D, to which matrix will I send the message, A,B,C,D or x ?
- Some algorithm would answer many results (PLU decomposition, eigen values and vectors etc...)
Smalltalk messages would answer a single object.
Using an array of results is a poor implementation (positional like Matlab/C/FORTRAN pouah!).
Using ValueHolder for passing return arguments would be as nice as C pointers (not so nice, is it ?).
- Most algorithms have options that can be combined;
either Smalltalk messages will provide a long list of arguments (not nice),
or many messages to handle default values combinations will have to be generated (not nice) !

The algorithms are solved using calls to external LAPACK library, not using Smalltalk implementation.
Assumption checking, memory allocation, pre and post processing are also part of the work done by these classes.

Lazy evaluation is used.
No external function is called untill an access to a result is performed.
The external functions are usually called by the Smalltalk #decompose method
when access message to a result is first sent (asserted by some flags).
Thus, users will:
- create the LapackDecomposition object first,
- then change options in consecutive messages,
- then ask for the results.
There is no need to implement multiple messages for every possible option combination, only one message per option, one per result.

Please refer to [http://www.netlib.org/lapack/lug/] for underlying LAPACK library and algorithms.

LICENSE: (MIT) See copyright