forked from pichtj/groebner
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathintegral.cpp
More file actions
34 lines (29 loc) · 780 Bytes
/
Copy pathintegral.cpp
File metadata and controls
34 lines (29 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "integral.h"
#include <istream>
std::istream& operator>>(std::istream& in, flint::fmpzxx& i) {
auto next = in.peek();
std::string s;
while (!in.eof() && (std::isdigit(next) || next == '+' || next == '-')) {
s += in.get();
next = in.peek();
}
i = flint::fmpzxx(s.c_str());
return in;
}
std::istream& operator>>(std::istream& in, mpz_class& i) {
auto next = in.peek();
std::string s;
while (!in.eof() && (std::isdigit(next) || next == '+' || next == '-')) {
s += in.get();
next = in.peek();
}
i = mpz_class(s.c_str());
return in;
}
std::ostream& operator<<(std::ostream& out, const mpz_class& i) {
char* s = mpz_get_str(0, 10, i.get_mpz_t());
out << s;
free(s);
return out;
}
// vim:ruler:cindent:shiftwidth=2:expandtab: