From af3e7d0b81f965cf679615dd4592c242454c3dab Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Wed, 15 Feb 2017 06:16:43 +0900 Subject: [PATCH] add getStr() --- include/mcl/fp_tower.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/mcl/fp_tower.hpp b/include/mcl/fp_tower.hpp index f9a270e..ae8effb 100644 --- a/include/mcl/fp_tower.hpp +++ b/include/mcl/fp_tower.hpp @@ -149,7 +149,7 @@ public: { return is >> self.a >> self.b; } - std::string getStr(int ioMode = 10) + std::string getStr(int ioMode = 10) const { return a.getStr(ioMode) + fp::getIoSeparator(ioMode) + b.getStr(ioMode); } @@ -579,6 +579,11 @@ struct Fp6T : public fp::Operator > { { return is >> x.a >> x.b >> x.c; } + std::string getStr(int ioMode = 10) const + { + const char *sep = fp::getIoSeparator(ioMode); + return a.getStr(ioMode) + sep + b.getStr(ioMode) + sep + c.getStr(ioMode); + } static void add(Fp6T& z, const Fp6T& x, const Fp6T& y) { Fp2::add(z.a, x.a, y.a); @@ -888,6 +893,10 @@ struct Fp12T : public fp::Operator > { { return is >> self.a >> self.b; } + std::string getStr(int ioMode = 10) const + { + return a.getStr(ioMode) + fp::getIoSeparator(ioMode) + b.getStr(ioMode); + } void normalize() {} // dummy };