From a0442ed58dee48a521ea053083ea967894507898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 11 Jul 2018 22:19:56 +0200 Subject: New upstream version 2.0.1+repack --- numlib/ludecomp.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'numlib/ludecomp.h') diff --git a/numlib/ludecomp.h b/numlib/ludecomp.h index 1075a5b..3f92ef8 100755 --- a/numlib/ludecomp.h +++ b/numlib/ludecomp.h @@ -38,6 +38,7 @@ int n /* Dimensionality */ ); /* Decompose the square matrix A[][] into lower and upper triangles */ +/* NOTE that rows get swaped by swapping matrix pointers! */ /* Return 1 if the matrix is singular. */ int lu_decomp( @@ -89,17 +90,34 @@ int n /* Dimensionality */ ); /* Pseudo-Invert matrix A using lu decomposition */ -/* NOTE that it returns transposed inverse by normal convention. */ -/* Use matrix_trans() to fix this, or use matrix_trans_mult(). */ /* Return 1 if the matrix is singular, 0 if OK */ int lu_psinvert( double **out, /* Output[0..N-1][0..M-1] */ double **in, /* Input[0..M-1][0..N-1] input matrix */ -int m, /* Rows */ -int n /* Columns */ +int m, /* In Rows */ +int n /* In Columns */ ); +/* - - - - - - - - - - - - - - - - - - - */ + +/* Use Cholesky decomposition on a symetric positive-definite matrix. */ +/* Only the upper triangle of the matrix A is accessed. */ +/* L returns the decomposition */ +/* Return nz if A is not positive-definite */ +int llt_decomp(double **L, double **A, int n); + + +/* Solve a set of simultaneous equations A.x = b from the */ +/* LLt decomposition, by back substitution. */ +void llt_backsub( +double **L, /* A[][] LLt decomposition in lower triangle */ +int n, /* Dimensionality */ +double *b, /* Input B[] */ +double *x /* Return X[] (may be same as B[]) */ +); + + #ifdef __cplusplus } #endif -- cgit v1.2.3