partial_reducer: specialize list version of base
[barvinok.git] / NTL_QQ.cc
blob2f9e646109edae6530706a573248b04f845745a1
1 #include <assert.h>
2 #include <barvinok/NTL_QQ.h>
4 NTL_vector_impl(QQ,vec_QQ);
6 vec_QQ& operator *= (vec_QQ& a, const ZZ& b)
8 for (int i = 0; i < a.length(); ++i)
9 a[i] *= b;
10 return a;
13 vec_QQ& operator *= (vec_QQ& a, const QQ& b)
15 for (int i = 0; i < a.length(); ++i)
16 a[i] *= b;
17 return a;
20 std::ostream& operator<< (std::ostream& os, const QQ& q)
22 os << q.n << "/" << q.d;
23 return os;
26 std::istream& operator>> (std::istream& is, QQ& q)
28 char slash;
29 is >> q.n >> slash >> q.d;
30 assert(slash == '/');
31 return is;
34 NTL_io_vector_impl(QQ,vec_QQ);