galoisfieldelement.cpp

来自「心电图小波零树压缩演算法的研究」· C++ 代码 · 共 88 行

CPP
88
字号
#include "GaloisFieldElement.h"namespace galois{   GaloisFieldElement::GaloisFieldElement(GaloisField* _gf, GFSymbol v)   {      if (_gf != NULL)      {         gf         = _gf;         poly_value = v & gf->size();      }      else        poly_value = v;   }   GaloisFieldElement::GaloisFieldElement(const GaloisFieldElement& gfe)   {      gf          = gfe.gf;      poly_value  = gfe.poly_value;   }   std::ostream& operator << (std::ostream& os, const GaloisFieldElement& gfe)   {      os << gfe.poly_value;      return os;   }   GaloisFieldElement operator+(const GaloisFieldElement& a, const GaloisFieldElement& b)   {      GaloisFieldElement result  = a;      result += b;      return result;   }   GaloisFieldElement operator-(const GaloisFieldElement& a, const GaloisFieldElement& b)   {      GaloisFieldElement result  = a;      result -= b;      return result;   }   GaloisFieldElement operator*(const GaloisFieldElement& a, const GaloisFieldElement& b)   {      GaloisFieldElement result  = a;      result *= b;      return result;   }   GaloisFieldElement operator*(const GaloisFieldElement& a, const GFSymbol& b)   {      GaloisFieldElement result  = a;      result *= b;      return result;   }   GaloisFieldElement operator*(const GFSymbol& a, const GaloisFieldElement& b)   {      GaloisFieldElement result  = b;      result *= a;      return result;   }   GaloisFieldElement operator/(const GaloisFieldElement& a, const GaloisFieldElement& b)   {      GaloisFieldElement result  = a;      result /= b;      return result;   }   GaloisFieldElement operator^(const GaloisFieldElement& a, const int& b)   {      GaloisFieldElement result  = a;      result ^= b;      return result;   }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?