palDmat
palDmat
- Matrix inversion & solution of simultaneous equations
- Description:
- Matrix inversion & solution of simultaneous equations
For the set of n simultaneous equations in n unknowns:
A.Y = X
this routine calculates the inverse of A, the determinant
of matrix A and the vector of N unknowns.
- Invocation:
- void palDmat( int n, double
a, double
y, double
d, int
jf,
int
iw );
- Arguments:
-
-
n = int (Given)
-
Number of simultaneous equations and number of unknowns.
-
a = double[] (Given & Returned)
-
A non-singular NxN matrix (implemented as a contiguous block
of memory). After calling this routine "a" contains the
inverse of the matrix.
-
y = double[] (Given & Returned)
-
The vector of N unknowns. On exit this vector contains the
N solutions.
-
d = double
(Returned)
-
The determinant.
-
jf = int
(Returned)
-
The singularity flag. If the matrix is non-singular, jf=0
is returned. If the matrix is singular, jf=-1 & d=0.0 are
returned. In the latter case, the contents of array "a" on
return are undefined.
- Notes:
- Implemented using Gaussian elimination with partial pivoting.
- Optimized for speed rather than accuracy with errors 1 to 4
times those of routines optimized for accuracy.