add getStr()

dev
MITSUNARI Shigeo 8 years ago
parent f1cb674d63
commit af3e7d0b81
  1. 11
      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<Fp6T<Fp> > {
{
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<Fp12T<Fp> > {
{
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
};

Loading…
Cancel
Save