Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

GenericSolver.cpp

Go to the documentation of this file.
00001 
00002 // MathCore = a WYSIWYG equation editor + a powerful math engine     //
00003 // Copyright (C) 2003 by Francesco Montorsi                          //
00004 //                                                                   //
00005 // This library is free software; you can redistribute it and/or     //
00006 // modify it under the terms of the GNU Lesser General Public        //
00007 // License as published by the Free Software Foundation; either      //
00008 // version 2.1 of the License, or (at your option) any later         //
00009 // version.                                                          //
00010 //                                                                   //
00011 // This library is distributed in the hope that it will be useful,   //
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of    //
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the      //
00014 // GNU Lesser General Public License for more details.               //
00015 //                                                                   //
00016 // You should have received a copy of the GNU Lesser General Public  //
00017 // License along with this program; if not, write to the Free        //
00018 // Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,   //
00019 // MA 02111-1307, USA.                                               //
00020 //                                                                   //
00021 // For any comment, suggestion or feature request, please contact    //
00022 // the administrator of the project at frm@users.sourceforge.net     //
00023 //                                                                   //
00030 
00031 
00032 
00033 // optimization for GCC compiler
00034 #ifdef __GNUG__
00035 #pragma implementation "GenericSolver.h"
00036 #endif
00037 
00038 // includes
00039 #include "mc/mcprec.h"
00040 #ifdef __BORLANDC__
00041     #pragma hdrstop
00042 #endif
00043 
00044 #ifndef mcPRECOMP
00045     #include "mc/MathUtils.h"       // for the mcLOG macro
00046  #include "mc/GenericSolver.h"
00047  #include "mc/MathSystem.h"
00048  #include "mc/Symbol.h"
00049  #include "mc/Monomial.h"
00050 #endif
00051 
00052 
00053 
00054 
00055 
00056 // ----------------------------------------
00057 // mcSIMPLIFYSOLVER
00058 // ----------------------------------------
00059 
00060 bool mcSimplifySolver::math_SolveLine(mcMathLine &p, const mcSymbolProperties *unk,
00061              mcSystemStepArray &steps)
00062 {
00063  mcSOLVERLOG(wxT("mcSimplifySolver::SolveLine - the unknown is [%s]"), mcTXTP(unk));
00064 
00065  // STEP #1: quite simple, isn't it ?
00066  //mcMathMng *curr = math_GetNewStep(p);
00067  //steps.data_AddLine(curr);
00068  math_DoCompleteSimplification(mcEXPSIM_NOFLAGS, mcEXPSIM_NOFLAGS, p, steps);
00069  steps.data_Check();
00070 
00071  // we should have completely simplified everything...
00072  return TRUE;
00073 }
00074 
00075 
00076 
00077 
00078 
00079 // ----------------------------------------
00080 // mcEXPANDSOLVER
00081 // ----------------------------------------
00082 
00083 bool mcExpandSolver::math_SolveLine(mcMathLine &p, const mcSymbolProperties *unk,
00084             mcSystemStepArray &steps)
00085 {
00086  mcSOLVERLOG(wxT("mcExpandSolver::SolveLine - the unknown is [%s]"), mcTXTP(unk));
00087 
00088  // STEP #1: quite simple, isn't it ?
00089  //mcMathMng *curr = math_GetNewStep(p);
00090  //steps.data_AddLine(curr);
00091  math_DoCompleteExpansion(mcEXPSIM_NOFLAGS, mcEXPSIM_NOFLAGS, p, steps);
00092  steps.data_Check();
00093 
00094  // we should have completely expanded everything...
00095  return TRUE;
00096 }
00097 


Documentation generated with Doxygen on Sun Feb 6 17:10:47 2005
Visit MathStudio home page for more info

[ Top ]