Go to the documentation of this file.
14 #if !defined(GEOGRAPHICLIB_HAVE_BOOST_SERIALIZATION)
15 #define GEOGRAPHICLIB_HAVE_BOOST_SERIALIZATION 0
18 #if GEOGRAPHICLIB_HAVE_BOOST_SERIALIZATION
20 #include <boost/archive/xml_iarchive.hpp>
21 #include <boost/archive/xml_oarchive.hpp>
60 ifstream is(
"locations.txt");
63 while (is >> sa >> sb) {
64 DMS::DecodeLatLon(sa, sb,
lat,
lon);
79 #if GEOGRAPHICLIB_HAVE_BOOST_SERIALIZATION
80 ifstream is(
"pointset.xml");
82 boost::archive::xml_iarchive ia(is);
83 ia >> BOOST_SERIALIZATION_NVP(pointset);
86 ifstream is(
"pointset.txt");
92 if (pointset.
NumPoints() !=
int(locs.size())) {
96 #if GEOGRAPHICLIB_HAVE_BOOST_SERIALIZATION
97 ofstream
os(
"pointset.xml");
100 boost::archive::xml_oarchive oa(
os);
101 oa << BOOST_SERIALIZATION_NVP(pointset);
103 ofstream
os(
"pointset.txt");
106 os << pointset <<
"\n";
110 ifstream is(
"queries.txt");
114 while (is >> sa >> sb) {
116 DMS::DecodeLatLon(sa, sb,
lat,
lon);
120 cout << k[0] <<
" " <<
d <<
"\n";
122 int setupcost, numsearches, searchcost, mincost, maxcost;
124 pointset.
Statistics(setupcost, numsearches, searchcost,
125 mincost, maxcost,
mean,
sd);
127 totcost = setupcost + searchcost,
128 exhaustivecost = count * pointset.
NumPoints();
130 <<
"Number of distance calculations = " << totcost <<
"\n"
131 <<
"With an exhaustive search = " << exhaustivecost <<
"\n"
132 <<
"Ratio = " << double(totcost) / exhaustivecost <<
"\n"
133 <<
"Efficiency improvement = "
134 << 100 * (1 - double(totcost) / exhaustivecost) <<
"%\n";
136 catch (
const exception&
e) {
137 cerr <<
"Caught exception: " <<
e.what() <<
"\n";
pos(double lat=0, double lon=0)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const double d[K][N]
Namespace for GeographicLib.
Math::real Inverse(real lat1, real lon1, real lat2, real lon2, real &s12, real &azi1, real &azi2, real &m12, real &M12, real &M21, real &S12) const
dist_t Search(const std::vector< pos_t > &pts, const distfun_t &dist, const pos_t &query, std::vector< int > &ind, int k=1, dist_t maxdist=std::numeric_limits< dist_t >::max(), dist_t mindist=-1, bool exhaustive=true, dist_t tol=0) const
ofstream os("timeSchurFactors.csv")
Exception handling for GeographicLib.
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
Nearest-neighbor calculations.
DistanceCalculator(const Geodesic &geod)
Double_ distance(const OrientedPlane3_ &p)
static const Vector2 mean(20, 40)
void Statistics(int &setupcost, int &numsearches, int &searchcost, int &mincost, int &maxcost, double &mean, double &sd) const
void Initialize(const std::vector< pos_t > &pts, const distfun_t &dist, int bucket=4)
Header for GeographicLib::DMS class.
Header for GeographicLib::NearestNeighbor class.
Header for GeographicLib::Geodesic class.
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:16