Cantera  2.0
BasisOptimize.cpp File Reference

Functions which calculation optimized basis of the
stoichiometric coefficient matrix (see /ref equil functions)

More...

#include "cantera/base/ct_defs.h"
#include "cantera/base/global.h"
#include "cantera/thermo/ThermoPhase.h"
#include "cantera/equil/MultiPhase.h"
#include <cstring>
Include dependency graph for BasisOptimize.cpp:

Go to the source code of this file.

Functions

static size_t amax (double *x, size_t j, size_t n)
Finds the location of the maximum component in a double vector INPUT.

static int mlequ (double *c, size_t idem, size_t n, double *b, size_t m)
Invert an nxn matrix and solve m rhs's.

Detailed Description

Functions which calculation optimized basis of the
stoichiometric coefficient matrix (see /ref equil functions)


Definition in file BasisOptimize.cpp.

Function Documentation

 static size_t amax ( double * x, size_t j, size_t n )
static

Finds the location of the maximum component in a double vector INPUT.

Parameters
 x Vector to search j j <= i < n : i is the range of indices to search in X(*) n Length of the vector
Returns
index of the greatest value on X(*) searched

Definition at line 539 of file BasisOptimize.cpp.

Referenced by Cantera::absmax().

 static int mlequ ( double * c, size_t idem, size_t n, double * b, size_t m )
static

Invert an nxn matrix and solve m rhs's.

Solve C X + B = 0;

This routine uses Gauss elimination and is optimized for the solution of lots of rhs's. A crude form of row pivoting is used here.

Parameters
 c C is the matrix to be inverted idem first dimension in the calling routine idem >= n must be true n number of rows and columns in the matrix b rhs of the matrix problem m number of rhs to be solved for

c[i+j*idem] = c_i_j = Matrix to be inverted: i = row number j = column number b[i+j*idem] = b_i_j = vectors of rhs's: i = row number j = column number (each column is a new rhs)

Returns
Retuns the value 1 : Matrix is singular 0 : solution is OK

The solution is returned in the matrix b.

Definition at line 580 of file BasisOptimize.cpp.

References Cantera::writelogf().