5 #include "BPASFieldOfFractions.hpp" 6 #include "../../include/RationalFunction/rationalfunction_euclideanmethods.h" 7 #include "../../include/RationalNumberPolynomial/mrpolynomial.h" 14 template <
class Domain>
51 std::cout <<
"BPAS error: denominator is zero from Fraction<Domain>" << std::endl;
67 void setNumerator(
const Domain& b);
68 void setDenominator(
const Domain& b);
70 void set(
const Domain& a,
const Domain& b);
113 bool isNegativeOne()
const;
115 int isConstant()
const;
125 void print(std::ostream& ostream)
const;
139 void differentiate();
149 std::cerr <<
"UnivariateRationalFunction::convertToExpressionTree NOT YET IMPLEMENTED" << std::endl;
158 if(
isZero() ==
true &&b.isZero() ==
true){
171 std::cerr <<
"BPAS ERROR: Fraction::squareFree NOT YET IMPLEMENTED" << std::endl;
181 std::cerr <<
"in Fraction<Domain>, zero does not have a euclidean size" << std::endl;
205 std::cerr <<
"Fraction::extendedEuclidean NOT YET IMPLEMENTED" << std::endl;
Fraction< Domain > inverse() const
Get the inverse of *this.
An abstract class defining the interface of a field of fractions.
Definition: BPASFieldOfFractions.hpp:16
Fraction< Domain > operator*(const Fraction< Domain > &b) const
Multiplication.
Factors< Fraction< Domain > > squareFree() const
Compute squarefree factorization of *this.
Definition: Fraction.hpp:170
void one()
Make *this ring element one.
Fraction< Domain > operator^(long long int e) const
Overload operator ^ replace xor operation by exponentiation.
An ExpressionTree encompasses various forms of data that can be expressed generically as a binary tre...
Definition: ExpressionTree.hpp:17
Fraction< Domain > gcd(const Fraction< Domain > &b) const
Get GCD of *this and other.
Definition: Fraction.hpp:154
Domain numerator() const
Get the fraction's numerator.
bool operator!=(const Fraction< Domain > &b) const
Inequality test,.
Fraction< Domain > operator-() const
Negation.
Domain denominator() const
Get the fraction's denominator.
Fraction< Domain > operator/(const Fraction< Domain > &b) const
Exact division.
A field of fractions templated by an arbitrary BPASGCDDomain.
Definition: Fraction.hpp:15
Fraction< Domain > & operator=(const Fraction< Domain > &b)
Overload operator =.
Fraction< Domain > & operator-=(const Fraction< Domain > &b)
Subtraction assignment.
void zero()
Make *this ring element zero.
Fraction< Domain > & operator+=(const Fraction< Domain > &b)
Addition assignment.
Fraction< Domain > euclideanDivision(const Fraction< Domain > &b, Fraction< Domain > *q=NULL) const
Perform the eucldiean division of *this and b.
Definition: Fraction.hpp:189
A simple data structure for encapsulating a collection of Factor elements.
Definition: Factors.hpp:95
void canonicalize()
Canonicalize this fraction, reducing terms as needed.
void print(std::ostream &ostream) const
Print the Ring element.
An arbitrary-precision Integer.
Definition: Integer.hpp:22
Fraction< Domain > unitCanonical(Fraction< Domain > *u=NULL, Fraction< Domain > *v=NULL) const
Obtain the unit normal (a.k.a canonical associate) of an element.
Integer euclideanSize() const
Get the euclidean size of *this.
Definition: Fraction.hpp:175
Fraction< Domain > operator+(const Fraction< Domain > &b) const
Addition.
ExpressionTree convertToExpressionTree() const
Convert this to an expression tree.
Definition: Fraction.hpp:148
Fraction< Domain > & operator^=(long long int e)
Overload operator ^= replace xor operation by exponentiation.
Fraction< Domain > & operator%=(const Fraction< Domain > &b)
Assign *this to be the remainder of *this and b.
Fraction< Domain > operator%(const Fraction< Domain > &b) const
Get the remainder of *this and b;.
bool isOne() const
Determine if *this ring element is one, that is the multiplication identity.
bool operator==(const Fraction< Domain > &b) const
Equality test,.
bool isZero() const
Determine if *this ring element is zero, that is the additive identity.
Fraction< Domain > & operator*=(const Fraction< Domain > &b)
Multiplication assignment.
Fraction< Domain > & operator/=(const Fraction< Domain > &b)
Exact division assignment.
Fraction< Domain > extendedEuclidean(const Fraction< Domain > &b, Fraction< Domain > *s=NULL, Fraction< Domain > *t=NULL) const
Perform the extended euclidean division on *this and b.
Definition: Fraction.hpp:204
Fraction< Domain > quotient(const Fraction< Domain > &b) const
Get the quotient of *this and b.
Fraction< Domain > remainder(const Fraction< Domain > &b) const
Get the remainder of *this and b.