NTL_QQ.cc: support reading from stream
[barvinok.git] / NTL_QQ.cc
blobb39b3cec52aeae31beb2806799df57e5300b035a
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 std::ostream& operator<< (std::ostream& os, const QQ& q)
15 os << q.n << "/" << q.d;
16 return os;
19 std::istream& operator>> (std::istream& is, QQ& q)
21 char slash;
22 is >> q.n >> slash >> q.d;
23 assert(slash == '/');
24 return is;
27 NTL_io_vector_impl(QQ,vec_QQ);