Erstellung der Klasse Implikant_localisation, die die Daten für das

Zeichen eines Implikantenkuller speichert.
This commit is contained in:
gaeltp3 2013-12-19 02:18:21 +01:00
parent 3e384a4bf1
commit a3498d227b
3 changed files with 41 additions and 0 deletions

View file

@ -0,0 +1,38 @@
#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:
uint currentI;
uint w;
uint h;
const uint numVarX;
public:
void setElement(uint currentI){
this->currentI = currentI;
this->w = (currentI & ((0x1 << (this->numVarX)) - 1)) ^ ((currentI & ((0x1 << (this->numVarX)) - 1)) / 2); // w^=w/2
this->h = (currentI >> this->numVarX) ^ ((currentI >> this->numVarX) / 2);
}
Implikant_localisation(uint currentI) :numVarX(((uint)floor(dimension / 2.0f))){
setElement(currentI);
}
};
#endif;

View file

@ -40,7 +40,9 @@ public:
bool PrimImplikant::valueAt(uint position);
void PrimImplikant::parser(string input);
void add(Implikant_localisation* &I);
vector<uint> implikanten;
vector<Implikant_localisation*> I_Vector;
};
#endif

View file

@ -13,6 +13,7 @@ void PrimImplikantCollection::add(PrimImplikant* &PI)
void PrimImplikantCollection::add(string input)
{
PrimImplikant* PI = new PrimImplikant(input);
PI->id = this->size();
this->add(PI);
}