예제 #1
0
파일: BenesNetwork.cpp 프로젝트: 2080/HElib
bool GeneralBenesNetwork::testNetwork(const Permut& perm) const
{
  long sz = getSize();
  long nlev = getNumLevels();

  for (long j = 0; j < sz; j++) {
    // find correct position for j

    long j1 = j;
    for (long i = 0; i < nlev; i++) {
      const Vec<short>& lev = getLevel(i);
      j1 += shamt(i)*lev[j1];
    }
    if (perm[j1] != j) return false;
  }
  return true;
}
예제 #2
0
std::string Instruction::getShamtName() {
  std::string result = std::to_string( shamt().to_ulong() );
  return result;
}