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 #ifndef POLYSOLVER_H 00034 #define POLYSOLVER_H 00035 00036 // optimization for GCC compiler 00037 #ifdef __GNUG__ 00038 #pragma interface "PolySolver.h" 00039 #endif 00040 00041 // required includes 00042 #include "mc/Solver.h" 00043 #include "mc/Monomial.h" 00044 00045 00046 00047 // defines 00048 #define mcPOLYSOLVER_MAXDEGREE 10 00049 00050 // defined later 00051 class mcMathLine; 00052 00053 00060 class mcPolySolver : public mcSolver 00061 { 00062 protected: 00063 00067 mcMonomial m_pCoeff[mcPOLYSOLVER_MAXDEGREE]; 00068 00069 protected: // functions 00070 00071 void math_ResetCoeffArr(); 00072 void math_DeleteCoeffArr(); 00073 00074 public: 00075 00076 mcPolySolver(); 00077 virtual ~mcPolySolver() { math_DeleteCoeffArr(); } 00078 00079 00083 bool math_SolveLine(mcMathLine &p, const mcSymbolProperties *unk, mcSystemStepArray &); 00084 00086 bool math_SolveLineFirstDegree(mcMathLine &p, const mcSymbolProperties *unk, 00087 mcSystemStepArray &steps); 00088 00090 bool math_SolveLineSecondDegree(mcMathLine &p, const mcSymbolProperties *unk, 00091 mcSystemStepArray &steps); 00092 00094 bool math_WorksOn(const mcMathOrSystem &m) const; 00095 00096 00099 void math_FindPolyCoeff(const mcMathLine &data, const mcSymbolProperties *unk, int n); 00100 00103 void math_GetPolyCoeff(mcMathLine &p, const mcSymbolProperties *unk, 00104 mcSystemStepArray &steps); 00105 00106 00108 bool math_isReady() const { return TRUE; } 00109 00111 wxPanel *gui_GetOptionsPanel() const { return NULL; } 00112 }; 00113 00114 00115 #endif // POLYSOLVER_H
[ Top ] |