75 int minDim = numeric_limits<int>::max();
76 for (HyperGraph::VertexSet::const_iterator it = vertices.begin();
77 it != vertices.end(); ++it) {
80 maxDim = (std::max)(vdim, maxDim);
81 minDim = (std::min)(vdim, minDim);
85 if (extension.size() == 0) extension =
"dat";
89 bool hasOdomEdge =
false;
90 bool hasLandmarkEdge =
false;
91 for (HyperGraph::EdgeSet::const_iterator it = edges.begin();
92 it != edges.end(); ++it) {
98 hasLandmarkEdge =
true;
100 if (hasOdomEdge && hasLandmarkEdge)
break;
103 bool fileStatus =
true;
105 string odomFilename = baseFilename +
"_odom_edges." + extension;
106 cerr <<
"# saving " << odomFilename <<
" ... ";
107 ofstream fout(odomFilename.c_str());
109 cerr <<
"Unable to open file" << endl;
115 for (HyperGraph::EdgeSet::const_iterator it = edges.begin();
116 it != edges.end(); ++it) {
120 (*saveGnuplot)(e, ¶ms);
122 cerr <<
"done." << endl;
125 if (hasLandmarkEdge) {
126 string filename = baseFilename +
"_landmarks_edges." + extension;
127 cerr <<
"# saving " << filename <<
" ... ";
128 ofstream fout(filename.c_str());
130 cerr <<
"Unable to open file" << endl;
136 for (HyperGraph::EdgeSet::const_iterator it = edges.begin();
137 it != edges.end(); ++it) {
140 (*saveGnuplot)(e, ¶ms);
142 cerr <<
"done." << endl;
146 string filename = baseFilename +
"_edges." + extension;
147 cerr <<
"# saving " << filename <<
" ... ";
148 ofstream fout(filename.c_str());
150 cerr <<
"Unable to open file" << endl;
156 for (HyperGraph::EdgeSet::const_iterator it = edges.begin();
157 it != edges.end(); ++it) {
159 (*saveGnuplot)(e, ¶ms);
161 cerr <<
"done." << endl;
165 string filename = baseFilename +
"_vertices." + extension;
166 cerr <<
"# saving " << filename <<
" ... ";
167 ofstream fout(filename.c_str());
169 cerr <<
"Unable to open file" << endl;
174 for (HyperGraph::VertexSet::const_iterator it = vertices.begin();
175 it != vertices.end(); ++it) {
177 (*saveGnuplot)(v, ¶ms);
179 cerr <<
"done." << endl;