Language Reference

SOLVELIN Call

solves a sparse symmetric linear system by direct decomposition

CALL SOLVELIN( x, status, A, b, method);

The SOLVELIN call returns the following values:



x
is the solution to ax=b.
status
is the final status of the solution.

The inputs to the SOLVELIN call are as follows:



A
is the sparse coefficient matrix in the equation ax=b.
b
is the right side of the equation ax=b.
method
is the name of the decomposition to be used.

The SOLVELIN call uses direct decomposition to solve sparse symmetric linear systems. The input matrix a represents the coefficient matrix in sparse format; it is an n by 3 matrix, where n is the number of nonzero elements. The first column contains the nonzero values, while the second and third columns contain the row and column locations for the nonzero elements, respectively. Since a is assumed to be symmetric, only the elements on and below the diagonal should be specified, and it is an error to specify elements above the diagonal.

The solution to the system is returned in x. Your program should also check the returned status to make sure that a solution was found.



status = 0
indicates success.
status = 1
indicates the matrix A is not positive-definite.
status = 2
indicates the system ran out of memory.
If the SOLVELIN call is unable to solve your system, you can try the iterative method call ITSOLVER.

Two different factorization methods are available from the call, Cholesky and Symbolic LDL, specified as 'CHOL' or 'LDL' with the method parameter. Both these factorizations are applicable only to positive-definite symmetric systems; if your system is not positive-definite or not symmetric, you can use an ITSOLVER call.

The following example uses SOLVELIN to solve the system:

[ 3 & 1.1 & 0 & 0 \    1.1 & 4 & 1 & 3.2 \    0 & 1 & 10 & 0 \    0 & 3.2 & 0 & 3    ] x = [ 1 \   1 \   1 \   1 ]

  
  
 /* value     row column */ 
 A = {  3       1      1, 
        1.1     2      1, 
        4       2      2, 
        1       3      2, 
        3.2     4      2, 
       10       3      3, 
        3       4      4}; 
  
 /* right hand side */ 
 b = {1, 1, 1, 1}; 
  
 call solvelin(x, status, A, b, 'LDL'); 
  
 print status x;
 
The results are as follows:

  
                  STATUS         X 
  
                       0      2.68 
                              -6.4 
                              0.74 
                              7.16
 

Previous Page | Next Page | Top of Page