Canoe
Comprehensive Atmosphere N' Ocean Engine
ludcmp.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

int ludcmp (double **a, int n, int *indx)
 

Function Documentation

◆ ludcmp()

int ludcmp ( double **  a,
int  n,
int *  indx 
)

Given a matrix a[0..n-1][0..n-1], this routine replaces it by the LU decomposition of a rowwise permutation of itself. a and n are input. a is output, arranged as in NRIC equation (2.3.14) ; indx[0..n-1] is an output vector that records the row permutation effected by the partial pivoting; d is output as +/- 1 depending on whether the number of row interchanges was evenor odd, respectively. This routine is used in combination with lubksbto solve linear equationsor invert a matrix. adapted from Numerical Recipes in C, 2nd Ed., p. 46.

Definition at line 14 of file ludcmp.c.