~ubuntu-branches/ubuntu/karmic/psicode/karmic

« back to all changes in this revision

Viewing changes to src/lib/libciomr/flin.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "libciomr.h"
 
2
#include <cstdlib>
 
3
 
 
4
extern "C" {
 
5
 
 
6
extern void ludcmp(double **, int, int *, double *);
 
7
extern void lubksb(double **, int, int *, double *);
 
8
 
 
9
/*!
 
10
** \file
 
11
** \brief Linear equation solver for A * x = b
 
12
** \ingroup CIOMR
 
13
*/ 
 
14
 
 
15
 
 
16
/*!
 
17
** flin(): solves linear equations A * x = b.
 
18
**
 
19
** \param a   = coefficient matrix
 
20
** \param b   = known vectors
 
21
** \param in  = dimension of a(in*in)
 
22
** \param im  = number of b vectors
 
23
** \param det = pointer to hold determinant of matrix a
 
24
**
 
25
** Returns: none
 
26
**
 
27
** \ingroup CIOMR
 
28
*/
 
29
void flin(double **a, double *b, int in, int im, double *det)
 
30
{
 
31
  int i,j,k,*indx;
 
32
 
 
33
  indx = (int *) init_array(in);
 
34
 
 
35
  ludcmp(a,in,indx,det);
 
36
 
 
37
  for (i=0; i < in ; i++) *det *= a[i][i];
 
38
 
 
39
  for (j=0; j<im; j++)
 
40
    lubksb(a,in,indx,b+j*in);
 
41
 
 
42
  free(indx);
 
43
}
 
44
 
 
45
} /* extern "C" */
 
46