Location of a PrimImplikant
This commit is contained in:
parent
a7e4edb77e
commit
184555aa26
2 changed files with 28 additions and 39 deletions
|
@ -1,39 +0,0 @@
|
|||
#include "stdafx.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "PrimImplikant.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern uint dimension;
|
||||
extern uint numElements;
|
||||
extern bool KNF;
|
||||
|
||||
#ifndef IMPLIKANT_LOC
|
||||
#define IMPLIKANT_LOC
|
||||
|
||||
|
||||
class Implikant_localisation{
|
||||
|
||||
private:
|
||||
void setElement(uint ¤tI)
|
||||
{
|
||||
uint numVarX = (uint)floor(dimension / 2.0f);
|
||||
|
||||
this->i = currentI;
|
||||
this->w = (currentI & ((0x1 << (numVarX)) - 1)) ^ ((currentI & ((0x1 << (numVarX)) - 1)) / 2); // w^=w/2
|
||||
this->h = (currentI >> numVarX) ^ ((currentI >> numVarX) / 2);
|
||||
}
|
||||
|
||||
public:
|
||||
uint i;
|
||||
uint w;
|
||||
uint h;
|
||||
|
||||
Implikant_localisation(uint ¤tI)
|
||||
{
|
||||
setElement(currentI);
|
||||
}
|
||||
};
|
||||
|
||||
#endif;
|
28
Hazard/Hazard/KV_PiEleLoc.h
Normal file
28
Hazard/Hazard/KV_PiEleLoc.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
extern uint dimension;
|
||||
|
||||
class KV_PiEleLoc
|
||||
{
|
||||
public:
|
||||
uint i;
|
||||
uint w;
|
||||
uint h;
|
||||
|
||||
KV_PiEleLoc(uint &i)
|
||||
{
|
||||
const uint numVarX = (uint)floor(dimension / 2.0f);
|
||||
|
||||
this->i = i;
|
||||
|
||||
this->w = i & ((0x1 << (numVarX)) - 1); // get x coord
|
||||
this->w ^= w/2; // make it gray
|
||||
|
||||
this->h = i >> numVarX; // get y coord
|
||||
this->h ^= h/2; // make it gray
|
||||
}
|
||||
};
|
Loading…
Reference in a new issue