GiNaCRA
0.6.4
|
00001 00021 #ifndef GINACRA_OPERATORS_H 00022 #define GINACRA_OPERATORS_H 00023 00033 #pragma once 00034 #include <ginac/operators.h> 00035 #include <tr1/memory> 00036 00037 namespace GiNaCRA 00038 { 00039 00041 // Common // 00043 00051 const GiNaC::numeric abs( const GiNaC::ex& x ); 00052 00054 // OpenInterval // 00056 00057 class OpenInterval; 00058 00059 // binary arithmetic operators of OpenInterval 00060 const OpenInterval operator+( const OpenInterval&, const OpenInterval& ); 00061 const OpenInterval operator-( const OpenInterval&, const OpenInterval& ); 00062 const OpenInterval operator*( const OpenInterval&, const OpenInterval& ); 00063 // unary arithmetic operators of OpenInterval 00064 const OpenInterval operator-( const OpenInterval& ); 00065 // relational operators of OpenInterval 00066 const bool operator==( const OpenInterval&, const OpenInterval& ); 00067 const bool operator!=( const OpenInterval&, const OpenInterval& ); 00068 const bool operator<=( const OpenInterval&, const OpenInterval& ); 00069 const bool operator>=( const OpenInterval&, const OpenInterval& ); 00070 00071 // mixed arithmetic operators 00072 const OpenInterval operator+( const OpenInterval&, const GiNaC::numeric& ); 00073 const OpenInterval operator+( const GiNaC::numeric&, const OpenInterval& ); 00074 const OpenInterval operator-( const OpenInterval&, const GiNaC::numeric& ); 00075 const OpenInterval operator-( const GiNaC::numeric&, const OpenInterval& ); 00076 const OpenInterval operator*( const OpenInterval&, const GiNaC::numeric& ); 00077 const OpenInterval operator*( const GiNaC::numeric&, const OpenInterval& ); 00078 const OpenInterval operator/(const GiNaC::numeric&, const OpenInterval&) throw (std::overflow_error ); 00079 const OpenInterval operator/(const OpenInterval&, const GiNaC::numeric&) throw (std::overflow_error ); 00080 00082 // UnivariatePolynomial // 00084 00085 class UnivariatePolynomial; 00086 class RationalUnivariatePolynomial; 00087 00088 // binary arithmetic operators 00089 const UnivariatePolynomial operator+( const UnivariatePolynomial&, const UnivariatePolynomial& ); 00090 const UnivariatePolynomial operator-( const UnivariatePolynomial&, const UnivariatePolynomial& ); 00091 const UnivariatePolynomial operator*( const UnivariatePolynomial&, const UnivariatePolynomial& ); 00092 const UnivariatePolynomial operator/( const UnivariatePolynomial&, const UnivariatePolynomial& ); 00093 //const UnivariatePolynomial operator%( const UnivariatePolynomial&, const UnivariatePolynomial& ); 00094 const RationalUnivariatePolynomial operator+( const RationalUnivariatePolynomial&, const RationalUnivariatePolynomial& ); 00095 const RationalUnivariatePolynomial operator-( const RationalUnivariatePolynomial&, const RationalUnivariatePolynomial& ); 00096 const RationalUnivariatePolynomial operator*( const RationalUnivariatePolynomial&, const RationalUnivariatePolynomial& ); 00097 const RationalUnivariatePolynomial operator/( const RationalUnivariatePolynomial&, const RationalUnivariatePolynomial& ); 00098 const RationalUnivariatePolynomial operator%( const RationalUnivariatePolynomial&, const RationalUnivariatePolynomial& ); 00099 // unary arithmetic operators 00100 const UnivariatePolynomial operator-( const UnivariatePolynomial& ); 00101 const RationalUnivariatePolynomial operator-( const RationalUnivariatePolynomial& ); 00102 // relational operators 00103 const bool operator==( const UnivariatePolynomial&, const UnivariatePolynomial& ); 00104 const bool operator!=( const UnivariatePolynomial&, const UnivariatePolynomial& ); 00105 00107 // UnivariatePolynomialSet // 00109 00110 class UnivariatePolynomialSet; 00111 00112 std::ostream& operator<<( std::ostream& os, const UnivariatePolynomialSet& ); 00113 00115 // RealAlgebraicNumberIR // 00117 00118 class RealAlgebraicNumberIR; 00119 00120 // binary arithmetic operators 00121 RealAlgebraicNumberIR& operator+( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00122 RealAlgebraicNumberIR& operator-( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00123 RealAlgebraicNumberIR& operator*( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00124 RealAlgebraicNumberIR& operator/( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00125 RealAlgebraicNumberIR& operator^( RealAlgebraicNumberIR&, int ); 00126 // unary arithmetic operators 00127 RealAlgebraicNumberIR& operator-( RealAlgebraicNumberIR& ); 00128 // relational operators 00129 const bool operator==( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00130 const bool operator==( const RealAlgebraicNumberIR&, const RealAlgebraicNumberIR& ); 00131 const bool operator!=( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00132 const bool operator<( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00133 const bool operator>( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00134 const bool operator<=( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00135 const bool operator>=( RealAlgebraicNumberIR&, RealAlgebraicNumberIR& ); 00136 00137 // mixed arithmetic operators 00138 RealAlgebraicNumberIR& operator+( const GiNaC::numeric&, RealAlgebraicNumberIR& ); 00139 RealAlgebraicNumberIR& operator+( RealAlgebraicNumberIR&, const GiNaC::numeric& ); 00140 RealAlgebraicNumberIR& operator-( const GiNaC::numeric&, RealAlgebraicNumberIR& ); 00141 RealAlgebraicNumberIR& operator-( RealAlgebraicNumberIR&, const GiNaC::numeric& ); 00142 RealAlgebraicNumberIR& operator*( const GiNaC::numeric&, RealAlgebraicNumberIR& ); 00143 RealAlgebraicNumberIR& operator*( RealAlgebraicNumberIR&, const GiNaC::numeric& ); 00144 RealAlgebraicNumberIR& operator/( const GiNaC::numeric&, RealAlgebraicNumberIR& ); 00145 RealAlgebraicNumberIR& operator/( RealAlgebraicNumberIR&, const GiNaC::numeric& ); 00146 00148 // RealAlgebraicNumber // 00150 00151 class RealAlgebraicNumber; 00152 class RealAlgebraicNumberNR; 00153 00154 typedef std::tr1::shared_ptr<RealAlgebraicNumber> RealAlgebraicNumberPtr; 00155 00156 // basic binary operator 00157 RealAlgebraicNumberPtr binaryOperator( const RealAlgebraicNumberPtr& lh, const RealAlgebraicNumberPtr& rh, RealAlgebraicNumberIR&( *opIRIR )(RealAlgebraicNumberIR&, RealAlgebraicNumberIR&), RealAlgebraicNumberIR&( *opIRNR )(RealAlgebraicNumberIR&, const GiNaC::numeric&), const GiNaC::numeric( *opNRNR )(const GiNaC::numeric&, const GiNaC::numeric&) ); 00158 // binary arithmetic operators 00159 RealAlgebraicNumberPtr operator+(const RealAlgebraicNumberPtr&, const RealAlgebraicNumberPtr& ); 00160 RealAlgebraicNumberPtr operator-(const RealAlgebraicNumberPtr&, const RealAlgebraicNumberPtr& ); 00161 RealAlgebraicNumberPtr operator*(const RealAlgebraicNumberPtr&, const RealAlgebraicNumberPtr& ); 00162 RealAlgebraicNumberPtr operator/(const RealAlgebraicNumberPtr&, const RealAlgebraicNumberPtr& ); 00163 RealAlgebraicNumberPtr operator^( const RealAlgebraicNumberPtr&, int ); 00164 // unary arithmetic operators 00165 RealAlgebraicNumberPtr operator-( const RealAlgebraicNumberPtr& ); 00166 // relational operators 00167 const bool operator==( const RealAlgebraicNumberPtr&, const RealAlgebraicNumberPtr& ); 00168 const bool operator!=( const RealAlgebraicNumberPtr&, const RealAlgebraicNumberPtr& ); 00169 const bool operator<( const RealAlgebraicNumberPtr&, const RealAlgebraicNumberPtr& ); 00170 00171 // streaming operators 00172 std::ostream& operator<<( std::ostream& os, const RealAlgebraicNumberPtr& ); 00173 void print( const RealAlgebraicNumberPtr&, std::ostream& os = std::cout ); 00174 00176 // RealAlgebraicPoint // 00178 00179 class RealAlgebraicPoint; 00180 00181 // streaming operators 00182 std::ostream& operator<<( std::ostream& os, const RealAlgebraicPoint& ); 00183 00185 // Constraint // 00187 00188 class Constraint; 00189 00190 // relational operators 00191 const bool operator==( const Constraint&, const Constraint& ); 00192 00193 // streaming operators 00194 std::ostream& operator<<( std::ostream& os, const Constraint& ); 00195 00197 // DIRECT IMPLEMENTATIONS of classes with template parameters // 00199 00203 // 00204 //template<typename monomialOrdering> 00205 //class MultivariatePolynomial; 00206 // 00207 //template<class monomialOrdering> 00208 //std::ostream& operator<<( std::ostream & os, MultivariatePolynomial<monomialOrdering> p ); 00209 // 00211 // 00212 //template<class monomialOrdering> 00213 //const MultivariatePolynomial<monomialOrdering> operator+( const MultivariatePolynomial<monomialOrdering>& a, const MultivariatePolynomial<monomialOrdering>& b ); 00214 // 00215 //template<class monomialOrdering> 00216 //const MultivariatePolynomial<monomialOrdering> operator-( const MultivariatePolynomial<monomialOrdering>& a, const MultivariatePolynomial<monomialOrdering>& b ); 00217 // 00218 //template<class monomialOrdering> 00219 //const MultivariatePolynomial<monomialOrdering> operator*( const MultivariatePolynomial<monomialOrdering>& a, const MultivariatePolynomial<monomialOrdering>& b ); 00220 // 00221 //template<class monomialOrdering> 00222 //const MultivariatePolynomial<monomialOrdering> operator^( const MultivariatePolynomial<monomialOrdering>& a, const unsigned e ); 00223 // 00225 // 00226 //template<class monomialOrdering> 00227 //const MultivariatePolynomial<monomialOrdering> operator-( const MultivariatePolynomial<monomialOrdering>& a ); 00228 // 00232 // 00233 //template<typename monomialOrdering> 00234 //class MultivariateTerm; 00235 // 00236 //template<class monomialOrdering> 00237 //std::ostream& operator<<( std::ostream & os, MultivariateTerm<monomialOrdering> p ); 00238 // 00239 //template<class monomialOrdering> 00240 //const MultivariateTerm<monomialOrdering> operator*( const MultivariateTerm<monomialOrdering>& a, const MultivariateTerm<monomialOrdering>& b ); 00241 // 00245 // 00246 //template<typename monomialOrdering> 00247 //class MultivariateCoefficient; 00248 //template<class monomialOrdering> 00249 //std::ostream& operator<<( std::ostream & os, MultivariateCoefficient<monomialOrdering> p ); 00250 // 00254 // 00255 //template<typename monomialOrdering> 00256 //class MultivariateMonomial; 00257 // 00258 //template<class monomialOrdering> 00259 //std::ostream& operator<<( std::ostream & os, MultivariateMonomial<monomialOrdering> p ); 00260 // 00262 // 00263 //template<class monomialOrdering> 00264 //const MultivariateMonomial<monomialOrdering> operator*( const MultivariateMonomial<monomialOrdering>& a, const MultivariateMonomial<monomialOrdering>& b ); 00265 // 00269 // 00270 //template<typename monomialOrdering> 00271 //class SpecialQuotientRingMultiplicationTable; 00272 // 00273 //template<class monomialOrdering> 00274 //std::ostream& operator<<( std::ostream & os, SpecialQuotientRingMultiplicationTable<monomialOrdering> t ); 00275 00276 } // namespace GiNaC 00277 00278 #endif // GINACRA_OPERATORS_H