The LA_DETERM function uses LU decomposition to compute the determinant of a square array.

This routine is written in the IDL language. Its source code can be found in the file la_determ.pro in the lib subdirectory of the IDL distribution.

Examples


The following program computes the determinant of a square array:

; Create a square array
array =[[1d, 2, 1], $
   [4, 10, 15], $
   [3, 7, 1]]
; Compute the determinant.
adeterm = LA_DETERM(array)
PRINT, 'LA_DETERM:', adeterm

When this program is compiled and run, IDL prints:

LA_DETERM: 
-15.000000

Syntax


Result = LA_DETERM( A [, /CHECK] [, /DOUBLE] [, ZERO=value] )

Return Value


The result is a scalar of the same type as the input array.

Arguments


A

An n-by-n real or complex array.

Keywords


CHECK

Set this keyword to check A for any singularities. The determinant of a singular array is returned as zero if this keyword is set. Run-time errors may result if A is singular and this keyword is not set.

DOUBLE

Set this keyword to use double-precision for computations and to return a double-precision (real or complex) result. Set DOUBLE = 0 to use single-precision for computations and to return a single-precision (real or complex) result. The default is /DOUBLE if A is double precision, otherwise the default is DOUBLE = 0.

ZERO

Use this keyword to set the absolute value of the floating-point zero. A floating-point zero on the main diagonal of a triangular array results in a zero determinant. For single-precision inputs, the default value is 1.0 x 10-6. For double-precision inputs, the default value is 1.0 x 10-12. Setting this keyword to a value less than the default may improve the precision of the result.

Version History


5.6

Introduced

See Also


DETERM, LA_LUDC