Hi:
I am a newbie to the world of Boost.
I have a problem in compiling a program. I do not know how to set the path to compile the attached code.
My platform is Cygwin
gcc version 3.3.3
The boost_1_32_0 subdirectory resides in the Cygwin directory.
I tried the following,
g++ boost_1_32_0/boost/graph/sourcecode.cpp
and it displays the message
boost/config.hpp : No such file or directory
boost/graph/graph_traits.hpp : No such file or directory
boost/graph/adjacency_list.hpp : No such file or directory
boost/graph/dijkstra_shortest_paths.hpp : No such file or directory
followed by more error messages. Please refer to the attached code and help me out.
Thanks in advance.
Sourcecode.cpp
******************************************************************************
#include
#include <iostream>
#include <fstream>
#include <string>
#include
#include
#include
using namespace boost;
float maximum(float a[], float mx, int n){
float max=mx;
for(int i=0; i > graph_t;
typedef graph_traits < graph_t >::vertex_descriptor vertex_descriptor;
typedef graph_traits < graph_t >::edge_descriptor edge_descriptor;
typedef std::pair Edge;
std::ifstream INF1 ("./data/None.conversion");
std::ifstream INF2 ("./data/None.before");
if(!INF1){
std::cerr << "Cannot find INF1 file." << std::endl;
return EXIT_FAILURE;
}
if(!INF2){
std::cerr << "Cannot find INF2 file." << std::endl;
return EXIT_FAILURE;
}
//read data
i=0;
while(INF1 >> num_nodes >> node[i]){
++i;
}
INF1.close();
num_nodes=i;
i=0;
while(INF2 >> p1[i] >> p2[i] >> wt[i]){
wt[i]=1.0;
++i;
}
INF2.close();
num_PPIs=i;
//
Edge edge_array[num_PPIs];
for(i=0; i::type weightmap = get(edge_weight, g);
std::vector p(num_vertices(g));
std::vector<float> d(num_vertices(g));
//
l1=0;
l2=0;
dia=0;
for(j=1; j 10000){ //set non-connecting node to zero distance
d[j]=0;
}
path[j]=d[j];
pl[int(d[j]+0.5)]=pl[int(d[j]+0.5)]+1;
}
dia=maximum(path,dia,num_nodes);
}
for(l=1; l<=int(dia); ++l){
l1=l1+pl[l]*l;
l2=l2+pl[l];
}
apl=float(l1)/float(l2);
std::cout << " " << apl << " " << l1 << " " << l2 << " " << dia << std::endl;
return EXIT_SUCCESS;
}
**********************************************************************************
Cheers
Grek
---------------------------------
Do you Yahoo!?
Yahoo! Search presents - Jib Jab's 'Second Term'