00001 /****************************************************************************************************************/ 00002 /* */ 00003 /* L I N E A R A L G E B R A I C E Q U A T I O N S C L A S S H E A D E R */ 00004 /* */ 00005 /* Roberto Lopez */ 00006 /* International Center for Numerical Methods in Engineering (CIMNE) */ 00007 /* Technical University of Catalonia (UPC) */ 00008 /* Barcelona, Spain */ 00009 /* E-mail: rlopez@cimne.upc.edu */ 00010 /* */ 00011 /****************************************************************************************************************/ 00012 00013 #ifndef __LINEARALGEBRAICEQUATIONS_H__ 00014 #define __LINEARALGEBRAICEQUATIONS_H__ 00015 00016 #include "../utilities/vector.h" 00017 #include "../utilities/matrix.h" 00018 00019 namespace OpenNN 00020 { 00021 00025 00026 class LinearAlgebraicEquations 00027 { 00028 public: 00029 00030 // CONSTRUCTOR 00031 00032 LinearAlgebraicEquations(void); 00033 00034 00035 // DESTRUCTOR 00036 00037 ~LinearAlgebraicEquations(void); 00038 00039 00040 // ASSIGNMENT OPERATOR 00041 00042 LinearAlgebraicEquations& operator = (const LinearAlgebraicEquations&); 00043 00044 // EQUAL TO OPERATOR 00045 00046 bool operator == (const LinearAlgebraicEquations&) const; 00047 00048 // METHODS 00049 00050 // Gauss Jordan methods 00051 00052 void perform_Gauss_Jordan_elimination(Matrix<double>&, Matrix<double>&) const; 00053 void perform_Gauss_Jordan_elimination(Matrix<double>&, Vector<double>&) const; 00054 00055 Vector<double> calculate_Gauss_Jordan_solution(Matrix<double>, Vector<double>) const; 00056 00057 private: 00058 00059 void swap(double&, double&) const; 00060 00061 }; 00062 00063 } 00064 00065 #endif 00066 00067 00068 // OpenNN: Open Neural Networks Library. 00069 // Copyright (C) 2005-2012 Roberto Lopez 00070 // 00071 // This library is free software; you can redistribute it and/or 00072 // modify it under the terms of the GNU Lesser General Public 00073 // License as published by the Free Software Foundation; either 00074 // version 2.1 of the License, or any later version. 00075 // 00076 // This library is distributed in the hope that it will be useful, 00077 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00078 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00079 // Lesser General Public License for more details. 00080 00081 // You should have received a copy of the GNU Lesser General Public 00082 // License along with this library; if not, write to the Free Software 00083 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA