Gute Idee!

1. i, h, w müssen public sein
2. numVarX muss nicht jedes mal gespeichert werden
3. noch mehr push_backs für I_Vector
This commit is contained in:
Jonny007-MKD 2013-12-19 03:14:14 +01:00
parent a3498d227b
commit fec5f7b828
3 changed files with 17 additions and 22 deletions

View file

@ -16,21 +16,22 @@ extern bool KNF;
class Implikant_localisation{
private:
uint currentI;
uint w;
uint h;
const uint numVarX;
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:
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))){
uint i;
uint w;
uint h;
Implikant_localisation(uint &currentI)
{
setElement(currentI);
}
};

View file

@ -6,12 +6,6 @@
using namespace std;
void PrimImplikant::add(Implikant_localisation* &I){
I_Vector.push_back(I);
}
bool PrimImplikant::valueAt(uint pos) {
for (vector<uint>::iterator i = implikanten.begin(); i < implikanten.end(); ++i)
if (*i == pos)
@ -46,8 +40,6 @@ void PrimImplikant::parser(string input) { // Analyser
implikant += (uint)c - (uint)'0';
}
Implikant_localisation* I = new Implikant_localisation(implikant);
this->add(I);
implikanten.push_back(implikant);
I_Vector.push_back(new Implikant_localisation(implikant));
}

View file

@ -24,6 +24,7 @@ public:
name = nameC;
implikanten.push_back(input);
I_Vector.push_back(new Implikant_localisation(input));
}
PrimImplikant(uint input1, uint input2)
{
@ -35,12 +36,13 @@ public:
name.append(nameC);
implikanten.push_back(input1);
I_Vector.push_back(new Implikant_localisation(input1));
implikanten.push_back(input2);
I_Vector.push_back(new Implikant_localisation(input2));
}
bool PrimImplikant::valueAt(uint position);
void PrimImplikant::parser(string input);
void add(Implikant_localisation* &I);
vector<uint> implikanten;
vector<Implikant_localisation*> I_Vector;