From 788697405fc995606b60fe84a954b99081ebf15f Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Tue, 4 Oct 2011 23:32:13 +0000 Subject: [PATCH] Added documentation --- Cantera/src/equil/vcs_internal.h | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Cantera/src/equil/vcs_internal.h b/Cantera/src/equil/vcs_internal.h index ec897b4be..cda63dada 100644 --- a/Cantera/src/equil/vcs_internal.h +++ b/Cantera/src/equil/vcs_internal.h @@ -158,6 +158,40 @@ namespace VCSnonideal { */ int vcsUtil_mlequ(double *c, int idem, int n, double *b, int m); + //! Invert an n x n matrix and solve m rhs's + /*! + * Solve a square matrix with multiple right hand sides + * + * \f[ + * C X + B = 0; + * \f] + * + * This routine uses Gauss-Jordan elimination and is optimized for the solution + * of lots of rhs's. Full row and column pivoting is used here. It's been + * shown to be necessary in at least one case. + * The matrix C is destroyed during the solve. + * + * @return The solution x[] is returned in the matrix B. + * Routine returns an integer representing success: + * - 1 : Matrix is singluar + * - 0 : solution is OK + * + * @param c Matrix to be inverted. c is in fortran format, i.e., rows + * are the inner loop. Row numbers equal to idem. + * c[i+j*idem] = c_i_j = Matrix to be inverted: + * - i = row number + * - j = column number + * + * @param idem number of row dimensions in c + * @param n Number of rows and columns in c + * @param b Multiple RHS. Note, b is actually the negative of + * most formulations. Row numbers equal to idem. + * b[i+j*idem] = b_i_j = vectors of rhs's: + * - i = row number + * - j = column number + * (each column is a new rhs) + * @param m number of rhs's + */ int vcsUtil_gaussj(double *c, int idem, int n, double *b, int m); //! Swap values in vector of doubles