quotient< NT, DT > Class Template Reference

#include <quotient.hpp>

List of all members.

Public Member Functions

Friends


Detailed Description

template<typename NT, typename DT>
class mmx::quotient< NT, DT >

Definition at line 53 of file quotient.hpp.


Constructor & Destructor Documentation

quotient (  )  [inline]

Definition at line 59 of file quotient.hpp.

00059                     :
00060     n (), d (1) {}
  template<typename T> inline quotient (const format<T>& fm):

quotient ( const format< T > &  fm  )  [inline]

Definition at line 61 of file quotient.hpp.

References promote().

00061                                                             :
00062     n (promote (0, fm)), d (promote (1, fm)) {}
  template<typename T> inline quotient (const T& x):

quotient ( const T &  x  )  [inline]

Definition at line 63 of file quotient.hpp.

00063                                                    :
00064     n (outplace_set_as<NT> (x)), d (outplace_set_as<DT> ((int) 1)) {}
  template<typename NT2, typename DT2>

quotient ( const quotient< NT2, DT2 > &  x  )  [inline]

Definition at line 66 of file quotient.hpp.

00066                                               :
00067     n (numerator (x)), d (denominator (x)) {}
  template<typename NT2, typename DT2> inline

quotient ( const NT2 &  x,
const DT2 &  y 
) [inline]

Definition at line 69 of file quotient.hpp.

References mmx::normalize(), and promote().

00069                                        :
00070     n (x), d (y) {
00071       if (n == promote (0, n)) d= promote (1, d);
00072       else quotient_normalization_helper<NT,DT>::normalize (n, d); }
  template<typename NT2, typename DT2> inline

quotient ( const NT2 &  x,
const DT2 &  y,
bool  simplify 
) [inline]

Definition at line 74 of file quotient.hpp.

References mmx::DT, mmx::gcd(), mmx::normalize(), and promote().

00074                                                       :
00075     n (x), d (y) {
00076     assert (simplify);
00077     if (n == promote (0, n))
00078       d= promote (1, d);
00079     else {
00080       DT g= gcd (n, d);
00081       n /= g;
00082       d /= g;
00083     }
00084     quotient_normalization_helper<NT,DT>::normalize (n, d); }
  friend NT numerator LESSGTR (const Quotient& x);


Friends And Related Function Documentation

DT denominator LESSGTR ( const quotient< NT, DT > &  x  )  [friend]
NT numerator LESSGTR ( const quotient< NT, DT > &  x  )  [friend]

The documentation for this class was generated from the following file:

Generated on 6 Dec 2012 for algebramix by  doxygen 1.6.1