Location of a PrimImplikant

This commit is contained in:
Jonny007-MKD 2014-01-05 19:13:19 +01:00
parent a7e4edb77e
commit 184555aa26
2 changed files with 28 additions and 39 deletions

View file

@ -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 &currentI)
{
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 &currentI)
{
setElement(currentI);
}
};
#endif;

View 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
}
};