This is a SOM implementation using C Lib Functions and C++ Object Oriented Programming Style
-
Edit points data in main.cpp - initPoints()
-
Compile
g++ SOM.cpp main.cpp -I SOM.h -o SOM
-
Run
./SOM
a simple structure with attributes x and y
you can init by using Point(X, Y)
SOM som(NUM_OF_POINTS, PTR_POINT_LIST); // initialization
som.run(NUM_OF_ITERATIONS); // start iteration
som.getRoute(); // get the best route (readonly)
som.getRoute(PTR_ROUTE_LIST); // copy to new LIST (writable)
som.getDist(); // get min distance