35 lines
652 B
C++
35 lines
652 B
C++
#include "ls.h"
|
|
|
|
|
|
std::vector<int> local_search(Circuit* circuit) {
|
|
|
|
// local search vector
|
|
std::vector<Gate*> vec;
|
|
|
|
init_vector(circuit, &vec);
|
|
|
|
init_circuit(circuit);
|
|
|
|
printf("local search!\n");
|
|
|
|
return std::vector<int>();
|
|
}
|
|
|
|
|
|
void init_circuit(Circuit* circuit) {
|
|
for(auto pi : circuit->PIs) {
|
|
pi->value = rand() % 2;
|
|
}
|
|
}
|
|
|
|
void init_vector(Circuit* circuit, std::vector<Gate*> *vec) {
|
|
for(auto pi : circuit->PIs) {
|
|
vec->push_back(pi);
|
|
}
|
|
for(auto gate : circuit->gates) {
|
|
// fanout stem
|
|
if(gate->outputs.size() >= 2) {
|
|
vec->push_back(gate);
|
|
}
|
|
}
|
|
} |