Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mmatrix.cc File Reference

More...

#include <stdio.h>
#include <stdlib.h>
#include <magic/mmath.h>
#include <magic/mmatrix.h>
#include <magic/mstream.h>
#include <magic/mtextstream.h>
#include <magic/mlist.h>

Go to the source code of this file.

Functions

 BEGIN_NAMESPACE (MagiC)
int solveLinear (const Matrix &mat, const Vector &b, Vector &result)
int solveLinear (const Matrix &augmat_orig, Vector &result, int *bv_set)


Detailed Description

Definition in file mmatrix.cc.


Function Documentation

BEGIN_NAMESPACE MagiC   
 

This file is part of the MagiC++ library.

* * Copyright (C) 1998-2002 Marko Grönroos <magi@iki.fi> * *

* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; see the file COPYING.LIB. If * not, write to the Free Software Foundation, Inc., 59 Temple Place *

  • Suite 330, Boston, MA 02111-1307, USA. * *

int solveLinear const Matrix   augmat_orig,
Vector   result,
int *    bv_set
 

Solves linear equation represented as an augmented matrix.

Uses the Gauss-Jordan method. The solution will be stored in the "result" vector.

If the basic variables set nbv_set is given, these variables in the problem are set to be 0, and the linear equation is solved for the remaining, basic variables.

Returns:
0 if solution was found, nonzero otherwise

Definition at line 473 of file mmatrix.cc.

References Matrix::addRowByScalar(), PackTable< double >::cols, PackTable< double >::get(), PackArray::make(), Matrix::mulRowByScalar(), PackTable< double >::rows, PackArray::size(), and Matrix::swaprows().

Referenced by solveLinear().

int solveLinear const Matrix   mat,
const Vector   b,
Vector   result
 

Solves linear equation.

Definition at line 453 of file mmatrix.cc.


Generated on Thu Feb 10 20:06:43 2005 for LibMagiC by doxygen1.2.18