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:
parent
a3498d227b
commit
fec5f7b828
3 changed files with 17 additions and 22 deletions
|
@ -16,21 +16,22 @@ extern bool KNF;
|
||||||
class Implikant_localisation{
|
class Implikant_localisation{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint currentI;
|
void setElement(uint ¤tI)
|
||||||
uint w;
|
{
|
||||||
uint h;
|
uint numVarX = (uint)floor(dimension / 2.0f);
|
||||||
const uint numVarX;
|
|
||||||
|
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:
|
public:
|
||||||
void setElement(uint currentI){
|
uint i;
|
||||||
this->currentI = currentI;
|
uint w;
|
||||||
this->w = (currentI & ((0x1 << (this->numVarX)) - 1)) ^ ((currentI & ((0x1 << (this->numVarX)) - 1)) / 2); // w^=w/2
|
uint h;
|
||||||
this->h = (currentI >> this->numVarX) ^ ((currentI >> this->numVarX) / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Implikant_localisation(uint currentI) :numVarX(((uint)floor(dimension / 2.0f))){
|
|
||||||
|
|
||||||
|
Implikant_localisation(uint ¤tI)
|
||||||
|
{
|
||||||
setElement(currentI);
|
setElement(currentI);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,12 +6,6 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
void PrimImplikant::add(Implikant_localisation* &I){
|
|
||||||
|
|
||||||
I_Vector.push_back(I);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool PrimImplikant::valueAt(uint pos) {
|
bool PrimImplikant::valueAt(uint pos) {
|
||||||
for (vector<uint>::iterator i = implikanten.begin(); i < implikanten.end(); ++i)
|
for (vector<uint>::iterator i = implikanten.begin(); i < implikanten.end(); ++i)
|
||||||
if (*i == pos)
|
if (*i == pos)
|
||||||
|
@ -46,8 +40,6 @@ void PrimImplikant::parser(string input) { // Analyser
|
||||||
implikant += (uint)c - (uint)'0';
|
implikant += (uint)c - (uint)'0';
|
||||||
}
|
}
|
||||||
|
|
||||||
Implikant_localisation* I = new Implikant_localisation(implikant);
|
|
||||||
this->add(I);
|
|
||||||
|
|
||||||
implikanten.push_back(implikant);
|
implikanten.push_back(implikant);
|
||||||
|
I_Vector.push_back(new Implikant_localisation(implikant));
|
||||||
}
|
}
|
|
@ -24,6 +24,7 @@ public:
|
||||||
name = nameC;
|
name = nameC;
|
||||||
|
|
||||||
implikanten.push_back(input);
|
implikanten.push_back(input);
|
||||||
|
I_Vector.push_back(new Implikant_localisation(input));
|
||||||
}
|
}
|
||||||
PrimImplikant(uint input1, uint input2)
|
PrimImplikant(uint input1, uint input2)
|
||||||
{
|
{
|
||||||
|
@ -35,12 +36,13 @@ public:
|
||||||
name.append(nameC);
|
name.append(nameC);
|
||||||
|
|
||||||
implikanten.push_back(input1);
|
implikanten.push_back(input1);
|
||||||
|
I_Vector.push_back(new Implikant_localisation(input1));
|
||||||
implikanten.push_back(input2);
|
implikanten.push_back(input2);
|
||||||
|
I_Vector.push_back(new Implikant_localisation(input2));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrimImplikant::valueAt(uint position);
|
bool PrimImplikant::valueAt(uint position);
|
||||||
void PrimImplikant::parser(string input);
|
void PrimImplikant::parser(string input);
|
||||||
void add(Implikant_localisation* &I);
|
|
||||||
|
|
||||||
vector<uint> implikanten;
|
vector<uint> implikanten;
|
||||||
vector<Implikant_localisation*> I_Vector;
|
vector<Implikant_localisation*> I_Vector;
|
||||||
|
|
Loading…
Reference in a new issue