Erstellung der Klasse Implikant_localisation, die die Daten für das
Zeichen eines Implikantenkuller speichert.
This commit is contained in:
		
							parent
							
								
									3e384a4bf1
								
							
						
					
					
						commit
						a3498d227b
					
				
					 3 changed files with 41 additions and 0 deletions
				
			
		
							
								
								
									
										38
									
								
								Hazard/Hazard/Implikant_localisation.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								Hazard/Hazard/Implikant_localisation.h
									
									
									
									
									
										Normal 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;
 | 
				
			||||||
| 
						 | 
					@ -40,7 +40,9 @@ public:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	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;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					@ -13,6 +13,7 @@ void PrimImplikantCollection::add(PrimImplikant* &PI)
 | 
				
			||||||
void PrimImplikantCollection::add(string input)
 | 
					void PrimImplikantCollection::add(string input)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	PrimImplikant* PI = new PrimImplikant(input);
 | 
						PrimImplikant* PI = new PrimImplikant(input);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	PI->id = this->size();
 | 
						PI->id = this->size();
 | 
				
			||||||
	this->add(PI);
 | 
						this->add(PI);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue