GiNaCRA
0.6.4
|
00001 /* 00002 * GiNaCRA - GiNaC Real Algebra package 00003 * Copyright (C) 2010-2012 Ulrich Loup, Joachim Redies, Sebastian Junges 00004 * 00005 * This file is part of GiNaCRA. 00006 * 00007 * GiNaCRA is free software: you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation, either version 3 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * GiNaCRA is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with GiNaCRA. If not, see <http://www.gnu.org/licenses/>. 00019 * 00020 */ 00021 00022 00023 #include "MultivariateCoefficientMR.h" 00024 00025 namespace GiNaCRA 00026 { 00027 MultivariateCoefficientMR::MultivariateCoefficientMR(): 00028 mCoefficient() 00029 {} 00030 00031 MultivariateCoefficientMR::MultivariateCoefficientMR( const GiNaC::ex& expr ): 00032 mCoefficient( expr ) 00033 {} 00034 00035 bool operator ==( const MultivariateCoefficientMR& m1, const MultivariateCoefficientMR& m2 ) 00036 { 00037 return m1.mCoefficient == m2.mCoefficient; 00038 } 00039 00040 const MultivariateCoefficientMR operator *( const MultivariateCoefficientMR& m1, const MultivariateCoefficientMR& m2 ) 00041 { 00042 return m1.mCoefficient * m2.mCoefficient; 00043 } 00044 00045 const MultivariateCoefficientMR operator +( const MultivariateCoefficientMR& m1, const MultivariateCoefficientMR& m2 ) 00046 { 00047 return m1.mCoefficient + m2.mCoefficient; 00048 } 00049 00050 const MultivariateCoefficientMR operator -( const MultivariateCoefficientMR& m1 ) 00051 { 00052 return MultivariateCoefficientMR( -1 * m1.mCoefficient ); 00053 } 00054 00055 const MultivariateCoefficientMR operator -( const MultivariateCoefficientMR& m1, const MultivariateCoefficientMR& m2 ) 00056 { 00057 return m1.mCoefficient - m2.mCoefficient; 00058 } 00059 00060 const MultivariateCoefficientMR operator /( const MultivariateCoefficientMR& m1, const MultivariateCoefficientMR& m2 ) 00061 { 00062 return m1.mCoefficient / m2.mCoefficient; 00063 } 00064 00065 std::ostream& operator <<( std::ostream& os, const MultivariateCoefficientMR& m1 ) 00066 { 00067 return os << m1.mCoefficient; 00068 } 00069 }