asg7.tar.gz
) including:
README
file containing assignment and solution
descriptions, e.g., program design, description of algorithm,
etc., if appropriate.
INSTALL
file containing any specific compliation
quirks peculiar to your program, e.g.,
make -f Makefile.smirp
.
USAGE
file containing any specific usage quirks
peculiar to your program, e.g.,
./smirp < smirp.in
where
./smirp
is the executable and
smirp.in
is the input.
src/
directory with source code.
vector<Point* > pts;
Point* ptp;
while(std::cin >> (ptp = new Point(0.0,0.0)))
pts.push_back(ptp);
graph.resize((int)pts.size());
for(int i=0; i<(int)pts.size(); ++i)
graph.addVertex(i,pts[i],(int)pts.size()-1);
for(int i=0; i<(int)pts.size(); ++i)
for(int j=0; j<(int)pts.size(); ++j)
if(i!=j) graph.addEdge(i,j);
graph.prims(0);
vector<Point* > mst_pts;
graph.edges(&mst_pts);
for(int j=0; j<(int)mst_pts.size(); ++j)
std::cout << mst_pts[j];