diff --git a/gtsam.h b/gtsam.h index 6b5d22ec9..de4c1381d 100644 --- a/gtsam.h +++ b/gtsam.h @@ -563,15 +563,15 @@ virtual class Pose3 : gtsam::Value { void serialize() const; }; -#include -virtual class Sphere2 : gtsam::Value { +#include +virtual class Unit3 : gtsam::Value { // Standard Constructors - Sphere2(); - Sphere2(const gtsam::Point3& pose); + Unit3(); + Unit3(const gtsam::Point3& pose); // Testable void print(string s) const; - bool equals(const gtsam::Sphere2& pose, double tol) const; + bool equals(const gtsam::Unit3& pose, double tol) const; // Other functionality Matrix basis() const; @@ -580,14 +580,14 @@ virtual class Sphere2 : gtsam::Value { // Manifold static size_t Dim(); size_t dim() const; - gtsam::Sphere2 retract(Vector v) const; - Vector localCoordinates(const gtsam::Sphere2& s) const; + gtsam::Unit3 retract(Vector v) const; + Vector localCoordinates(const gtsam::Unit3& s) const; }; #include virtual class EssentialMatrix : gtsam::Value { // Standard Constructors - EssentialMatrix(const gtsam::Rot3& aRb, const gtsam::Sphere2& aTb); + EssentialMatrix(const gtsam::Rot3& aRb, const gtsam::Unit3& aTb); // Testable void print(string s) const; @@ -601,7 +601,7 @@ virtual class EssentialMatrix : gtsam::Value { // Other methods: gtsam::Rot3 rotation() const; - gtsam::Sphere2 direction() const; + gtsam::Unit3 direction() const; Matrix matrix() const; double error(Vector vA, Vector vB); }; diff --git a/gtsam/3rdparty/CMakeLists.txt b/gtsam/3rdparty/CMakeLists.txt index 3fb5cf185..799ea46c7 100644 --- a/gtsam/3rdparty/CMakeLists.txt +++ b/gtsam/3rdparty/CMakeLists.txt @@ -24,3 +24,5 @@ if(NOT GTSAM_USE_SYSTEM_EIGEN) DESTINATION include/gtsam/3rdparty/Eigen FILES_MATCHING PATTERN "*.h") endif() + +add_subdirectory(GeographicLib) diff --git a/gtsam/3rdparty/GeographicLib/00README.txt b/gtsam/3rdparty/GeographicLib/00README.txt new file mode 100644 index 000000000..47ef4b8fb --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/00README.txt @@ -0,0 +1,143 @@ +A library for geographic projections. + +Written by Charles Karney and licensed under +the MIT/X11 License. For more information, see + + http://geographiclib.sourceforge.net/ + +Files + + 00README.txt -- this file + AUTHORS -- the authors of the library + LICENSE.txt -- the MIT/X11 License + INSTALL -- brief installation instructions + NEWS -- a history of changes + + include/GeographicLib/ and src/ + Config.h.in, Config.h -- system dependent configuration + Constants.hpp -- WGS84 constants + Math.hpp -- math routines + Utility.hpp -- I/O and date routines + Accumulator.[ch]pp -- quad precision adder + PolarStereographic.[ch]pp -- polar stereographic projection + TransverseMercator.[ch]pp -- transverse Mercator projection + UTMUPS.[ch]pp -- UTM and UPS + MGRS.[ch]pp -- MGRS + TransverseMercatorExact.[ch]pp -- exact TM projection + EllipticFunction.[ch]pp -- elliptic functions + GeoCoords.[ch]pp -- hold geographic location + DMS.[ch]pp -- handle degrees minutes seconds + Geocentric.[ch]pp -- geocentric coordinates + LocalCartesian.[ch]pp -- local cartesian coordinates + Geodesic.[ch]pp -- geodesic calculations + GeodesicLine.[ch]pp -- calculations on a single geodesic + PolygonArea.[ch]pp -- polygon area + AzimuthalEquidistant.[ch]pp -- azimuthal equidistant projection + Gnomonic.[ch]pp -- gnomonic projection + CassiniSoldner.[ch]pp -- Cassini-Soldner equidistant projection + Geoid.[ch]pp -- geoid heights + Gravity{Model,Circle}.[ch]pp -- gravity models + Magnetic{Model,Circle}.[ch]pp -- geomagentic models + {Spherical,Circular}Engine.[ch]pp -- spherical harmonic sums + SphericalHarmonic{,1,2}.hpp -- frontend for spherical harmonics + LambertConformalConic.[ch]pp -- Lambert conformal conic projection + AlbersEqualArea.[ch]pp -- Albers equal area projection + Gnomonic.[ch]pp -- Ellipsoidal gnomonic projection + OSGB.[ch]pp -- Ordnance Survey grid system + Geohash.[ch]pp -- conversions for geohashes + Ellipsoid.[ch]pp -- ellipsoid properties + + examples/ + example-*.cpp -- simple usage examples for all the classes + GeoidToGTX.cpp -- a parallelization example + + tools/ + GeoConvert.cpp -- geographic conversion utility + TransverseMercatorTest.cpp -- TM tester + GeodSolve.cpp -- geodesic utility + CartConvert.cpp -- convert to geocentric and local cartesian + EquidistantTest.cpp -- exercise AzimuthalEquidistant and CassiniSoldner + GeoidEval.cpp -- evaluate geoid heights + Gravity.cpp -- evaluate gravity + MagneticField.cpp -- evaluate magnetic field + Planimeter.cpp -- computer polygon areas + geographiclib-get-geoids -- download geoid datasets + geographiclib-get-magnetic -- download geomagnetic models + + windows/ + GeographicLib-vc9.sln -- MS Studio 2008 solution + Geographic-vc9.vcproj -- project for library + GeoConvert-vc9.vcproj -- project for GeoConvert + TransverseMercatorTest-vc9.vcproj -- project for TransverseMercatorTest + Geod-vc9.vcproj -- project for Geod + Planimeter-vc9.vcproj -- project for Planimeter + CartConvert-vc9.vcproj -- project for CartConvert + EquidistantTest-vc9.vcproj -- project for EquidistantTest + GeoidEval-vc9.vcproj -- project for GeoidEval + Gravity-vc9.vcproj -- project for Gravity + MagneticField-vc9.vcproj -- project for MagneticField + also files for MS Studio 2005 (with vc8) + also files for MS Studio 2010 (with vc10) + NETGeographic-vc10.vcxproj -- project for .NET wrapper + + maxima/ + tm.mac -- Maxima code for high precision TM + ellint.mac -- Maxima code for elliptic functions needed by tm.mac + tmseries.mac -- Maxima code for series approximations for TM + geod.mac -- Maxima code for series approximations for Geodesic + geodesic.mac -- Maxima code for geodesic problems + + matlab/ + geographiclibinterface.m -- Matlab code to compile Matlab interfaces + utmupsforward.{cpp,m} -- Matlab code to convert geographic to UTM/UPS + utmupsreverse.{cpp,m} -- Matlab code to convert UTM/UPS to geographic + mgrsforward.{cpp,m} -- Matlab code to convert UTM/UPS to MGRS + mgrsreverse.{cpp,m} -- Matlab code to convert MGRS to UTM/UPS + geodesicdirect.{cpp,m} -- Matlab code for the direct geodesic problem + geodesicinverse.{cpp,m} -- Matlab code for the inverse geodesic problem + geodesicline.{cpp,m} -- Matlab code for geodesic lines + geoidheight.{cpp,m} -- Matlab code to look up geoid heights + polygonarea.{cpp,m} -- Matlab code for polygon areas + geoddoc.m -- documentation for native Matlab geodesic routines + geodreckon.m -- native Matlab implementation of direct geodesic problem + geoddistance.m -- native Matlab implementation of inverse geodesic problem + geodarea.m -- native Matlab implementation of polygon area + defaultellipsoid.m, ecc2flat.m, flat2ecc.m -- auxiliary functions + geodproj.m -- documentation for geodesic projections + *_{fwd,inv}.m -- native Matlab implementation of geodesic projections + private/*.m -- internal functions for geodesic routines + + doc/ + doxyfile.in -- Doxygen config file + Geographic.dox -- main page of Doxygen documentation + geodseries30.html -- geodesic series to 30th order + tmseries30.html -- transverse Mercator series to 30th order + html/* -- directory with built documentation + scripts/*.html -- demonstrations of the JavaScript interface + scripts/GeographicLib/*.js -- JavaScript implementation of geodesics + + man/ + *.pod -- plain old documentation + *.1 -- man pages in nroff format + *.1.html -- man pages in html format + *.usage -- documentation for incorporation into executables + + python/GeographicLib/*.py -- Python implementation of geodesic routines + + java/.../*.java -- Java implementation of geodesic routines + + dotnet/NETGeographicLib/*.{cpp,h} -- .NET wrapper for GeographicLib + dotnet/examples/CS/*.cs -- simple C# examples for each class + dotnet/examples/ManagedCPP/*.cpp -- Managed C++ examples for each class + dotnet/examples/VB/*.vb -- simple Visual Basic examples for each class + dotnet/Projection/* -- a more complex C# application + + legacy/C/* -- C implementation of geodesic routines + legacy/Fortran/* -- Fortran implementation of geodesic routines + + Makefile.mk -- Unix/Linux makefiles + configure -- autoconf configuration script + CMakeLists.txt -- cmake configuration files + cmake/ + FindGeographicLib.cmake -- cmake find script + *.cmake.in -- cmake config templates diff --git a/gtsam/3rdparty/GeographicLib/AUTHORS b/gtsam/3rdparty/GeographicLib/AUTHORS new file mode 100644 index 000000000..01c69972b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/AUTHORS @@ -0,0 +1,6 @@ +Charles Karney +Francesco Paolo Lovergine (autoconfiscation) +Mathieu Peyréga (help with gravity models) +Andrew MacIntyre (python/setup.py) +Skip Breidbach (maven support for Java) +Scott Heiman (.NET wrappers + C# examples) diff --git a/gtsam/3rdparty/GeographicLib/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/CMakeLists.txt new file mode 100644 index 000000000..f90893d23 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/CMakeLists.txt @@ -0,0 +1,489 @@ +project (GeographicLib) + +# Version information +set (PROJECT_VERSION_MAJOR 1) +set (PROJECT_VERSION_MINOR 34) +set (PROJECT_VERSION_PATCH 0) +set (PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +if (PROJECT_VERSION_PATCH GREATER 0) + set (PROJECT_VERSION "${PROJECT_VERSION}.${PROJECT_VERSION_PATCH}") +endif () + +set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) +set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) +set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + +# The library version tracks the numbering given by libtool in the +# autoconf set up. +set (LIBVERSION 10) +set (LIBVERSIONFULL 10.1.1) +string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER) +string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER) + +cmake_minimum_required (VERSION 2.8.4) # This version was released 2011-02-16 + +# User-settable variables + +# (1) COMMON_INSTALL_PATH governs the installation convention. If it +# is on ON (the Linux default), the installation is to a common +# directory, e.g., /usr/local. If it is OFF (the Windows default), +# the installation directory contains the package name, e.g., +# c:/pkg/GeographicLib-1.22. The installation directories for the +# documentation, cmake configuration, python and matlab interfaces all +# depend on the variable with deeper paths relative to +# CMAKE_INSTALL_PREFIX being used when it's ON. + +if (WIN32) + option (COMMON_INSTALL_PATH "Use a common installation path for packages" OFF) +else () + option (COMMON_INSTALL_PATH "Use a common installation path for packages" ON) +endif () + +# The use of PACKAGE_PATH and INSTALL_PATH is now DEPRECATED. +# (2) PACKAGE_PATH and INSTALL_PATH govern the find_package search +# path and the installation directory. (find_package is not used by +# GeographicLib since it doesn't depend on other packages. However +# PACKAGE_PATH is used here for uniformity with other packages which +# adopt the same conventions.) +# +# If PACKAGE_PATH is defined, it is prepended to CMAKE_PREFIX_PATH. +# +# If INSTALL_PATH is not specified but PACKAGE_PATH is, then +# INSTALL_PATH is set to +# ${PACKAGE_PATH}, if COMMON_INSTALL_PATH is ON; +# ${PACKAGE_PATH}/${PROJECT_NAME}-${PROJECT_VERSION}, otherwise. +# +# If INSTALL_PATH is now defined, then set CMAKE_INSTALL_PREFIX to +# INSTALL_PATH. +# +# Typically, only PACKAGE_PATH needs to be specified, e.g., +# cmake -D PACKAGE_PATH=/opt .. (on Linux) +# => CMAKE_PREFIX_PATH=/opt CMAKE_INSTALL_PREFIX=/opt +# cmake -D PACKAGE_PATH=C:/pkg .. (on Windows) +# => CMAKE_PREFIX_PATH=C:/pkg CMAKE_INSTALL_PREFIX=C:/pkg/GeographicLib-1.22 + +if (PACKAGE_PATH) + set (CMAKE_PREFIX_PATH ${PACKAGE_PATH} ${CMAKE_PREFIX_PATH}) + message (STATUS "CMAKE_PREFIX_PATH set to ${CMAKE_PREFIX_PATH}") +endif () + +if (NOT INSTALL_PATH AND PACKAGE_PATH) + if (COMMON_INSTALL_PATH) + set (INSTALL_PATH ${PACKAGE_PATH} CACHE PATH "Installation directory" FORCE) + else () + set (INSTALL_PATH ${PACKAGE_PATH}/${PROJECT_NAME}-${PROJECT_VERSION} + CACHE PATH "Installation directory" FORCE) + endif () +endif () +if (INSTALL_PATH) + file (TO_CMAKE_PATH ${INSTALL_PATH} CMAKE_INSTALL_PREFIX) + message (STATUS "CMAKE_INSTALL_PREFIX set to ${CMAKE_INSTALL_PREFIX}") +endif () + +# (3) Where to look for data files. Various classes look in the geoids, +# gravity, magnetic, subdirectories of ${GEOGRAPHICLIB_DATA}. +if (WIN32) + # The binary installers for the data files for Windows are created + # with Inno Setup which uses {commonappdata}. On most Windows + # systems this is + # "C:/Documents and Settings/All Users/Application Data", while on + # newer systems (Windows 7), it is C:/ProgramData. However the + # longer name "works" on all Windows systems. + set (GEOGRAPHICLIB_DATA + "C:/Documents and Settings/All Users/Application Data/GeographicLib" + CACHE PATH "Location for data for GeographicLib") +else () + set (GEOGRAPHICLIB_DATA + "/usr/local/share/GeographicLib" + CACHE PATH "Location for data for GeographicLib") +endif () + +# (4) Build which libraries? Possible values are SHARED, STATIC, BOTH. +if (MSVC) + set (GEOGRAPHICLIB_LIB_TYPE STATIC CACHE STRING + "Types of library generated: SHARED, STATIC (default), or BOTH") +else () + set (GEOGRAPHICLIB_LIB_TYPE SHARED CACHE STRING + "Types of library generated: SHARED (default), STATIC, or BOTH") +endif () +set_property (CACHE GEOGRAPHICLIB_LIB_TYPE + PROPERTY STRINGS "SHARED" "STATIC" "BOTH") + +if (GEOGRAPHICLIB_LIB_TYPE STREQUAL "BOTH") + set (GEOGRAPHICLIB_SHARED_LIB ON) + set (GEOGRAPHICLIB_STATIC_LIB ON) + set (GEOGRAPHICLIB_LIB_TYPE_VAL 2) +elseif (GEOGRAPHICLIB_LIB_TYPE STREQUAL "SHARED") + set (GEOGRAPHICLIB_SHARED_LIB ON) + set (GEOGRAPHICLIB_STATIC_LIB OFF) + set (GEOGRAPHICLIB_LIB_TYPE_VAL 1) +elseif (GEOGRAPHICLIB_LIB_TYPE STREQUAL "STATIC") + set (GEOGRAPHICLIB_SHARED_LIB OFF) + set (GEOGRAPHICLIB_STATIC_LIB ON) + set (GEOGRAPHICLIB_LIB_TYPE_VAL 0) +else () + message (FATAL_ERROR + "Bad value of GEOGRAPHICLIB_LIB_TYPE, \"${GEOGRAPHICLIB_LIB_TYPE}\" " + "(should be SHARED, STATIC or BOTH)") +endif () + +if (GEOGRAPHICLIB_STATIC_LIB) + set (PROJECT_STATIC_LIBRARIES GeographicLib_STATIC) + set (PROJECT_STATIC_DEFINITIONS -DGEOGRAPHICLIB_SHARED_LIB=0) +else () + set (PROJECT_STATIC_LIBRARIES) + set (PROJECT_STATIC_DEFINITIONS) +endif () + +if (GEOGRAPHICLIB_SHARED_LIB) + set (PROJECT_SHARED_LIBRARIES GeographicLib) + set (PROJECT_LIBRARIES ${PROJECT_SHARED_LIBRARIES}) + set (PROJECT_SHARED_DEFINITIONS -DGEOGRAPHICLIB_SHARED_LIB=1) + set (PROJECT_DEFINITIONS ${PROJECT_SHARED_DEFINITIONS}) +else () + set (PROJECT_SHARED_LIBRARIES) + set (PROJECT_LIBRARIES ${PROJECT_STATIC_LIBRARIES}) + set (PROJECT_SHARED_DEFINITIONS) + set (PROJECT_DEFINITIONS ${PROJECT_STATIC_DEFINITIONS}) +endif () + +# (5) Compile the Matlab interfaces? Skip Matlab compilation if OFF +set (MATLAB_COMPILER OFF CACHE STRING + "Compiler for matlab/octave interface: mex or mkoctfile or OFF") +set_property (CACHE MATLAB_COMPILER PROPERTY STRINGS "mex" "mkoctfile" OFF) + +# (6) Create the documentation? This depends on whether doxygen can be +# found. If this is OFF, then links will be provided to the online +# documentation on Sourceforge. +option (GEOGRAPHICLIB_DOCUMENTATION + "Use doxygen to create the documentation" OFF) + +# (7) Build .NET wrapper library NETGeographicLib. This only applies to +# Windows. Default is OFF, because, currently, most people don't use +# this interface. +option (BUILD_NETGEOGRAPHICLIB "Build NETGeographicLib library" OFF) + +# (8) Set the default "real" precision. This should probably be left +# at 2 (double). +set (GEOGRAPHICLIB_PRECISION 2 CACHE STRING + "Default real precision: 1 = float, 2 = double, 3 = long double") +set_property (CACHE GEOGRAPHICLIB_PRECISION PROPERTY STRINGS 1 2 3) + +# (9) When making a binary package, should we include the debug version +# of the library? This applies to MSVC only, because that's the +# platform where debug and release compilations do not inter-operate. +# It requires building as follows: +# cmake --build . --config Debug --target ALL_BUILD +# cmake --build . --config Release --target ALL_BUILD +# cmake --build . --config Release --target PACKAGE +option (PACKAGE_DEBUG_LIBS + "Include debug versions of library in binary package" OFF) + +set (LIBNAME Geographic) +if (MSVC OR CMAKE_CONFIGURATION_TYPES) + # For multi-config systems and for Visual Studio, the debug version of + # the library is called Geographic_d. + set (CMAKE_DEBUG_POSTFIX _d) +endif () + +if (NOT MSVC) + # Set the run time path for shared libraries for non-Windows machines. + # (1) include link path for external packages (not needed with + # GeographicLib because there are no external packages). + set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + # (2) include installed path for GeographicLib. + if (NOT APPLE) + # Use relative path so that package is relocatable + set (CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LIB_SUFFIX}") + else () + # Need absolute path with MacOSx + set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}") + endif () +endif () + +if (NOT CYGWIN) + # cygwin has a long double but the support for ::cbrtl etc is missing + include (CheckTypeSize) + check_type_size ("long double" LONG_DOUBLE BUILTIN_TYPES_ONLY) +endif () +include (TestBigEndian) +test_big_endian (WORDS_BIGENDIAN) + +# Create a Config.h to expose system information to the compiler +configure_file ( + include/GeographicLib/Config.h.in + include/GeographicLib/Config.h ) + +# The documentation depends on doxygen. Need version 1.8.1.2 or later +# for support of greek letters and math symbols. +if (GEOGRAPHICLIB_DOCUMENTATION) + set (DOXYGEN_SKIP_DOT ON) + find_package (Doxygen 1.8.1.2) + if (DOXYGEN_FOUND) + execute_process (COMMAND ${DOXYGEN_EXECUTABLE} --version + OUTPUT_VARIABLE DOXYGEN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) + if (DOXYGEN_VERSION VERSION_LESS 1.4.0) + set (DOXYGEN_FOUND FALSE) + message (STATUS "Doxygen version found, ${DOXYGEN_VERSION}, is too old") + endif () + endif () +endif () + +# The man pages are written as pod files and converted to nroff format, +# C++ code, and html. Because this require tools that may not be +# available on an end-user's system, the creation of the final +# documentation is therefore only done in "MAINTAINER" mode. The +# maintainer runs "make distrib-all" which installs the transformed +# documentation files into the source tree. +if (NOT WIN32 AND NOT APPLE) + find_program (HAVE_POD2MAN pod2man) + find_program (HAVE_POD2HTML pod2html) + find_program (HAVE_COL col) +endif () +if (HAVE_POD2MAN AND HAVE_POD2HTML AND HAVE_COL) + set (MAINTAINER ON) +else () + set (MAINTAINER OFF) +endif () +if (MAINTAINER) + add_custom_target (distrib-all) + add_dependencies (distrib-all distrib-man) +endif () + +# Look for the tool to compile the Matlab interfaces. +if (MATLAB_COMPILER) + if (WIN32) + set (MATLAB_COMPILER_EXT ".bat") + else () + set (MATLAB_COMPILER_EXT "") + endif () + find_program (MEX "${MATLAB_COMPILER}${MATLAB_COMPILER_EXT}") + if (MATLAB_COMPILER MATCHES "mex") + get_filename_component (MATLABDIR "${MEX}" REALPATH) + get_filename_component (MATLABDIR "${MATLABDIR}" PATH) + find_program (MEXEXTPROG "mexext${MATLAB_COMPILER_EXT}" + PATHS "${MATLABDIR}") + execute_process (COMMAND "${MEXEXTPROG}" + OUTPUT_VARIABLE MEXEXT OUTPUT_STRIP_TRAILING_WHITESPACE) + set (MEXOPTIONS "-largeArrayDims") + else () + set (MEXEXT "mex") + set (MEXOPTIONS "--mex") + endif () + if (NOT MSVC) + # mex files are shared objects => require static lib to be built with + # position independent code + set (CMAKE_POSITION_INDEPENDENT_CODE ON) + endif () + if (NOT MEX) + message (WARNING + "Cannot find Matlab compiler ${MATLAB_COMPILER}${MATLAB_COMPILER_EXT}") + elseif (NOT MEXEXT) + set (MEX OFF) + message (WARNING "Cannot determine extension for Matlab compiled code") + endif () +endif () + +# Set a default build type for single-configuration cmake generators if +# no build type is set. +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set (CMAKE_BUILD_TYPE Release) +endif () + +# Make the compiler more picky. +if (MSVC) + string (REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") +else () + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") + # check for C++11 support + include (CheckCXXCompilerFlag) + set (CXX11FLAG "-std=c++11") + check_cxx_compiler_flag (${CXX11FLAG} CXX11TEST1) + if (NOT CXX11TEST1) + set (CXX11FLAG "-std=c++0x") + check_cxx_compiler_flag (${CXX11FLAG} CXX11TEST2) + if (NOT CXX11TEST2) + unset (CXX11FLAG) + endif () + endif () + if (CXX11FLAG) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11FLAG}") + endif () +endif () + +if (APPLE) + if (CMAKE_SYSTEM_PROCESSOR MATCHES "i.86" OR + CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" OR + CMAKE_SYSTEM_PROCESSOR MATCHES "x86") + set (CMAKE_OSX_ARCHITECTURES "i386 -arch x86_64") + endif () +endif () + +# The list of tools (to be installed into, e.g., /usr/local/bin) +set (TOOLS CartConvert ConicProj GeodesicProj GeoConvert GeodSolve + GeoidEval Gravity MagneticField Planimeter TransverseMercatorProj) +# The list of scripts (to be installed into, e.g., /usr/local/sbin) +set (SCRIPTS + geographiclib-get-geoids geographiclib-get-gravity geographiclib-get-magnetic) + +set_property (GLOBAL PROPERTY USE_FOLDERS ON) + +# Set the include directories. Look in ${PROJECT_BINARY_DIR}/include +# first because that's where Config.h will be +include_directories ("${PROJECT_BINARY_DIR}/include" include) + +# The list of subdirectories to process +add_subdirectory (src) +add_subdirectory (include/GeographicLib) +add_subdirectory (tools) +add_subdirectory (man) +add_subdirectory (doc) +add_subdirectory (matlab) +add_subdirectory (python/geographiclib) +if (GEOGRAPHICLIB_PRECISION EQUAL 2) + # The examples assume double precision + add_subdirectory (examples) +endif () +if (BUILD_NETGEOGRAPHICLIB) + set (NETGEOGRAPHICLIB_LIBRARIES NETGeographicLib) + set (NETLIBNAME NETGeographic) + add_subdirectory (dotnet/NETGeographicLib) + if (GEOGRAPHICLIB_PRECISION EQUAL 2) + add_subdirectory (dotnet/examples/ManagedCPP) + endif () +endif () +add_subdirectory (cmake) +if (EXISTS ${PROJECT_SOURCE_DIR}/tests/CMakeLists.txt) + add_subdirectory (tests) +endif () + +# Packaging support; we deal with +# (1) a source distribution: cmake make a tar.gz file and the zip file +# is created from this. Only the maintainer can do this, because of +# the need to generate additional documentation files. +# (2) a binary distribution: code is included for Linux, Apple, and +# Windows, but only the Windows distribution has been exercised. + +# Need to ensure that system dlls get included in a binary distribution +if (NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) + # Visual Studio Express does include redistributable components so + # squelch the warning. + set (CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) +endif () +set (CMAKE_INSTALL_DEBUG_LIBRARIES ON) +include (InstallRequiredSystemLibraries) + +# The configuration of CPack is via variable that need to be set before +# the include (CPack). +set (CPACK_PACKAGE_CONTACT charles@karney.com) +set (CPACK_PACKAGE_VENDOR "GeographicLib") +set (CPACK_PACKAGE_DESCRIPTION_SUMMARY + "GeographicLib library, utilities, and documentation") +# The list of files to be excluded from the source distribution. +set (CPACK_SOURCE_IGNORE_FILES + "#" + "~\$" + "/\\\\.git" + "${PROJECT_SOURCE_DIR}/BUILD" + "${PROJECT_SOURCE_DIR}/(tests|testdata|cgi-bin|.*\\\\.cache)/" + "${PROJECT_SOURCE_DIR}/(distrib|.*-distrib|.*-installer|geodesic-papers)/" + "${PROJECT_SOURCE_DIR}/[^/]*\\\\.(html|kmz|pdf|xml)\$" + "${PROJECT_SOURCE_DIR}/(autogen|biblio|js-compress)\\\\.sh\$" + "${PROJECT_SOURCE_DIR}/(geodesic-biblio.txt|makefile-admin|[^/]*\\\\.png)\$" + "${PROJECT_SOURCE_DIR}/matlab/matlab-.*blurb.txt\$" ) +set (CPACK_SOURCE_GENERATOR TGZ) + +set (CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE.txt) +set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${PROJECT_VERSION}") +set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") + +if (WIN32) + # The Windows binary packager is NSIS. Set the necessary variables + # for this. + set (CPACK_NSIS_CONTACT "charles@karney.com") + set (CPACK_NSIS_URL_INFO_ABOUT "http://geographiclib.sf.net") + set (CPACK_NSIS_HELP_LINK "mailto:charles@karney.com") + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + # Hardcode the prefix for Visual Studio 10 + set (CPACK_NSIS_INSTALL_ROOT "C:\\\\pkg-vc10-x64") + set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}-win64") + set (CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} x64 ${PROJECT_VERSION}") + set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY + "${PROJECT_NAME}-x64-${PROJECT_VERSION}") + else () + # Hardcode the prefix for Visual Studio 10 + set (CPACK_NSIS_INSTALL_ROOT "C:\\\\pkg-vc10") + set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}-win32") + set (CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME} ${PROJECT_VERSION}") + set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY + "${PROJECT_NAME}-${PROJECT_VERSION}") + endif () + set (CPACK_NSIS_DISPLAY_NAME ${CPACK_NSIS_PACKAGE_NAME}) + set (CPACK_NSIS_MENU_LINKS + "http://geographiclib.sf.net/${PROJECT_VERSION}/index.html" + "Library documentation" + "http://geographiclib.sf.net/${PROJECT_VERSION}/utilities.html" + "Utilities documentation" + "http://geographiclib.sf.net" "GeographicLib home page" + "http://sf.net/projects/geographiclib/" "Main project page") + set (CPACK_NSIS_MODIFY_PATH ON) +elseif (APPLE) + # Not tested + set (CPACK_GENERATOR Bundle) + set (CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}-darwin") +else () + # Not tested + set (CPACK_GENERATOR TGZ) +endif () + +include (CPack) + +# Another maintainer-specific target is building the source distribution +# via the target dist. This calls package_source to make a tar.gz file. +# However this needs to be touched up to support the vanilla Makefiles +# provided with GeographicLib. This entails +# (1) creating Makefile (which includes Makefile.mk); +# (2) creating a bare-bones Config.h (with just the version information); +# (3) making sure that make thinks the generated documentation files are +# up-to-date. +# Then a new tar.gz file and zip file are created. To avoid potential +# problems with directory permissions, tar and zip are told only to +# archive the files. +if (MAINTAINER) + add_custom_target (dist + COMMAND ${CMAKE_MAKE_PROGRAM} package_source + COMMAND + cd _CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME} && + echo include Makefile.mk > Makefile && + sed -e "s/Unconfigured/${PROJECT_VERSION}/" + -e "s/MAJOR .*/MAJOR ${CPACK_PACKAGE_VERSION_MAJOR}/" + -e "s/MINOR .*/MINOR ${CPACK_PACKAGE_VERSION_MINOR}/" + -e "s/PATCH .*/PATCH ${CPACK_PACKAGE_VERSION_PATCH}/" + include/GeographicLib/Config.h > include/GeographicLib/Config.h.new && + mv include/GeographicLib/Config.h.new include/GeographicLib/Config.h + COMMAND + cd _CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME} && + touch man/[A-Za-z]*.usage man/[A-Za-z]*.1 man/[A-Za-z]*.1.html && + chmod -R g-w . + COMMAND + cd _CPack_Packages/Linux-Source/TGZ && + find ${CPACK_SOURCE_PACKAGE_FILE_NAME} -type f | + tar cfzT ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz - + COMMAND + rm -f ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.zip && + rsync -a --delete + _CPack_Packages/Linux-Source/TGZ/${CPACK_SOURCE_PACKAGE_FILE_NAME} + _CPack_Packages/Linux-Source/TGZ.DOS/ && + cd _CPack_Packages/Linux-Source/TGZ.DOS && + find . -type f | + egrep '/\(doxyfile.*\\.in|MANIFEST.in|NEWS|AUTHORS|INSTALL|pom\\.xml|dummy.*\\.in|.*\\.\(cpp|hpp|h\\.in|txt|pro|usage|pod|py|m|mac|cmake\\.in|cmake|h|js|c|for|dox|cs|vb|inc|java|html\\.in\)\)$$' | + xargs unix2dos -q -k && + find ${CPACK_SOURCE_PACKAGE_FILE_NAME} -type f | + zip -q ${CMAKE_BINARY_DIR}/${CPACK_SOURCE_PACKAGE_FILE_NAME}.zip -@ + ) + add_dependencies (dist distrib-all) +endif () + +# Add a test target; the tests are in tools. +enable_testing () diff --git a/gtsam/3rdparty/GeographicLib/INSTALL b/gtsam/3rdparty/GeographicLib/INSTALL new file mode 100644 index 000000000..f669d15f1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/INSTALL @@ -0,0 +1,3 @@ +For installation instructions, open + + http://geographiclib.sourceforge.net/html/install.html diff --git a/gtsam/3rdparty/GeographicLib/LICENSE.txt b/gtsam/3rdparty/GeographicLib/LICENSE.txt new file mode 100644 index 000000000..e70861b2a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/LICENSE.txt @@ -0,0 +1,23 @@ +This license applies to GeographicLib, versions 1.12 and later. + +Copyright (c) 2008-2013, Charles Karney + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/gtsam/3rdparty/GeographicLib/Makefile b/gtsam/3rdparty/GeographicLib/Makefile new file mode 100644 index 000000000..c7745fa8c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/Makefile @@ -0,0 +1 @@ +include Makefile.mk diff --git a/gtsam/3rdparty/GeographicLib/Makefile.am b/gtsam/3rdparty/GeographicLib/Makefile.am new file mode 100644 index 000000000..4008b07b8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/Makefile.am @@ -0,0 +1,51 @@ +# +# Makefile.am +# +# Copyright (C) 2009, Francesco P. Lovergine + +AUTOMAKE_OPTIONS = foreign + +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = src man tools doc include matlab python cmake examples + +EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL \ + Makefile.mk CMakeLists.txt windows maxima doc legacy java dotnet + +dist-hook: + rm -rf $(distdir)/doc/html $(distdir)/doc/manpages ; \ + find $(distdir)/maxima -type f -name '*.lsp' | xargs rm -rf ; \ + rm -rf $(distdir)/java/targets ; \ + find $(distdir)/java -type f -name '*.class' | xargs rm -rf ; \ + find $(distdir)/windows -mindepth 1 -type d | xargs rm -rf ; \ + find $(distdir)/windows -type f \ + ! \( -name '*.sln' -o -name '*.vc*proj' -o -name '*.mk' \)| \ + xargs rm -f ; \ + find $(distdir) \ + \( -name .svn -o -name '.git*' -o -name CVS -o -name Makefile -o -name '*~' -o -name '*#*' -o -name 'CMakeFiles' -o -name '*.log' -o -name '*.tmp' -o -name '*.pyc' -o -name '*.bak' -o -name '*.BAK' -o -name geographiclib.js \)| \ + xargs rm -rf ; \ + echo include Makefile.mk > $(distdir)/Makefile ; \ + sed -e "s/Unconfigured/$(PACKAGE_VERSION)/" \ + -e "s/MAJOR .*/MAJOR ${GEOGRAPHICLIB_VERSION_MAJOR}/" \ + -e "s/MINOR .*/MINOR ${GEOGRAPHICLIB_VERSION_MINOR}/" \ + -e "s/PATCH .*/PATCH ${GEOGRAPHICLIB_VERSION_PATCH}/" \ + $(top_srcdir)/include/GeographicLib/Config.h > \ + $(distdir)/include/GeographicLib/Config.h +# Custom rules + +all-local: man doc +install-data-local: install-doc # install-matlab + +doc: man + $(MAKE) -C doc doc + +install-doc: + $(MAKE) -C doc install-doc + +man: + $(MAKE) -C man man + +# install-matlab: +# $(MAKE) -C matlab install-matlab + +.PHONY: doc install-doc man install-matlab install-python diff --git a/gtsam/3rdparty/GeographicLib/Makefile.in b/gtsam/3rdparty/GeographicLib/Makefile.in new file mode 100644 index 000000000..44520c36c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/Makefile.in @@ -0,0 +1,832 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile.am +# +# Copyright (C) 2009, Francesco P. Lovergine +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = . +DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure \ + $(top_srcdir)/include/GeographicLib/Config-ac.h.in AUTHORS \ + INSTALL NEWS config.guess config.sub depcomp install-sh \ + ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/GeographicLib/Config-ac.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + cscope distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COL = @COL@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GEOGRAPHICLIB_VERSION_MAJOR = @GEOGRAPHICLIB_VERSION_MAJOR@ +GEOGRAPHICLIB_VERSION_MINOR = @GEOGRAPHICLIB_VERSION_MINOR@ +GEOGRAPHICLIB_VERSION_PATCH = @GEOGRAPHICLIB_VERSION_PATCH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POD2HTML = @POD2HTML@ +POD2MAN = @POD2MAN@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 +SUBDIRS = src man tools doc include matlab python cmake examples +EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL \ + Makefile.mk CMakeLists.txt windows maxima doc legacy java dotnet + +all: all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +include/GeographicLib/Config-ac.h: include/GeographicLib/stamp-h1 + @if test ! -f $@; then rm -f include/GeographicLib/stamp-h1; else :; fi + @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) include/GeographicLib/stamp-h1; else :; fi + +include/GeographicLib/stamp-h1: $(top_srcdir)/include/GeographicLib/Config-ac.h.in $(top_builddir)/config.status + @rm -f include/GeographicLib/stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status include/GeographicLib/Config-ac.h +$(top_srcdir)/include/GeographicLib/Config-ac.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f include/GeographicLib/stamp-h1 + touch $@ + +distclean-hdr: + -rm -f include/GeographicLib/Config-ac.h include/GeographicLib/stamp-h1 + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done +cscopelist-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) + +clean-cscope: + -rm -f cscope.files + +cscope.files: clean-cscope cscopelist-recursive cscopelist + +cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod u+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile all-local +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr \ + distclean-libtool distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ + cscopelist-recursive ctags-recursive install-am install-strip \ + tags-recursive + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am all-local am--refresh check check-am clean \ + clean-cscope clean-generic clean-libtool cscope cscopelist \ + cscopelist-recursive ctags ctags-recursive dist dist-all \ + dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am + + +dist-hook: + rm -rf $(distdir)/doc/html $(distdir)/doc/manpages ; \ + find $(distdir)/maxima -type f -name '*.lsp' | xargs rm -rf ; \ + rm -rf $(distdir)/java/targets ; \ + find $(distdir)/java -type f -name '*.class' | xargs rm -rf ; \ + find $(distdir)/windows -mindepth 1 -type d | xargs rm -rf ; \ + find $(distdir)/windows -type f \ + ! \( -name '*.sln' -o -name '*.vc*proj' -o -name '*.mk' \)| \ + xargs rm -f ; \ + find $(distdir) \ + \( -name .svn -o -name '.git*' -o -name CVS -o -name Makefile -o -name '*~' -o -name '*#*' -o -name 'CMakeFiles' -o -name '*.log' -o -name '*.tmp' -o -name '*.pyc' -o -name '*.bak' -o -name '*.BAK' -o -name geographiclib.js \)| \ + xargs rm -rf ; \ + echo include Makefile.mk > $(distdir)/Makefile ; \ + sed -e "s/Unconfigured/$(PACKAGE_VERSION)/" \ + -e "s/MAJOR .*/MAJOR ${GEOGRAPHICLIB_VERSION_MAJOR}/" \ + -e "s/MINOR .*/MINOR ${GEOGRAPHICLIB_VERSION_MINOR}/" \ + -e "s/PATCH .*/PATCH ${GEOGRAPHICLIB_VERSION_PATCH}/" \ + $(top_srcdir)/include/GeographicLib/Config.h > \ + $(distdir)/include/GeographicLib/Config.h +# Custom rules + +all-local: man doc +install-data-local: install-doc # install-matlab + +doc: man + $(MAKE) -C doc doc + +install-doc: + $(MAKE) -C doc install-doc + +man: + $(MAKE) -C man man + +# install-matlab: +# $(MAKE) -C matlab install-matlab + +.PHONY: doc install-doc man install-matlab install-python + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gtsam/3rdparty/GeographicLib/Makefile.mk b/gtsam/3rdparty/GeographicLib/Makefile.mk new file mode 100644 index 000000000..e9d2b6368 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/Makefile.mk @@ -0,0 +1,51 @@ +MAKEFILE := $(lastword $(MAKEFILE_LIST)) +MAKE := $(MAKE) -f $(MAKEFILE) +SUBDIRS = src man tools doc +ALLDIRS = include $(SUBDIRS) maxima matlab python cmake + +all: src man tools + +$(SUBDIRS): + $(MAKE) -C $@ + +tools: src +install: install-headers install-lib install-tools install-man install-cmake \ + install-doc install-matlab install-python +clean: clean-src clean-tools clean-doc clean-man clean-matlab clean-python + +install-headers: + $(MAKE) -C include install +install-lib: + $(MAKE) -C src install +install-tools: src + $(MAKE) -C tools install +install-cmake: + $(MAKE) -C cmake install +install-doc: doc + $(MAKE) -C doc install +install-man: man + $(MAKE) -C man install +install-matlab: matlab + $(MAKE) -C matlab install +install-python: python + $(MAKE) -C python install +clean-src: + $(MAKE) -C src clean +clean-tools: + $(MAKE) -C tools clean +clean-doc: + $(MAKE) -C doc clean +clean-man: + $(MAKE) -C man clean +clean-matlab: matlab + $(MAKE) -C matlab clean +clean-python: python + $(MAKE) -C python clean + +VERSION:=$(shell grep '\bVERSION=' configure | cut -f2 -d\' | head -1) + +.PHONY: all $(SUBDIRS) install \ + install-headers install-lib install-tools install-cmake install-man \ + install-matlab install-python \ + clean clean-src clean-tools clean-doc clean-man clean-matlab \ + clean-python diff --git a/gtsam/3rdparty/GeographicLib/NEWS b/gtsam/3rdparty/GeographicLib/NEWS new file mode 100644 index 000000000..1d5614ce7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/NEWS @@ -0,0 +1,886 @@ +A reverse chronological list of changes to GeographicLib + +For more information, see + + http://geographiclib.sourceforge.net/ + +The current version of the library is 1.34. + +Changes between 1.34 (released 2013-12-11) and 1.33 versions: + + * Many changes in cmake support: + + minimum version of cmake needed increased to 2.8.4 (which was + released in 2011-02); + + allow building both shared and static librarys with + -D GEOGRAPHICLIB_LIB_TYPE=BOTH; + + both shared and static libraries (Release plus Debug) included in + binary installer; + + find_package uses COMPONENTS and GeographicLib_USE_STATIC_LIBS to + select the library to use; + + find_package version checking allows nmake and Visual Studio + generators to interoperate on Windows; + + find_package (GeographicLib ...) requires that GeographicLib be + capitalized correctly; + + on Unix/Linux, don't include the version number in directory for + the cmake configuration files; + + defaults for GEOGRAPHICLIB_DOCUMENTATION and + BUILD_NETGEOGRAPHICLIB are now OFF; + + the GEOGRAPHICLIB_EXAMPLES configuration parameter is no longer + used; cmake always configures to build the examples, but they are + not built by default (instead build targets: exampleprograms and + netexamples); + + matlab-all target renamed to matlabinterface; + + the configuration parameters PACKAGE_PATH and INSTALL_PATH are + now deprecated (use CMAKE_INSTALL_PREFIX instead); + + on Linux, the installed package is relocatable; + + on MacOSX, the installed utilities can find the shared library. + + * Use a more precise value for OSGB::CentralScale(). + + * Add Arc routines to python interface. + + * The Geod utility has been removed; the same functionality lives on + with GeodSolve (introduced in version 1.30). + +Changes between 1.33 (released 2013-10-08) and 1.32 versions: + + * Add NETGeographic .NET wrapper library (courtesy of Scott Heiman). + + * Make inspector functions in GeographicLib::Ellipsoid const. + + * Add Accumulator.cpp to instantiate GeographicLib::Accumulator. + + * Defer some of the initialization of GeographicLib::OSGB to when it + is first called. + + * Fix bug in autoconf builds under MacOS. + +Changes between 1.32 (released 2013-07-12) and 1.31 versions: + + * Generalize C interface for polygon areas to allow vertices to be + specified incrementally. + + * Fix way flags for C++11 support are determined. + +Changes between 1.31 (released 2013-07-01) and 1.30 versions: + + * Changes breaking binary compatibility (source compatibility is + maintained): + + overloaded versions of DMS::Encode, + EllipticFunction::EllipticFunction, and + GeoCoords::DMSRepresentation, have been eliminated by the use of + optional arguments; + + correct the declaration of first arg to UTMUPS::DecodeEPSG. + + * FIX BUG in GeographicLib::GravityCircle constructor (found by + Mathieu Peyréga) which caused bogus results for the gravity + disturbance and gravity anomaly vectors. (This only affected + calculations using GravityCircle. GravityModel calculations did not + suffer from this bug.) + + * Improvements to the build: + + add macros GEOGRAPHICLIB_VERSION_{MAJOR,MINOR,PATCH} to Config.h; + + fix documentation for new version of perlpod; + + improving setting of runtime path for Unix-like systems with + cmake; + + install PDB files when compiling with Visual Studio to aid + debugging; + + Windows binary release now uses Matlab R2013a (64-bit) and uses + the -largeArrayDims option. + + * Changes to the geodesic routines: + + add Java implementation of the geodesic routines (thanks to Skip + Breidbach for the maven support); + + FIX BUG: avoid altering input args in Fortran implementation; + + more systematic treatment of very short geodesic; + + fixes to python port so that they work with version 3.x, in + addition to 2.x (courtesy of Amato); + + accumulate the perimeter and area of polygons via a double-wide + accumulator in Fortran, C, and Matlab implementations (this is + already included in the other implementations); + + port PolygonArea::AddEdge and PolygonArea::TestEdge to JavaScript + and python interfaces; + + include documentation on short geodesics. + + * Unix scripts for downloading datasets, + geographiclib-get-{geoids,gravity,magnetic}, skip already download + models by default, unless the -f flag is given. + + * FIX BUGS: meridian convergence and scale returned by + TransverseMercatorExact was wrong at a pole. + + * Improve efficiency of MGRS::Forward by avoiding the calculation of + the latitude if possible (adapting an idea of Craig Rollins). + + * Fixes to the way the Matlab interface routines are built (thanks to + Phil Miller and Chris F.). + +Changes between 1.30 (released 2013-02-27) and 1.29 versions: + + * Changes to geodesic routines: + + fix BUG in fail-safe mechanisms in Geodesic::Inverse; + + the command line utility Geod is now called GeodSolve; + + allow addition of polygon edges in PolygonArea; + + add full Maxima implementation of geodesic algorithms. + +Changes between 1.29 (released 2013-01-16) and 1.28 versions: + + * Changes to allow compilation with libc++ (courtesy of Kal Conley). + + * Add description of geodesics on triaxial ellipsoid to + documentation. + + * Update journal reference for "Algorithms for geodesics". + +Changes between 1.28 (released 2012-12-11) and 1.27 versions: + + * Changes to geodesic routines: + + compute longitude difference exactly; + + hence fix BUG in area calculations for polygons with vertices very + close to the prime meridian; + + fix BUG is geoddistance.m where the value of m12 was wrong for + meridional geodesics; + + add Matlab implementations of the geodesic projections; + + remove unneeded special code for geodesics which start at a pole; + + include polygon area routine in C and Fortran implementations; + + add doxygen documentation for C and Fortran libraries. + +Changes between 1.27 (released 2012-11-29) and 1.26 versions: + + * Changes to geodesic routines: + + add native Matlab implementations: geoddistance.m, geodreckon.m, + geodarea.m; + + add C and Fortran implementations; + + improve the solution of the direct problem so that the series + solution is accurate to round off for |f| < 1/50; + + tighten up the convergence criteria for solution of the inverse + problem; + + no longer signal failures of convergence with NaNs (a slightly + less accurate answer is returned instead). + + * Fix DMS::Decode double rounding BUG. + + * On MacOSX platforms with the cmake configuration, universal + binaries are built. + +Changes between 1.26 (released 2012-10-22) and 1.25 versions: + + * Replace the series used for geodesic areas by one with better + convergence (this only makes an appreciable difference if |f| > + 1/150). + +Changes between 1.25 (released 2012-10-16) and 1.24 versions: + + * Changes to geodesic calculations: + + restart Newton's method in Geodesic::Inverse when it goes awry; + + back up Newton's method with the bisection method; + + Geodesic::Inverse now converges for any value of f; + + add GeodesicExact and GeodesicLineExact which are formulated in + terms of elliptic integrals and thus yield accurate results + even for very eccentric ellipsoids. + + the -E option to Geod invokes these exact classes. + + * Add functionality to EllipticFunction: + + add all the traditional elliptic integrals; + + remove restrictions on argument range for incomplete elliptic + integrals; + + allow imaginary modulus for elliptic integrals and elliptic + functions; + + make interface to the symmetric elliptic integrals public. + + * Allow GeographicLib::Ellipsoid to be copied. + + * Changes to the build tools: + + cmake uses folders in Visual Studio to reduce clutter; + + allow precision of reals to be set in cmake; + + fail gracefully in the absence of pod documentation tools; + + remove support for maintainer tasks in Makefile.mk. + +Changes between 1.24 (released 2012-09-22) and 1.23 versions: + + * Allow the specification of the hemisphere in UTM coordinates in + order to provide continuity across the equator: + + add UTMUPS::Transfer; + + add GeoCoords::UTMUPSRepresentation(bool, int) and + GeoCoords::AltUTMUPSRepresentation(bool, int); + + use the hemisphere letter in, e.g., GeoConvert -u -z 31N. + + * Add UTMUPS::DecodeEPSG and UTMUPS::EncodeEPSG. + + * cmake changes: + + restore support for cmake 2.4.x; + + explicitly check version of doxygen. + + * Fix building under cygwin. + + * Document restrictions on f in the Introduction. + + * Fix python interface to work with version 2.6.x. + +Changes between 1.23 (released 2012-07-17) and 1.22 versions: + + * Documentation changes: + + remove html documentation from distribution and use web links if + doxygen is not available; + + use doxygen tags to document exceptions; + + begin migrating the documentation to using Greek letters where + appropriate (requires doxygen 1.8.1.2 or later). + + * Add Math::AngNormalize and Math::AngNormalize2; the allowed range + for longitudes and azimuths widened to [-540d, 540d). + + * DMS::Decode understands more unicode symbols. + + * Geohash uses geohash code "nan" to stand for not a number. + + * Add Ellipsoid::NormalCurvatureRadius. + + * Various fixes in LambertConformalConic, TransverseMercator, + PolarStereographic, and Ellipsoid to handle reverse projections of + points near infinity. + + * Fix programming blunder in LambertConformalConic::Forward (incorrect + results were returned if the tangent latitude was negative). + +Changes between 1.22 (released 2012-05-27) and 1.21 versions: + + * Add Geohash and Ellipsoid classes. + + * Fix bug in AlbersEqualArea of very prolate ellipsoids (b^2 > 2 + a^2). + + * cmake changes: + + optionally use PACKAGE_PATH and INSTALL_PATH to determine + CMAKE_INSTALL_PREFIX; + + use COMMON_INSTALL_PATH to determine layout of installation + directories; + + as a consequence, the installation paths for the documentation, + and python and matlab interfaces are shortened for Windows; + + zip source distribution now uses DOS line endings; + + the tests work in debug mode for Windows; + + default setting of GEOGRAPHICLIB_DATA does not depend on + CMAKE_INSTALL_PREFIX; + + add a cmake configuration for build tree. + +Changes between 1.21 (released 2012-04-25) and 1.20 versions: + + * Support colon-separated DMS output: + + DMS::Encode and GeoCoords::DMSRepresentation generalized; + + GeoConvert and Geod now accept a -: option. + + * GeoidEval does not print the gradient of the geoid height by default + (because it's subject to large errors); give the -g option to get + the gradient printed. + + * Work around optimization BUG in GeographicLib::Geodesic::Inverse + with tdm mingw g++ version 4.6.1. + + * autoconf fixed to ensure that that out-of-sources builds work; + document this as the preferred method of using autoconf. + + * cmake tweaks: + + simplify the configuration of doxygen; + + allow the Matlab compiler to be specified with the MATLAB_COMPILER option. + +Changes between 1.20 (released 2012-03-23) and 1.19 versions: + + * cmake tweaks: + + improve find_package's matching of compiler versions; + + CMAKE_INSTALL_PREFIX set from CMAKE_PREFIX_PATH if available; + + add "x64" to the package name for the 64-bit binary installer; + + fix cmake warning with Visual Studio Express. + + * Fix SphericalEngine to deal with aggessive iterator checking by + Visual Studio. + + * Fix transcription BUG is Geodesic.js. + +Changes between 1.19 (released 2012-03-13) and 1.18 versions: + + * Slight improvement in Geodesic::Inverse for very short lines. + + * Fix argument checking tests in MGRS::Forward. + + * Add --comment-delimiter and --line-separator options to the utility + programs. + + * Add installer for 64-bit Windows; the compiled Matlab interface is + supplied with the Windows 64-bit installer only. + +Changes between 1.18 (released 2012-02-18) and 1.17 versions: + + * Improve documentation on configuration with cmake. + + * cmake's find_package ensures that the compiler versions match on Windows. + + * Improve documentation on compiling Matlab interface. + + * Binary installer for Windows installs under C:/pkg-vc10 by default. + +Changes between 1.17 (released 2012-01-21) and 1.16 versions: + + * Work around optimization BUG in Geodesic::Inverse with g++ version + 4.4.0 (mingw). + + * Fix BUG in argument checking with OSGB::GridReference. + + * Fix missing include file in SphericalHarmonic2. + + * Add simple examples of usage for each class. + + * Add internal documenation to the cmake configuration files. + +Changes between 1.16 (released 2011-12-07) and 1.15 versions: + + * Add calculation of the earth's gravitational field: + + add NormalGravity GravityModel and GravityCircle classes; + + add command line utility Gravity; + + add Gravity models; + + add Constants::WGS84_GM(), Constants::WGS84_omega(), and similarly + for GRS80. + + * Build uses GEOGRAPHICLIB_DATA to specify a common parent directory + for geoid, gravity, and magnetic data (instead of + GEOGRAPHICLIB_GEOID_PATH, etc.); similarly, GeoidEval, Gravity, and + MagneticField, look at the environment variable GEOGRAPHICLIB_DATA + to locate the data. + + * Spherical harmonic software changes: + + capitalize enums SphericalHarmonic::FULL and + SphericalHarmonic::SCHMIDT (the lower case names are retained but + deprecated); + + optimize the sum by using a static table of square roots which is + updated by SphericalEngine::RootTable; + + avoid overflow for high degree models. + + * Magnetic software fixes: + + fix documentation BUG in MagneticModel::Circle; + + make MagneticModel constructor explicit; + + provide default MagneticCircle constructor; + + add additional inspector functions to MagneticCircle; + + add -c option to MagneticField; + + default height to zero in MagneticField. + +Changes between 1.15 (released 2011-11-08) and 1.14 versions: + + * Add calculation of the earth's magnetic field: + + add MagneticModel and MagneticCircle classes; + + add command line utility MagneticField; + + add Magnetic models; + + add Installing the magnetic field models; + + add The format of the magnetic model files; + + add classes SphericalEngine, CircularEngine, SphericalHarmonic, + SphericalHarmonic1, and SphericalHarmonic2. which sum spherical + harmonic series. + + * Add Utility class to support I/O and date manipulation. + + * Cmake configuration includes a _d suffix on the library built in + debug mode. + + * For the Python package, include manifest and readme files; don't + install setup.py for non-Windows systems. + + * Include Doxygen tag file in distribution as doc/html/Geographic.tag. + +Changes between 1.14 (released 2011-09-30) and 1.13 versions: + + * Ensure that geographiclib-config.cmake is relocatable. + + * Allow more unicode symbols to be used in DMS::Decode. + + * Modify GeoidEval so that it can be used to convert the height datum + for LIDAR data. + + * Modest speed-up of Geodesic::Inverse. + + * Changes in python interface: + + FIX BUG in transcription of Geodesic::Inverse; + + include setup.py for easy installation; + + python only distribution is available at + http://pypi.python.org/pypi/geographiclib + + * Supply a minimal Qt qmake project file for library + src/Geographic.pro. + +Changes between 1.13 (released 2011-08-13) and 1.12 versions: + + * Changes to I/O: + + allow : (colon) to be used as a DMS separator in DMS::Decode; + + also accept Unicode symbols for degrees, minutes, and seconds + (coded as UTF-8); + + provide optional swaplatlong argument to various DMS and GeoCoords + functions to make longitude precede latitude; + + GeoConvert now has a -w option to make longitude precede latitude + on input and output; + + include a JavaScript version of DMS. + + * Slight improvement in starting guess for solution of geographic + latitude in terms of conformal latitude in TransverseMercator, + TransverseMercatorExact, and LambertConformalConic. + + * For most classes, get rid of const member variables so that the + default copy assignment works. + + * Put Math and Accumulator in their own header files. + + * Remove unused "fast" GeographicLib::Accumulator method. + + * Reorganize the Python interface. + + * Withdraw some deprecated routines. + + * cmake changes: + + include FindGeographic.cmake in distribution; + + building with cmake creates and installs + geographiclib-config.cmake; + + better support for building a shared library under Windows. + +Changes between 1.12 (released 2011-07-21) and 1.11 versions: + + * Change license to MIT/X11. + + * Add GeographicLib::PolygonArea class and equivalent Matlab function. + + * Provide JavaScript and Python implementations of geodesic routines. + + * Fix Windows installer to include runtime dlls for Matlab. + + * Fix (innocuous) unassigned variable in Geodesic::GenInverse. + + * Geodesic routines in Matlab return a12 as first column of aux return + value (incompatible change). + + * A couple of code changes to enable compilation with Visual Studio + 2003. + +Changes between 1.11 (released 2011-06-27) and 1.10 versions: + + * Changes to Planimeter: + + add -l flag to Planimeter for polyline calculations; + + trim precision of area to 3 decimal places; + + FIX BUG with pole crossing edges (due to compiler optimization). + + * Geod no longer reports the reduced length by default; however the -f + flag still reports this and in addition gives the geodesic scales + and the geodesic area. + + * FIX BUGS (compiler-specific) in inverse geodesic calculations. + + * FIX BUG: accommodate tellg() returning -1 at end of string. + + * Change way flattening of the ellipsoid is specified: + + constructors take f argument which is taken to be the flattening + if f < 1 and the inverse flattening otherwise (this is a + compatible change for spheres and oblate ellipsoids, but it is an + INCOMPATIBLE change for prolate ellipsoids); + + the -e arguments to the Utility Programs are handled similarly; in + addition, simple fractions, e.g., 1/297, can be used for the + flattening; + + introduce Constants::WGS84_f() for the WGS84 flattening (and + deprecate Constants::WGS84_r() for the inverse flattening); + + most classes have a Flattening() member function; + + InverseFlattening() has been deprecated (and now returns inf for a + sphere, instead of 0). + +Changes between 1.10 (released 2011-06-11) and 1.9 versions: + + * Improvements to Matlab/Octave interface: + + add {geocentric,localcartesian}{forward,reverse}; + + make geographiclibinterface more general; + + install the source for the interface; + + cmake compiles the interface if ENABLE_MATLAB=ON; + + include compiled interface with Windows binary installer. + + * Fix various configuration issues + + autoconf did not install Config.h; + + cmake installed in man/man1 instead of share/man/man1; + + cmake did not set the rpath on the tools. + +Changes between 1.9 (released 2011-05-28) and 1.8 versions: + + * FIX BUG in area returned by Planimeter for pole encircling polygons. + + * FIX BUG in error message reported when DMS::Decode reads the string + "5d.". + + * FIX BUG in AlbersEqualArea::Reverse (lon0 not being used). + + * Ensure that all exceptions thrown in the Utility Programs are + caught. + + * Avoid using catch within GeographicLib::DMS. + + * Move Accumulator class from Planimeter.cpp to Constants.hpp. + + * Add Math::sq. + + * Simplify Installing the geoid datasets + + add geographiclib-get-geoids for Unix-like systems; + + add installers for Windows. + + * Provide cmake support: + + build binary installer for Windows; + + include regression tests; + + add --input-string, --input-file, --output-file options to the + Utility Programs to support tests. + + * Rename utility EquidistantTest as GeodesicProj and + TransverseMercatorTest as TransverseMercatorProj. + + * Add ConicProj. + + * Reverse the initial sense of the -s option for Planimeter. + + * Migrate source from subversion to git. + +Changes between 1.8 (released 2011-02-22) and 1.7 versions: + + * Optionally return rotation matrix from GeographicLib::Geocentric and + GeographicLib::LocalCartesian. + + * For the Utility Programs, supply man pages, -h prints the synopsis, + --help prints the man page, --version prints the version. + + * Use accurate summation in Planimeter. + + * Add 64-bit targets for Visual Studio 2010. + + * Use templates for defining math functions and some constants. + + * GeographicLib::Geoid updates + + Add GeographicLib::Geoid::DefaultGeoidPath and + GeographicLib::Geoid::DefaultGeoidName; + + GeoidEval uses environment variable GEOID_NAME as the default + geoid; + + Add --msltohae and --haetomsl as GeoidEval options (and don't + document the single hyphen versions). + + * Remove documentation that duplicates papers on transverse Mercator + and geodesics. + +Changes between 1.7 (released 2010-12-21) and 1.6 versions: + + * FIX BUG in scale returned by GeographicLib::LambertConformalConic::Reverse. + + * Add GeographicLib::AlbersEqualArea projection. + + * Library created by Visual Studio is Geographic.lib instead of + GeographicLib.lib (compatible with makefiles). + + * Make classes NaN aware. + + * Use cell arrays for MGRS strings in Matlab. + + * Add solution/project files for Visual Studio 2010 (32-bit only). + + * Use C++11 static_assert and math functions, if available. + +Change between 1.6 (released 2010-11-23) and 1.5 versions: + + * FIX BUG introduced in GeographicLib::Geoid in version 1.5 (found by + Dave Edwards). + +Changes between 1.5 (released 2010-11-19) and 1.4 versions: + + * Improve area calculations for small polygons. + + * Add -s and -r flags to Planimeter utility. + + * Improve the accuracy of GeographicLib::LambertConformalConic using + divided differences. + + * FIX BUG in meridian convergence returned by + LambertConformalConic::Forward. + + * Add optional threadsafe parameter to GeographicLib::Geoid + constructor. WARNING: This changes may break binary compatibility + with previous versions of GeographicLib. However, the library is + source compatible. + + * Add GeographicLib::OSGB. + + * Matlab and Octave interfaces to GeographicLib::UTMUPS, + GeographicLib::MGRS, GeographicLib::Geoid, GeographicLib::Geodesic + provided. + + * Minor changes + + explicitly turn on optimization in Visual Studio 2008 projects; + + add missing dependencies in some Makefiles; + + move pi() and degree() from GeographicLib::Constants to + GeographicLib::Math; + + introduce GeographicLib::Math::extended type to aid testing; + + add GeographicLib::Math::epi() and GeographicLib::Math::edegree(). + + fixes to compile under cygwin; + + tweak expression used to find latitude from conformal latitude. + +Changes between 1.4 (released 2010-09-12) and 1.3 versions: + + * Changes to GeographicLib::Geodesic and GeographicLib::GeodesicLine: + + FIX BUG in Geodesic::Inverse with prolate ellipsoids; + + add area computations to Geodesic::Direct and Geodesic::Inverse; + + add geodesic areas to geodesic test set; + + make GeodesicLine constructor public; + + change longitude series in Geodesic into Helmert-like form; + + ensure that equatorial geodesics have cos(alpha0) = 0 identically; + + generalize interface for Geodesic and GeodesicLine; + + split GeodesicLine and Geodesic into different files; + + signal convergence failure in Geodesic::Inverse with NaNs; + + deprecate one function in Geodesic and two functions in + GeodesicLine; + + deprecate -n option for Geod. + WARNING: These changes may break binary compatibility with previous + versions of GeographicLib. However, the library is source + compatible (with the proviso that GeographicLib/GeodesicLine.hpp may + now need to be included). + + * Add the Planimeter utility for computing the areas of + geodesic polygons. + + * Improve iterative solution of GeographicLib::Gnomonic::Reverse. + + * Add GeographicLib::Geoid::ConvertHeight. + + * Add -msltohae, -haetomsl, and -z options to \ref geoideval. + + * Constructors check that minor radius is positive. + + * Add overloaded Forward and Reverse functions to the projection + classes which don't return the convergence (or azimuth) and scale. + + * Document function parameters and return values consistently. + +Changes between 1.3 (released 2010-07-21) and 1.2 versions: + + * Add GeographicLib::Gnomonic, the ellipsoid generalization of the + gnomonic projection. + + * Add -g and -e options to Equidistanttest. + + * Use fixed-point notation for output from Cartconvert, + Equidistanttest, Transversemercatortest. + + * PolarStereographic: + + Improved conversion to conformal coordinates; + + Fix bug with scale at opposite pole; + + Complain if latitude out of range in SetScale. + + * Add GeographicLib::Math::NaN(). + + * Add long double version of hypot for Windows. + + * Add EllipticFunction::E(real). + + * Update references to Geotrans in MGRS documentation. + + * Speed up tmseries.mac. + +Changes between 1.2 (released 2010-05-21) and 1.1 versions: + + * FIX BUGS in GeographicLib::Geodesic, + + wrong azimuth returned by Direct if point 2 is on a pole; + + Inverse sometimes fails with very close points. + + * Improve calculation of scale in GeographicLib::CassiniSoldner, + + add GeodesicLine::Scale, GeodesicLine::EquatorialAzimuth, and + GeodesicLine::EquatorialArc; + + break friend connection between CassiniSoldner and Geodesic. + + * Add DMS::DecodeAngle and DMS::DecodeAzimuth. Extend DMS::Decode and + DMS::Encode to deal with distances. + + * Code and documentation changes in Geodesic and Geocentric for + consistency with the forthcoming paper on geodesics. + + * Increase order of series using in Geodesic to 6 (full accuracy + maintained for ellipsoid flattening < 0.01). + + * Macro __NO_LONG_DOUBLE_MATH to disable use of long double. + + * Correct declaration of Math::isfinite to return a bool. + + * Changes in the Utility Programs, + + improve error reporting when parsing command line arguments; + + accept latitudes and longitudes in decimal degrees or degrees, + minutes, and seconds, with optional hemisphere designators; + + GeoConvert -z accepts zone or zone+hemisphere; + + GeoidEval accepts any of the input formats used by GeoConvert; + + CartConvert allows the ellipsoid to be specified with -e. + +Changes between 1.1 (released 2010-02-09) and 1.0 versions: + + * FIX BUG (introduced in 2009-03) in EllipticFunction::E(sn,cn,dn). + + * Increase accuracy of scale calculation in TransverseMercator and + TransverseMercatorExact. + + * Code and documentation changes for consistency with arXiv:1002.1417 + +Changes between 1.0 (released 2010-01-07) and 2009-11 versions: + + * Add autoconf configuration files. + + * BUG FIX: Improve initial guess for Newton's method in + PolarStereographic::Reverse. (Previously this failed to converge + when the co-latitude exceeded about 130 deg.) + + * Constructors for TransverseMercator, TransverseMercatorExact, + PolarStereographic, Geocentric, and Geodesic now check for obvious + problems with their arguments and throw an exception if necessary. + + * Most classes now include inspector functions such as MajorRadius() + so that you can determine how instances were constructed. + + * Add GeographicLib::LambertConformalConic class. + + * Add GeographicLib::PolarStereographic::SetScale to allow the + latitude of true scale to be specified. + + * Add solution and project files for Visual Studio 2008. + + * Add GeographicLib::GeographicErr for exceptions. + + * GeographicLib::Geoid changes: + + BUG FIX: fix typo in GeographicLib::Geoid::Cache which could cause + a segmentation fault in some cases when the cached area spanned + the prime meridian. + + Include sufficient edge data to allow heights to be returned for + cached area without disk reads; + + Add inspector functions to query the extent of the cache. + +Changes between 2009-11 and 2009-10 versions: + + * Allow specification of "closest UTM zone" in GeographicLib::UTMUPS + and GeoConvert (via -t option). + + * Utilities now complain is there are too many tokens on input lines. + + * Include real-to-real versions of GeographicLib::DMS::Decode and + GeographicLib::DMS::Encode. + + * More house-cleaning changes: + + Ensure that functions which return results through reference + arguments do not alter the arguments when an exception is thrown. + + Improve accuracy of GeographicLib::MGRS::Forward. + + Include more information in some error messages. + + Improve accuracy of inverse hyperbolic functions. + + Fix the way GeographicLib::Math functions handle different + precisions. + +Changes between 2009-10 and 2009-09 versions: + + * Change web site to http://geographiclib.sourceforge.net + + * Several house-cleaning changes: + + Change from the a flat directory structure to a more easily + maintained one. + + Introduce Math class for common mathematical functions (in + Constants.hpp). + + Use Math::real as the type for all real quantities. By default this + is typedef'ed to double; and the library should be installed this + way. + + Eliminate const reference members of AzimuthalEquidistant, + CassiniSoldner and LocalCartesian so that they may be copied. + + Make several constructors explicit. Disallow some constructors. + Disallow copy constructor/assignment for Geoid. + + Document least square formulas in Geoid.cpp. + + Use unsigned long long for files positions of geoid files in Geoid. + + Introduce optional mgrslimits argument in UTMUPS::Forward and + UTMUPS::Reverse to enforce stricter MGRS limits on eastings and + northings.in + + Add 64-bit targets in Visual Studio project files. + +Changes between 2009-09 and 2009-08 versions: + + * Add GeographicLib::Geoid and GeoidEval utility. + +Changes between 2009-08 and 2009-07 versions: + + * Add GeographicLib::CassiniSoldner class and EquidistantTest utility. + + * Fix bug in GeographicLib::Geodesic::Inverse where NaNs were + sometimes returned. + + * INCOMPATIBLE CHANGE: AzimuthalEquidistant now returns the reciprocal + of the azimuthal scale instead of the reduced length. + + * Add -n option to GeoConvert. + +Changes between 2009-07 and 2009-06 versions: + + * Speed up the series inversion code in tmseries.mac and geod.mac. + + * Reference Borkowski in section on Geocentric coordinates. + +Changes between 2009-06 and 2009-05 versions: + + * Add routines to decode and encode zone+hemisphere to GeographicLib::UTMUPS. + + * Clean up code in GeographicLib::Geodesic. + +Changes between 2009-05 and 2009-04 versions: + + * Improvements to GeographicLib::Geodesic: + + more economical series expansions, + + return reduced length (as does the Geod utility), + + improved calculation of starting point for inverse method, + + use reduced length to give derivative for Newton's method. + + * Add AzimuthalEquidistant class. + + + Make GeographicLib::Geocentric, GeographicLib::TransverseMercator, + and GeographicLib::PolarStereographic classes work with prolate + ellipsoids. + + * CartConvert checks its inputs more carefully. + + * Remove reference to defunct Constants.cpp from GeographicLib.vcproj. + +Changes between 2009-04 and 2009-03 versions: + + * Use compile-time constants to select the order of series in + GeographicLib::TransverseMercator. + + * 2x unroll of Clenshaw summation to avoid data shuffling. + + * Simplification of GeographicLib::EllipticFunction::E. + + * Use STATIC_ASSERT for compile-time checking of constants. + + * Improvements to GeographicLib::Geodesic: + + compile-time option to change order of series used, + + post maxima code for generating the series, + + tune the order of series for double, + + improvements in the selection of starting points for Newton's + method, + + accept and return spherical arc lengths, + + works with both oblate and prolate spheroids, + + add -a, -e, -b options to the Geod utility. + +Changes between 2009-03 and 2009-02 versions: + + * Add GeographicLib::Geodesic and the Geod utility. + + * Declare when no exceptions are thrown by functions. + + * Minor changes to GeographicLib::DMS class. + + * Use invf = 0 to mean a sphere in constructors to some classes. + + * The makefile creates a library and includes an install target. + + * Rename GeographicLib::ECEF to GeographicLib::Geocentric, ECEFConvert + to CartConvert. + + * Use inline functions to define constant doubles in Constants.hpp. + +Changes between 2009-02 and 2009-01 versions: + + * Fix documentation of constructors (flattening -> inverse + flattening). + + * Use std versions of math functions. + + * Add ECEF and LocalCartesian classes and ECEFConvert utility. + + * Gather the documentation on the utility programs onto one page. diff --git a/gtsam/3rdparty/GeographicLib/aclocal.m4 b/gtsam/3rdparty/GeographicLib/aclocal.m4 new file mode 100644 index 000000000..ec1e5deda --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/aclocal.m4 @@ -0,0 +1,1018 @@ +# generated automatically by aclocal 1.12.2 -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.12' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.12.2], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.12.2])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 10 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 17 + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each '.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 19 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], +[$0: two- and three-arguments forms are deprecated. For more info, see: +http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +dnl Support for Objective C++ was only introduced in Autoconf 2.65, +dnl but we still cater to Autoconf 2.62. +m4_ifdef([AC_PROG_OBJCXX], +[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2001-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of '-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/libtool.m4]) +m4_include([m4/ltoptions.m4]) +m4_include([m4/ltsugar.m4]) +m4_include([m4/ltversion.m4]) +m4_include([m4/lt~obsolete.m4]) diff --git a/gtsam/3rdparty/GeographicLib/cmake/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/cmake/CMakeLists.txt new file mode 100644 index 000000000..51e6c44b2 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/cmake/CMakeLists.txt @@ -0,0 +1,52 @@ +# config file support for find_package (GeographicLib). This needs to +# deal with two environments: (1) finding the build tree and (2) +# finding the install tree. geographiclib-config.cmake detects which +# situation it is handing by looking at @PROJECT_ROOT_DIR@. If +# this is an absolute path, it's in the build tree; otherwise, it's in the +# install tree. (Note that the whole install tree can be relocated.) + +# geographiclib-config.cmake for the build tree +set (PROJECT_ROOT_DIR "${PROJECT_BINARY_DIR}") +set (PROJECT_INCLUDE_DIRS + "${PROJECT_BINARY_DIR}/include" "${PROJECT_SOURCE_DIR}/include" ) +configure_file (project-config.cmake.in + "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake" @ONLY) +configure_file (project-config-version.cmake.in + "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake" @ONLY) +export (TARGETS ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES} ${TOOLS} + FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-depends.cmake") + +# geographiclib-config.cmake for the install tree. It's installed in +# ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative +# path to the root from there. (Note that the whole install tree can +# be relocated.) +if (COMMON_INSTALL_PATH) + set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_NAME}") + set (PROJECT_ROOT_DIR "../../..") +else () + set (INSTALL_CMAKE_DIR "cmake") + set (PROJECT_ROOT_DIR "..") +endif () +# @PROJECT_INCLUDE_DIRS@ is not used in the install tree; reset +# it to prevent the source and build paths appearing in the installed +# config files +set (PROJECT_INCLUDE_DIRS) +configure_file (project-config.cmake.in + ${PROJECT_NAME_LOWER}-config.cmake @ONLY) +configure_file (project-config-version.cmake.in + ${PROJECT_NAME_LOWER}-config-version.cmake @ONLY) +install (FILES + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake" + DESTINATION "${INSTALL_CMAKE_DIR}") +# Make information about the cmake targets (the library and the tools) +# available. +install (EXPORT depends + FILE ${PROJECT_NAME_LOWER}-depends.cmake + DESTINATION "${INSTALL_CMAKE_DIR}") + +if (MSVC AND PACKAGE_DEBUG_LIBS) + install (FILES + "${PROJECT_BINARY_DIR}/cmake/CMakeFiles/Export/cmake/${PROJECT_NAME_LOWER}-depends-debug.cmake" + DESTINATION "${INSTALL_CMAKE_DIR}" CONFIGURATIONS Release) +endif () diff --git a/gtsam/3rdparty/GeographicLib/cmake/FindGeographicLib.cmake b/gtsam/3rdparty/GeographicLib/cmake/FindGeographicLib.cmake new file mode 100644 index 000000000..9c52b3e7f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/cmake/FindGeographicLib.cmake @@ -0,0 +1,31 @@ +# Look for GeographicLib +# +# Set +# GEOGRAPHICLIB_FOUND = TRUE +# GeographicLib_INCLUDE_DIRS = /usr/local/include +# GeographicLib_LIBRARIES = /usr/local/lib/libGeographic.so +# GeographicLib_LIBRARY_DIRS = /usr/local/lib + +find_library (GeographicLib_LIBRARIES Geographic + PATHS "${CMAKE_INSTALL_PREFIX}/../GeographicLib/lib") + +if (GeographicLib_LIBRARIES) + get_filename_component (GeographicLib_LIBRARY_DIRS + "${GeographicLib_LIBRARIES}" PATH) + get_filename_component (_ROOT_DIR "${GeographicLib_LIBRARY_DIRS}" PATH) + set (GeographicLib_INCLUDE_DIRS "${_ROOT_DIR}/include") + set (GeographicLib_BINARY_DIRS "${_ROOT_DIR}/bin") + unset (_ROOT_DIR) + if (NOT EXISTS "${GeographicLib_INCLUDE_DIRS}/GeographicLib/Config.h") + unset (GeographicLib_INCLUDE_DIRS) + unset (GeographicLib_LIBRARIES) + unset (GeographicLib_LIBRARY_DIRS) + unset (GeographicLib_BINARY_DIRS) + endif () +endif () + +include (FindPackageHandleStandardArgs) +find_package_handle_standard_args (GeographicLib DEFAULT_MSG + GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES GeographicLib_INCLUDE_DIRS) +mark_as_advanced (GeographicLib_LIBRARY_DIRS GeographicLib_LIBRARIES + GeographicLib_INCLUDE_DIRS) diff --git a/gtsam/3rdparty/GeographicLib/cmake/Makefile.am b/gtsam/3rdparty/GeographicLib/cmake/Makefile.am new file mode 100644 index 000000000..212e9f393 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/cmake/Makefile.am @@ -0,0 +1,14 @@ +# +# Makefile.am +# +# Copyright (C) 2011, Charles Karney + +cmakedir=$(datadir)/cmake/GeographicLib + +install: + $(INSTALL) -d $(DESTDIR)$(cmakedir) + $(INSTALL) -m 644 $(srcdir)/FindGeographicLib.cmake \ + $(DESTDIR)$(cmakedir) + +EXTRA_DIST = Makefile.mk CMakeLists.txt FindGeographicLib.cmake \ + project-config-version.cmake.in project-config.cmake.in diff --git a/gtsam/3rdparty/GeographicLib/cmake/Makefile.in b/gtsam/3rdparty/GeographicLib/cmake/Makefile.in new file mode 100644 index 000000000..a781b6583 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/cmake/Makefile.in @@ -0,0 +1,415 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile.am +# +# Copyright (C) 2011, Charles Karney +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = cmake +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/GeographicLib/Config-ac.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COL = @COL@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GEOGRAPHICLIB_VERSION_MAJOR = @GEOGRAPHICLIB_VERSION_MAJOR@ +GEOGRAPHICLIB_VERSION_MINOR = @GEOGRAPHICLIB_VERSION_MINOR@ +GEOGRAPHICLIB_VERSION_PATCH = @GEOGRAPHICLIB_VERSION_PATCH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POD2HTML = @POD2HTML@ +POD2MAN = @POD2MAN@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +cmakedir = $(datadir)/cmake/GeographicLib +EXTRA_DIST = Makefile.mk CMakeLists.txt FindGeographicLib.cmake \ + project-config-version.cmake.in project-config.cmake.in + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cmake/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu cmake/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +install: + $(INSTALL) -d $(DESTDIR)$(cmakedir) + $(INSTALL) -m 644 $(srcdir)/FindGeographicLib.cmake \ + $(DESTDIR)$(cmakedir) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gtsam/3rdparty/GeographicLib/cmake/Makefile.mk b/gtsam/3rdparty/GeographicLib/cmake/Makefile.mk new file mode 100644 index 000000000..e747bdb02 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/cmake/Makefile.mk @@ -0,0 +1,13 @@ +DEST = $(PREFIX)/share/cmake/GeographicLib + +INSTALL=install -b + +all: + @: +install: + test -d $(DEST) || mkdir -p $(DEST) + $(INSTALL) -m 644 FindGeographicLib.cmake $(DEST) +clean: + @: + +.PHONY: all install clean diff --git a/gtsam/3rdparty/GeographicLib/cmake/project-config-version.cmake.in b/gtsam/3rdparty/GeographicLib/cmake/project-config-version.cmake.in new file mode 100644 index 000000000..2b20f0bc6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/cmake/project-config-version.cmake.in @@ -0,0 +1,54 @@ +# Version checking for @PROJECT_NAME@ + +set (PACKAGE_VERSION "@PROJECT_VERSION@") +set (PACKAGE_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@") +set (PACKAGE_VERSION_MINOR "@PROJECT_VERSION_MINOR@") +set (PACKAGE_VERSION_PATCH "@PROJECT_VERSION_PATCH@") + +if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_NAME@") + # Check package name (in particular, because of the way cmake finds + # package config files, the capitalization could easily be "wrong"). + # This is necessary to ensure that the automatically generated + # variables, e.g., _FOUND, are consistently spelled. Make + # this a WARNING, because this is a user error that needs to be fixed. + message (WARNING + "Mismatched package names: use find_package(@PROJECT_NAME@ ...) instead" + " of find_package(${PACKAGE_FIND_NAME} ...)") + set (PACKAGE_VERSION_UNSUITABLE TRUE) +elseif (NOT (APPLE OR CMAKE_SIZEOF_VOID_P EQUAL @CMAKE_SIZEOF_VOID_P@)) + # Reject if there's a 32-bit/64-bit mismatch (not necessary with Apple + # since a multi-architecture library is built for that platform). + message (STATUS + "${CMAKE_CURRENT_LIST_FILE} unsuitable because package built with " + "sizeof(*void) = @CMAKE_SIZEOF_VOID_P@") + set (PACKAGE_VERSION_UNSUITABLE TRUE) +elseif (MSVC AND NOT MSVC_VERSION STREQUAL "@MSVC_VERSION@") + # Reject if there's a mismatch in MSVC compiler versions + message (STATUS + "${CMAKE_CURRENT_LIST_FILE} unsuitable because package built with " + "_MSC_VER = @MSVC_VERSION@") + set (PACKAGE_VERSION_UNSUITABLE TRUE) +elseif (PACKAGE_FIND_VERSION) + if (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) + set (PACKAGE_VERSION_EXACT TRUE) + elseif (PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION + AND PACKAGE_FIND_VERSION_MAJOR EQUAL PACKAGE_VERSION_MAJOR) + set (PACKAGE_VERSION_COMPATIBLE TRUE) + endif () +endif () + +set (@PROJECT_NAME@_SHARED_FOUND @GEOGRAPHICLIB_SHARED_LIB@) +set (@PROJECT_NAME@_STATIC_FOUND @GEOGRAPHICLIB_STATIC_LIB@) +set (@PROJECT_NAME@_NETGeographicLib_FOUND @BUILD_NETGEOGRAPHICLIB@) + +# Check for the components requested. The convention is that +# GeographicLib_${comp}_FOUND should be true for all the required +# components. +if (@PROJECT_NAME@_FIND_COMPONENTS) + foreach (comp ${@PROJECT_NAME@_FIND_COMPONENTS}) + if (@PROJECT_NAME@_FIND_REQUIRED_${comp} AND + NOT @PROJECT_NAME@_${comp}_FOUND) + set (PACKAGE_VERSION_UNSUITABLE TRUE) + endif () + endforeach () +endif () diff --git a/gtsam/3rdparty/GeographicLib/cmake/project-config.cmake.in b/gtsam/3rdparty/GeographicLib/cmake/project-config.cmake.in new file mode 100644 index 000000000..a8b15a098 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/cmake/project-config.cmake.in @@ -0,0 +1,82 @@ +# Configure @PROJECT_NAME@ +# +# Set +# @PROJECT_NAME@_FOUND = @PROJECT_NAME_UPPER@_FOUND = 1 +# @PROJECT_NAME@_INCLUDE_DIRS = /usr/local/include +# @PROJECT_NAME@_SHARED_LIBRARIES = GeographicLib (or empty) +# @PROJECT_NAME@_STATIC_LIBRARIES = GeographicLib_STATIC (or empty) +# @PROJECT_NAME@_SHARED_DEFINITIONS = GEOGRAPHICLIB_SHARED_LIB=1 +# @PROJECT_NAME@_STATIC_DEFINITIONS = GEOGRAPHICLIB_SHARED_LIB=0 +# @PROJECT_NAME@_LIBRARY_DIRS = /usr/local/lib +# @PROJECT_NAME@_BINARY_DIRS = /usr/local/bin +# @PROJECT_NAME@_VERSION = 1.9 (for example) +# Depending on @PROJECT_NAME@_USE_STATIC_LIBS +# @PROJECT_NAME@_LIBRARIES = ${@PROJECT_NAME@_SHARED_LIBRARIES}, if OFF +# @PROJECT_NAME@_LIBRARIES = ${@PROJECT_NAME@_STATIC_LIBRARIES}, if ON +# @PROJECT_NAME@_DEFINITIONS = ${@PROJECT_NAME@_SHARED_DEFINITIONS}, if OFF +# @PROJECT_NAME@_DEFINITIONS = ${@PROJECT_NAME@_STATIC_DEFINITIONS}, if ON +# If only one of the libraries is provided, then +# @PROJECT_NAME@_USE_STATIC_LIBS is ignored. + +message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}") +set (@PROJECT_NAME@_VERSION "@PROJECT_VERSION@") +message (STATUS + "@PROJECT_NAME@ configuration, version ${@PROJECT_NAME@_VERSION}") + +# Tell the user project where to find our headers and libraries +get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) +if (IS_ABSOLUTE "@PROJECT_ROOT_DIR@") + # This is an uninstalled package (still in the build tree) + set (_ROOT "@PROJECT_ROOT_DIR@") + set (@PROJECT_NAME@_INCLUDE_DIRS "@PROJECT_INCLUDE_DIRS@") + set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/src") + set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/src") +else () + # This is an installed package; figure out the paths relative to the + # current directory. + get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE) + set (@PROJECT_NAME@_INCLUDE_DIRS "${_ROOT}/include") + set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/lib") + set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/bin") +endif () +message (STATUS " include directory: \${@PROJECT_NAME@_INCLUDE_DIRS}") + +set (@PROJECT_NAME@_SHARED_LIBRARIES @PROJECT_SHARED_LIBRARIES@) +set (@PROJECT_NAME@_STATIC_LIBRARIES @PROJECT_STATIC_LIBRARIES@) +set (@PROJECT_NAME@_SHARED_DEFINITIONS @PROJECT_SHARED_DEFINITIONS@) +set (@PROJECT_NAME@_STATIC_DEFINITIONS @PROJECT_STATIC_DEFINITIONS@) +# Read in the exported definition of the library +include ("${_DIR}/@PROJECT_NAME_LOWER@-depends.cmake") + +if ((NOT @PROJECT_NAME@_SHARED_LIBRARIES) OR + (@PROJECT_NAME@_USE_STATIC_LIBS AND @PROJECT_NAME@_STATIC_LIBRARIES)) + set (@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_STATIC_LIBRARIES}) + set (@PROJECT_NAME@_DEFINITIONS ${@PROJECT_NAME@_STATIC_DEFINITIONS}) + message (STATUS " \${@PROJECT_NAME@_LIBRARIES} set to static library") +else () + set (@PROJECT_NAME@_LIBRARIES ${@PROJECT_NAME@_SHARED_LIBRARIES}) + set (@PROJECT_NAME@_DEFINITIONS ${@PROJECT_NAME@_SHARED_DEFINITIONS}) + message (STATUS " \${@PROJECT_NAME@_LIBRARIES} set to shared library") +endif () + +set (@PROJECT_NAME@_NETGeographicLib_LIBRARIES @NETGEOGRAPHICLIB_LIBRARIES@) + +# Check for the components requested. This only supports components +# STATIC, SHARED, and NETGeographicLib by checking the value of +# @PROJECT_NAME@_${comp}_LIBRARIES. No need to check if the component +# is required or not--the version file took care of that. +# @PROJECT_NAME@_${comp}_FOUND is set appropriately for each component. +if (@PROJECT_NAME@_FIND_COMPONENTS) + foreach (comp ${@PROJECT_NAME@_FIND_COMPONENTS}) + if (@PROJECT_NAME@_${comp}_LIBRARIES) + set (@PROJECT_NAME@_${comp}_FOUND 1) + message (STATUS "@PROJECT_NAME@ component ${comp} found") + else () + set (@PROJECT_NAME@_${comp}_FOUND 0) + message (WARNING "@PROJECT_NAME@ component ${comp} not found") + endif () + endforeach () +endif () + +# @PROJECT_NAME@_FOUND is set to 1 automatically +set (@PROJECT_NAME_UPPER@_FOUND 1) # for backwards compatibility diff --git a/gtsam/3rdparty/GeographicLib/config.guess b/gtsam/3rdparty/GeographicLib/config.guess new file mode 100755 index 000000000..c0adba94b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/config.guess @@ -0,0 +1,1530 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-06-10' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/gtsam/3rdparty/GeographicLib/config.sub b/gtsam/3rdparty/GeographicLib/config.sub new file mode 100755 index 000000000..6205f8423 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/config.sub @@ -0,0 +1,1782 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-04-18' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + hexagon-*) + os=-elf + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/gtsam/3rdparty/GeographicLib/configure b/gtsam/3rdparty/GeographicLib/configure new file mode 100755 index 000000000..cc81327f5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/configure @@ -0,0 +1,18780 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for GeographicLib 1.34. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and charles@karney.com +$0: about your system, including any error possibly output +$0: before this message. Then install a modern shell, or +$0: manually run the script under such a shell if you do +$0: have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='GeographicLib' +PACKAGE_TARNAME='geographiclib' +PACKAGE_VERSION='1.34' +PACKAGE_STRING='GeographicLib 1.34' +PACKAGE_BUGREPORT='charles@karney.com' +PACKAGE_URL='' + +ac_unique_file="src/Geodesic.cpp" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +HAVE_PODPROGS_FALSE +HAVE_PODPROGS_TRUE +COL +POD2HTML +POD2MAN +HAVE_DOXYGEN_FALSE +HAVE_DOXYGEN_TRUE +DOXYGEN +LIBOBJS +POW_LIB +CXXCPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +ac_ct_AR +AR +DLLTOOL +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +LT_AGE +LT_REVISION +LT_CURRENT +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +GEOGRAPHICLIB_VERSION_PATCH +GEOGRAPHICLIB_VERSION_MINOR +GEOGRAPHICLIB_VERSION_MAJOR +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_maintainer_mode +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +with_sysroot +enable_libtool_lock +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures GeographicLib 1.34 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/geographiclib] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of GeographicLib 1.34:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot=DIR Search for dependent libraries within DIR + (or the compiler's sysroot if not specified). + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CXXCPP C++ preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +GeographicLib configure 1.34 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## --------------------------------- ## +## Report this to charles@karney.com ## +## --------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by GeographicLib $as_me 1.34, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if ${ac_cv_target+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + + + +am__api_version='1.12' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='geographiclib' + VERSION='1.34' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +GEOGRAPHICLIB_VERSION_MAJOR=1 +GEOGRAPHICLIB_VERSION_MINOR=34 +GEOGRAPHICLIB_VERSION_PATCH=0 + +cat >>confdefs.h <<_ACEOF +#define GEOGRAPHICLIB_VERSION_MAJOR $GEOGRAPHICLIB_VERSION_MAJOR +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define GEOGRAPHICLIB_VERSION_MINOR $GEOGRAPHICLIB_VERSION_MINOR +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define GEOGRAPHICLIB_VERSION_PATCH $GEOGRAPHICLIB_VERSION_PATCH +_ACEOF + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +ac_config_headers="$ac_config_headers include/GeographicLib/Config-ac.h" + + +LT_CURRENT=11 +LT_REVISION=1 +LT_AGE=1 + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from 'make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.2' +macro_revision='1.3337' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +$as_echo_n "checking for fgrep... " >&6; } +if ${ac_cv_path_FGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in fgrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if ${lt_cv_path_NM+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if ${lt_cv_nm_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if ${lt_cv_sys_max_cmd_len+:} false; then : + $as_echo_n "(cached) " >&6 +else + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +$as_echo_n "checking how to convert $build file names to $host format... " >&6; } +if ${lt_cv_to_host_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +$as_echo "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } +if ${lt_cv_to_tool_file_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +$as_echo "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +$as_echo_n "checking for $LD option to reload object files... " >&6; } +if ${lt_cv_ld_reload_flag+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test "$GCC" != yes; then + reload_cmds=false + fi + ;; + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if ${lt_cv_deplibs_check_method+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +$as_echo "$DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +$as_echo "$ac_ct_DLLTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +$as_echo_n "checking how to associate runtime and link libraries... " >&6; } +if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} +: ${AR_FLAGS=cru} + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +$as_echo_n "checking for archiver @FILE support... " >&6; } +if ${lt_cv_ar_at_file+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +$as_echo "$lt_cv_ar_at_file" >&6; } + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if ${lt_cv_sys_global_symbol_pipe+:} false; then : + $as_echo_n "(cached) " >&6 +else + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +$as_echo_n "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test "${with_sysroot+set}" = set; then : + withval=$with_sysroot; +else + with_sysroot=no +fi + + +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 +$as_echo "${with_sysroot}" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +$as_echo "${lt_sysroot:-no}" >&6; } + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if ${lt_cv_cc_needs_belf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +$as_echo "$MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if ${lt_cv_path_mainfest_tool+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +$as_echo "$lt_cv_path_mainfest_tool" >&6; } +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LIPO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if ${lt_cv_apple_cc_single_mod+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if ${lt_cv_ld_exported_symbols_list+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if ${lt_cv_ld_force_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + +fi + +done + + + + +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + pic_mode=default +fi + + +test -z "$pic_mode" && pic_mode=default + + + + + + + + # Check whether --enable-fast-install was given. +if test "${enable_fast_install+set}" = set; then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac +else + enable_fast_install=yes +fi + + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +$as_echo_n "checking for objdir... " >&6; } +if ${lt_cv_objdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if ${lt_cv_path_MAGIC_CMD+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/file; then + lt_cv_path_MAGIC_CMD="$ac_dir/file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +$as_echo "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if ${lt_cv_prog_compiler_pic_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath_+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if ${lt_cv_prog_compiler__b+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if ${lt_cv_irix_exported_symbol+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_irix_exported_symbol=yes +else + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +$as_echo "$lt_cv_irix_exported_symbol" >&6; } + if test "$lt_cv_irix_exported_symbol" = yes; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='${wl}-Blargedynsym' + ;; + esac + fi + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if ${ac_cv_lib_svld_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if ${ac_cv_lib_dld_dld_link+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes; then : + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +$as_echo_n "checking whether a program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if ${lt_cv_dlopen_self_static+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +if test -z "$CXXCPP"; then + if ${ac_cv_prog_CXXCPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CXXCPP needs to be expanded + for CXXCPP in "$CXX -E" "/lib/cpp" + do + ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CXXCPP=$CXXCPP + +fi + CXXCPP=$ac_cv_prog_CXXCPP +else + ac_cv_prog_CXXCPP=$CXXCPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } +ac_preproc_ok=false +for ac_cxx_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + _lt_caught_CXX_error=yes +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +archive_cmds_need_lc_CXX=no +allow_undefined_flag_CXX= +always_export_symbols_CXX=no +archive_expsym_cmds_CXX= +compiler_needs_object_CXX=no +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_direct_absolute_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +inherit_rpath_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +reload_flag_CXX=$reload_flag +reload_cmds_CXX=$reload_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + + # save warnings/boilerplate of simple test code + ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + + ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' + else + lt_prog_compiler_no_builtin_flag_CXX= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if ${lt_cv_path_LD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if ${lt_cv_prog_gnu_ld+:} false; then : + $as_echo_n "(cached) " >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + file_list_spec_CXX='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + export_dynamic_flag_spec_CXX='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + if ${lt_cv_aix_libpath__CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath__CXX"; then + lt_cv_aix_libpath__CXX="/usr/lib:/lib" + fi + +fi + + aix_libpath=$lt_cv_aix_libpath__CXX +fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + fi + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_CXX=' ' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=yes + file_list_spec_CXX='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' + enable_shared_with_static_runtimes_CXX=yes + # Don't use ranlib + old_postinstall_cmds_CXX='chmod 644 $oldlib' + postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec_CXX='' + fi + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi + + else + ld_shlibs_CXX=no + fi + + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + gnu*) + ;; + + haiku*) + archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs_CXX=yes + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_direct_absolute_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + interix[3-9]*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + inherit_rpath_CXX=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [1-5].* | *pgcpp\ [1-5].*) + prelink_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + old_archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + archive_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object_CXX=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + hardcode_direct_absolute_CXX=yes + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + ld_shlibs_CXX=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + case $host in + osf3*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + ;; + *) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac + + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ + '"$old_archive_cmds_CXX" + reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ + '"$reload_cmds_CXX" + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } + test "$ld_shlibs_CXX" = no && can_build_shared=no + + GCC_CXX="$GXX" + LD_CXX="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + # Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF + + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +case $host_os in +interix[3-9]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + compiler_lib_search_dirs_CXX= +if test -n "${compiler_lib_search_path_CXX}"; then + compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic_CXX='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static_CXX= + ;; + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix[4-9]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-qpic' + lt_prog_compiler_static_CXX='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +if ${lt_cv_prog_compiler_pic_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works_CXX=yes + fi + else + lt_cv_prog_compiler_static_works_CXX=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + case $host_os in + aix[4-9]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + ;; + esac + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +$as_echo "$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +with_gnu_ld_CXX=$with_gnu_ld + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc_CXX=no + else + lt_cv_archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } + archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if ${lt_cv_shlibpath_overrides_runpath+:} false; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || + test -n "$runpath_var_CXX" || + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +$as_echo "$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink || + test "$inherit_rpath_CXX" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + +# Checks for header files. +for ac_header in float.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" +if test "x$ac_cv_header_float_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_FLOAT_H 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { _Bool s: 1; _Bool t; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(_Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (_Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF + + +fi + + +if test $ac_cv_header_stdbool_h = yes; then + +$as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long double" >&5 +$as_echo_n "checking for long double... " >&6; } +if ${ac_cv_type_long_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$GCC" = yes; then + ac_cv_type_long_double=yes + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* The Stardent Vistra knows sizeof (long double), but does + not support it. */ + long double foo = 0.0L; +int +main () +{ +static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + sizeof (double) <= sizeof (long double))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_type_long_double=yes +else + ac_cv_type_long_double=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_double" >&5 +$as_echo "$ac_cv_type_long_double" >&6; } + if test $ac_cv_type_long_double = yes; then + +$as_echo "#define HAVE_LONG_DOUBLE 1" >>confdefs.h + + fi + + +# Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 +$as_echo_n "checking for working strtod... " >&6; } +if ${ac_cv_func_strtod+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_strtod=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +$ac_includes_default +#ifndef strtod +double strtod (); +#endif +int +main() +{ + { + /* Some versions of Linux strtod mis-parse strings with leading '+'. */ + char *string = " +69"; + char *term; + double value; + value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + return 1; + } + + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + return 1; + } + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strtod=yes +else + ac_cv_func_strtod=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 +$as_echo "$ac_cv_func_strtod" >&6; } +if test $ac_cv_func_strtod = no; then + case " $LIBOBJS " in + *" strtod.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strtod.$ac_objext" + ;; +esac + +ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" +if test "x$ac_cv_func_pow" = xyes; then : + +fi + +if test $ac_cv_func_pow = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 +$as_echo_n "checking for pow in -lm... " >&6; } +if ${ac_cv_lib_m_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_m_pow=yes +else + ac_cv_lib_m_pow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 +$as_echo "$ac_cv_lib_m_pow" >&6; } +if test "x$ac_cv_lib_m_pow" = xyes; then : + POW_LIB=-lm +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 +$as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} +fi + +fi + +fi + +for ac_func in strtol +do : + ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" +if test "x$ac_cv_func_strtol" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRTOL 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing floor" >&5 +$as_echo_n "checking for library containing floor... " >&6; } +if ${ac_cv_search_floor+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char floor (); +int +main () +{ +return floor (); + ; + return 0; +} +_ACEOF +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_floor=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_floor+:} false; then : + break +fi +done +if ${ac_cv_search_floor+:} false; then : + +else + ac_cv_search_floor=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_floor" >&5 +$as_echo "$ac_cv_search_floor" >&6; } +ac_res=$ac_cv_search_floor +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pow" >&5 +$as_echo_n "checking for library containing pow... " >&6; } +if ${ac_cv_search_pow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pow (); +int +main () +{ +return pow (); + ; + return 0; +} +_ACEOF +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_pow=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_pow+:} false; then : + break +fi +done +if ${ac_cv_search_pow+:} false; then : + +else + ac_cv_search_pow=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pow" >&5 +$as_echo "$ac_cv_search_pow" >&6; } +ac_res=$ac_cv_search_pow +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sqrt" >&5 +$as_echo_n "checking for library containing sqrt... " >&6; } +if ${ac_cv_search_sqrt+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sqrt (); +int +main () +{ +return sqrt (); + ; + return 0; +} +_ACEOF +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_sqrt=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_sqrt+:} false; then : + break +fi +done +if ${ac_cv_search_sqrt+:} false; then : + +else + ac_cv_search_sqrt=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sqrt" >&5 +$as_echo "$ac_cv_search_sqrt" >&6; } +ac_res=$ac_cv_search_sqrt +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +# Check endianness + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +# Check for doxygen. +# Need version 1.8.1.2 or later for greek and math symbols. +for ac_prog in doxygen +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_DOXYGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$DOXYGEN"; then + ac_cv_prog_DOXYGEN="$DOXYGEN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_DOXYGEN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DOXYGEN=$ac_cv_prog_DOXYGEN +if test -n "$DOXYGEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOXYGEN" >&5 +$as_echo "$DOXYGEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DOXYGEN" && break +done + + if test "$DOXYGEN" && test `"$DOXYGEN" --version | + sed 's/^\([0-9]\)\.\([0-9]\)\./\1.0\2./'` '>' 1.08.1.1; then + HAVE_DOXYGEN_TRUE= + HAVE_DOXYGEN_FALSE='#' +else + HAVE_DOXYGEN_TRUE='#' + HAVE_DOXYGEN_FALSE= +fi + + +for ac_prog in pod2man +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_POD2MAN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$POD2MAN"; then + ac_cv_prog_POD2MAN="$POD2MAN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_POD2MAN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +POD2MAN=$ac_cv_prog_POD2MAN +if test -n "$POD2MAN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POD2MAN" >&5 +$as_echo "$POD2MAN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$POD2MAN" && break +done + +for ac_prog in pod2html +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_POD2HTML+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$POD2HTML"; then + ac_cv_prog_POD2HTML="$POD2HTML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_POD2HTML="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +POD2HTML=$ac_cv_prog_POD2HTML +if test -n "$POD2HTML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POD2HTML" >&5 +$as_echo "$POD2HTML" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$POD2HTML" && break +done + +for ac_prog in col +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_COL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$COL"; then + ac_cv_prog_COL="$COL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_COL="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +COL=$ac_cv_prog_COL +if test -n "$COL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COL" >&5 +$as_echo "$COL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$COL" && break +done + + if test "$POD2MAN" -a "$POD2HTML" -a "$COL"; then + HAVE_PODPROGS_TRUE= + HAVE_PODPROGS_FALSE='#' +else + HAVE_PODPROGS_TRUE='#' + HAVE_PODPROGS_FALSE= +fi + + +ac_config_files="$ac_config_files Makefile src/Makefile include/Makefile tools/Makefile doc/Makefile man/Makefile matlab/Makefile python/Makefile cmake/Makefile examples/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then + as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_PODPROGS_TRUE}" && test -z "${HAVE_PODPROGS_FALSE}"; then + as_fn_error $? "conditional \"HAVE_PODPROGS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by GeographicLib $as_me 1.34, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +GeographicLib config.status 1.34 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' +predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' +predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' +postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' +reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' +reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +AR_FLAGS \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +nm_file_list_spec \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +reload_flag_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_pic_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_static_CXX \ +lt_cv_prog_compiler_c_o_CXX \ +export_dynamic_flag_spec_CXX \ +whole_archive_flag_spec_CXX \ +compiler_needs_object_CXX \ +with_gnu_ld_CXX \ +allow_undefined_flag_CXX \ +no_undefined_flag_CXX \ +hardcode_libdir_flag_spec_CXX \ +hardcode_libdir_separator_CXX \ +exclude_expsyms_CXX \ +include_expsyms_CXX \ +file_list_spec_CXX \ +compiler_lib_search_dirs_CXX \ +predep_objects_CXX \ +postdep_objects_CXX \ +predeps_CXX \ +postdeps_CXX \ +compiler_lib_search_path_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +reload_cmds_CXX \ +old_archive_cmds_CXX \ +old_archive_from_new_cmds_CXX \ +old_archive_from_expsyms_cmds_CXX \ +archive_cmds_CXX \ +archive_expsym_cmds_CXX \ +module_cmds_CXX \ +module_expsym_cmds_CXX \ +export_symbols_cmds_CXX \ +prelink_cmds_CXX \ +postlink_cmds_CXX; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "include/GeographicLib/Config-ac.h") CONFIG_HEADERS="$CONFIG_HEADERS include/GeographicLib/Config-ac.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "matlab/Makefile") CONFIG_FILES="$CONFIG_FILES matlab/Makefile" ;; + "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; + "cmake/Makefile") CONFIG_FILES="$CONFIG_FILES cmake/Makefile" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named 'Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running 'make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +# The names of the tagged configurations supported by this script. +available_tags="CXX " + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive. +AR_FLAGS=$lt_AR_FLAGS + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and in which our libraries should be installed. +lt_sysroot=$lt_sysroot + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects +postdep_objects=$lt_postdep_objects +predeps=$lt_predeps +postdeps=$lt_postdeps + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path + +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + +ltmain="$ac_aux_dir/ltmain.sh" + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + if test x"$xsi_shell" = xyes; then + sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ +func_dirname ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_basename ()$/,/^} # func_basename /c\ +func_basename ()\ +{\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ +func_dirname_and_basename ()\ +{\ +\ case ${1} in\ +\ */*) func_dirname_result="${1%/*}${2}" ;;\ +\ * ) func_dirname_result="${3}" ;;\ +\ esac\ +\ func_basename_result="${1##*/}"\ +} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ +func_stripname ()\ +{\ +\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ +\ # positional parameters, so assign one to ordinary parameter first.\ +\ func_stripname_result=${3}\ +\ func_stripname_result=${func_stripname_result#"${1}"}\ +\ func_stripname_result=${func_stripname_result%"${2}"}\ +} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ +func_split_long_opt ()\ +{\ +\ func_split_long_opt_name=${1%%=*}\ +\ func_split_long_opt_arg=${1#*=}\ +} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ +func_split_short_opt ()\ +{\ +\ func_split_short_opt_arg=${1#??}\ +\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ +} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ +func_lo2o ()\ +{\ +\ case ${1} in\ +\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ +\ *) func_lo2o_result=${1} ;;\ +\ esac\ +} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_xform ()$/,/^} # func_xform /c\ +func_xform ()\ +{\ + func_xform_result=${1%.*}.lo\ +} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_arith ()$/,/^} # func_arith /c\ +func_arith ()\ +{\ + func_arith_result=$(( $* ))\ +} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_len ()$/,/^} # func_len /c\ +func_len ()\ +{\ + func_len_result=${#1}\ +} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + +fi + +if test x"$lt_shell_append" = xyes; then + sed -e '/^func_append ()$/,/^} # func_append /c\ +func_append ()\ +{\ + eval "${1}+=\\${2}"\ +} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ +func_append_quoted ()\ +{\ +\ func_quote_for_eval "${2}"\ +\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ +} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: + + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 +$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} +fi + + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + + cat <<_LT_EOF >> "$ofile" + +# ### BEGIN LIBTOOL TAG CONFIG: CXX + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# How to create reloadable object files. +reload_flag=$lt_reload_flag_CXX +reload_cmds=$lt_reload_cmds_CXX + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds_CXX + +# A language specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU compiler? +with_gcc=$GCC_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_CXX + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \${shlibpath_var} if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute_CXX + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic_CXX + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds_CXX + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX + +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + +# Dependencies to place before and after the objects being linked to +# create a shared library. +predep_objects=$lt_predep_objects_CXX +postdep_objects=$lt_postdep_objects_CXX +predeps=$lt_predeps_CXX +postdeps=$lt_postdeps_CXX + +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=$lt_compiler_lib_search_path_CXX + +# ### END LIBTOOL TAG CONFIG: CXX +_LT_EOF + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/gtsam/3rdparty/GeographicLib/configure.ac b/gtsam/3rdparty/GeographicLib/configure.ac new file mode 100644 index 000000000..e9fb7b6f2 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/configure.ac @@ -0,0 +1,96 @@ +dnl +dnl Copyright (C) 2009, Francesco P. Lovergine + +AC_INIT([GeographicLib],[1.34],[charles@karney.com]) +AC_CANONICAL_SYSTEM +AC_PREREQ(2.61) +AC_CONFIG_SRCDIR(src/Geodesic.cpp) +AC_CONFIG_MACRO_DIR(m4) +AM_INIT_AUTOMAKE + +GEOGRAPHICLIB_VERSION_MAJOR=1 +GEOGRAPHICLIB_VERSION_MINOR=34 +GEOGRAPHICLIB_VERSION_PATCH=0 +AC_DEFINE_UNQUOTED([GEOGRAPHICLIB_VERSION_MAJOR], + [$GEOGRAPHICLIB_VERSION_MAJOR],[major version number]) +AC_DEFINE_UNQUOTED([GEOGRAPHICLIB_VERSION_MINOR], + [$GEOGRAPHICLIB_VERSION_MINOR],[minor version number]) +AC_DEFINE_UNQUOTED([GEOGRAPHICLIB_VERSION_PATCH], + [$GEOGRAPHICLIB_VERSION_PATCH],[patch number]) +AC_SUBST(GEOGRAPHICLIB_VERSION_MAJOR) +AC_SUBST(GEOGRAPHICLIB_VERSION_MINOR) +AC_SUBST(GEOGRAPHICLIB_VERSION_PATCH) + +dnl +dnl This directive is deprecated by someone, but I prefer to avoid +dnl running autotools if not required explicitly. The reason is +dnl the need to be in sync with autoconf/automake. +dnl +AM_MAINTAINER_MODE + +AC_CONFIG_HEADERS(include/GeographicLib/Config-ac.h) + +dnl Library code modified: REVISION++ +dnl Interfaces changed/added/removed: CURRENT++ REVISION=0 +dnl Interfaces added: AGE++ +dnl Interfaces removed: AGE=0 +LT_CURRENT=11 +LT_REVISION=1 +LT_AGE=1 +AC_SUBST(LT_CURRENT) +AC_SUBST(LT_REVISION) +AC_SUBST(LT_AGE) + +AC_ARG_PROGRAM +AC_PROG_CPP +AC_PROG_MAKE_SET +AC_PROG_INSTALL +AC_PROG_CXX +AC_PROG_LIBTOOL + +# Checks for header files. +AC_CHECK_HEADERS([float.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_HEADER_STDBOOL +AC_C_INLINE +AC_TYPE_LONG_DOUBLE + +# Checks for library functions. +AC_FUNC_STRTOD +AC_CHECK_FUNCS([strtol]) +AC_SEARCH_LIBS([floor],[m]) +AC_SEARCH_LIBS([pow],[m]) +AC_SEARCH_LIBS([sqrt],[m]) + +# Check endianness +AC_C_BIGENDIAN + +# Check for doxygen. +# Need version 1.8.1.2 or later for greek and math symbols. +AC_CHECK_PROGS([DOXYGEN], [doxygen]) +AM_CONDITIONAL([HAVE_DOXYGEN], + [test "$DOXYGEN" && test `"$DOXYGEN" --version | + sed 's/^\([[0-9]]\)\.\([[0-9]]\)\./\1.0\2./'` '>' 1.08.1.1]) + +AC_CHECK_PROGS([POD2MAN], [pod2man]) +AC_CHECK_PROGS([POD2HTML], [pod2html]) +AC_CHECK_PROGS([COL], [col]) +AM_CONDITIONAL([HAVE_PODPROGS], [test "$POD2MAN" -a "$POD2HTML" -a "$COL"]) + +dnl +dnl Add here new file to be generated +dnl +AC_CONFIG_FILES([ +Makefile +src/Makefile +include/Makefile +tools/Makefile +doc/Makefile +man/Makefile +matlab/Makefile +python/Makefile +cmake/Makefile +examples/Makefile +]) +AC_OUTPUT diff --git a/gtsam/3rdparty/GeographicLib/depcomp b/gtsam/3rdparty/GeographicLib/depcomp new file mode 100755 index 000000000..debb6ffa3 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/depcomp @@ -0,0 +1,707 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2012-03-27.16; # UTC + +# Copyright (C) 1999-2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' "$nl" < "$tmpdepfile" | +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependent.h'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'. + # However on + # $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\': + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + # tcc 0.9.26 (FIXME still under development at the moment of writing) + # will emit a similar output, but also prepend the continuation lines + # with horizontal tabulation characters. + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form 'foo.o: dependent.h', + # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'. + # Do two passes, one to just change these to + # '$object: dependent.h' and one to simply 'dependent.h:'. + sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \ + < "$tmpdepfile" > "$depfile" + sed ' + s/[ '"$tab"'][ '"$tab"']*/ /g + s/^ *// + s/ *\\*$// + s/^[^:]*: *// + /^$/d + /:$/d + s/$/ :/ + ' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' "$nl" < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/gtsam/3rdparty/GeographicLib/doc/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/doc/CMakeLists.txt new file mode 100644 index 000000000..7390a40fd --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/CMakeLists.txt @@ -0,0 +1,83 @@ +# Where the html versions of the man pages (extension .1.html) are +# found. +set (MANDIR ${PROJECT_BINARY_DIR}/man) + +# Build up a list of the .1.html files. +set (HTMLMAN) +foreach (TOOL ${TOOLS}) + set (HTMLMAN ${HTMLMAN} ${MANDIR}/${TOOL}.1.html) +endforeach () + +if (COMMON_INSTALL_PATH) + set (INSTALL_DOC_DIR "share/doc/GeographicLib") +else () + set (INSTALL_DOC_DIR "doc") +endif () + +# Run doxygen, if available + +# First assemble a list of all the files the documentation uses. Add a +# dependency on htmlman (from man/CMakeLists.txt). Use html/index.html +# as the make target. To make this target, copy the non-doxygen +# generated files into html/. Run doxfile.in thru cmake's config +# process so that absolute path names are used and so that the pathnames +# are properly stripped by doxygen (via STRIP_FROM_PATH). The +# distrib-doc target copies the html directory into the source tree. + +# If doxygen is not available, only the install step (from the source +# tree) is done. + +file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html-stage) +if (DOXYGEN_FOUND) + configure_file (doxyfile.in doxyfile) + configure_file (doxyfile-c.in doxyfile-c) + configure_file (doxyfile-for.in doxyfile-for) + configure_file (doxyfile-net.in doxyfile-net) + file (GLOB SOURCES + ../src/[A-Za-z]*.cpp ../include/GeographicLib/[A-Za-z]*.hpp + ../tools/[A-Za-z]*.cpp ../examples/[A-Za-z]*.cpp + ../legacy/C/*.[ch] ../legacy/Fortran/*.for ../legacy/Fortran/*.inc + ../dotnet/NETGeographicLib/*.cpp ../dotnet/NETGeographicLib/*.h + ../dotnet/examples/CS/*.cs ../dotnet/examples/ManagedCPP/*.cpp + ../dotnet/examples/VB/*.vb) + file (GLOB EXTRA_FILES ../maxima/[A-Za-z]*.mac + tmseries30.html geodseries30.html ../LICENSE.txt) + file (GLOB FIGURES *.png) + file (COPY ${EXTRA_FILES} DESTINATION html-stage) + add_custom_target (doc ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html) + add_dependencies (doc htmlman) + add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doxyfile + ${CMAKE_CURRENT_BINARY_DIR}/doxyfile-c + ${CMAKE_CURRENT_BINARY_DIR}/doxyfile-for + ${CMAKE_CURRENT_BINARY_DIR}/doxyfile-net + GeographicLib.dox geodesic-c.dox geodesic-for.dox NETGeographicLib.dox + ${SOURCES} ${EXTRA_FILES} ${FIGURES} ${HTMLMAN} + COMMAND ${CMAKE_COMMAND} -E remove_directory html + COMMAND ${CMAKE_COMMAND} -E copy_directory html-stage html + COMMAND ${DOXYGEN_EXECUTABLE} doxyfile > doxygen.log + COMMAND ${DOXYGEN_EXECUTABLE} doxyfile-c > doxygen-c.log + COMMAND ${DOXYGEN_EXECUTABLE} doxyfile-for > doxygen-for.log + COMMAND ${DOXYGEN_EXECUTABLE} doxyfile-net > doxygen-net.log + COMMENT "Generating html documentation tree") + install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html + DESTINATION ${INSTALL_DOC_DIR}) +else () + file (COPY ../LICENSE.txt DESTINATION html) + # Need to absolute path on destination to support old versions of cmake + configure_file (index.html.in html/index.html) + configure_file (utilities.html.in html/utilities.html) + install (FILES + ${CMAKE_CURRENT_BINARY_DIR}/html/LICENSE.txt + ${CMAKE_CURRENT_BINARY_DIR}/html/index.html + ${CMAKE_CURRENT_BINARY_DIR}/html/utilities.html + DESTINATION ${INSTALL_DOC_DIR}/html) +endif () + +# Finally install the JavaScript files +file (GLOB SCRIPTDRIVERS scripts/[A-Za-z]*.html) +file (GLOB JSSCRIPTS scripts/GeographicLib/[A-Za-z]*.js) +install (FILES ${SCRIPTDRIVERS} DESTINATION ${INSTALL_DOC_DIR}/scripts) +install (FILES ${JSSCRIPTS} + DESTINATION ${INSTALL_DOC_DIR}/scripts/GeographicLib) diff --git a/gtsam/3rdparty/GeographicLib/doc/GeographicLib.dox b/gtsam/3rdparty/GeographicLib/doc/GeographicLib.dox new file mode 100644 index 000000000..b0f980d19 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/GeographicLib.dox @@ -0,0 +1,5545 @@ +// -*- text -*- +/** + * \file GeographicLib.dox + * \brief Documentation for GeographicLib + * + * Written by Charles Karney and licensed under the + * MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +/** +\mainpage GeographicLib library +\author Charles F. F. Karney (charles@karney.com) +\version 1.34 +\date 2013-12-11 + +\section abstract Abstract + +%GeographicLib is a small set of C++ +classes for performing conversions between geographic, UTM, UPS, +MGRS, geocentric, and local cartesian coordinates, for gravity (e.g., +EGM2008), geoid height and geomagnetic field (e.g., WMM2010) +calculations, and for solving geodesic problems. The emphasis is on +returning accurate results with errors close to round-off (about 5--15 +nanometers). New accurate algorithms for \ref geodesic and \ref +transversemercator have been developed for this library. The +functionality of the library can be accessed from user code, from the +\ref utilities provided, or via the \ref other. Also included is a .NET +wrapper library NETGeographicLib +which exposes the functionality to .NET applications. For a sample of +the geodesic capabilities in JavaScript, check out the +online geodesic calculator and +the script for displaying +geodesics in Google Maps + +This library is not a general purpose projection library; use +proj.4 for that. On the other +hand, it does provide the core functionality offered by +GEOTRANS. + +\section download Download + +The main project page is at +- + http://sourceforge.net/projects/geographiclib +. +The code is available for download at +- + GeographicLib-1.34.tar.gz +- + GeographicLib-1.34.zip +. +as either a compressed tar file (tar.gz) or a zip file. (The two +archives have identical contents, except that the zip file has DOS +line endings.) Alternatively you can get the latest release using git +\verbatim + git clone -b r1.34 git://git.code.sf.net/p/geographiclib/code geographiclib +\endverbatim +There are also binary installers for Windows available at +- + GeographicLib-1.34-win32.exe +- + GeographicLib-1.34-win64.exe +. +It is licensed under the +MIT/X11 License; +see LICENSE.txt for the terms. +For more information, see http://geographiclib.sourceforge.net/. + +\section contents Contents + - \ref intro + - \ref install + - \ref start + - \ref utilities + - \ref organization + - \ref other + - \ref geoid + - \ref gravity + - \ref magnetic + - \ref geodesic + - \ref triaxial + - \ref transversemercator + - \ref geocentric + - \ref old + +
+Forward to \ref intro. +
+ +**********************************************************************/ +/** +\page intro Introduction + +
+Forward to \ref install. Up to \ref contents. +
+ +%GeographicLib offers a C++ interfaces to a small (but important!) set +of geographic transformations. It grew out of a desire to improve on +the geotrans +package for transforming between geographic and MGRS coordinates. At +present, %GeographicLib provides UTM, UPS, MGRS, geocentric, and local +cartesian projections, gravity and geomagnetic models, and classes for +geodesic calculations. + +The goals of %GeographicLib are: + - Accuracy. In most applications the accuracy is close to round-off, + about 5 nm (5 nanometers). Even though in many geographic + applications 1 cm is considered "accurate enough", there is little + penalty in providing much better accuracy. In situations where a + faster approximate algorithm is necessary, %GeographicLib offers an + accurate benchmark to guide the development. + - Completeness. For each of the projections included, an attempt is + made to provide a complete solution. For example, + GeographicLib::Geodesic::Inverse works for anti-podal points. + Similarly, GeographicLib::Geocentric.Reverse will return accurate + geodetic coordinates even for points close to the center of the + earth. + - C++ interface. For the projection methods, this allows encapsulation + of the ellipsoid parameters. + - Emphasis on projections necessary for analyzing military data. + - Uniform treatment of UTM/UPS. The GeographicLib::UTMUPS class treats + UPS as zone 0. This simplifies conversions between UTM and UPS + coordinates, etc. + - Well defined and stable conventions for the conversion between + UTM/UPS to MGRS coordinates. + - Detailed internal documentation on the algorithms. For the most part + %GeographicLib uses published algorithms and references are given. If + changes have been made (usually to improve the numerical accuracy), + these are described in the code. + +Various \ref utilities are provided with the library. These illustrate +the use of the library and are useful in their own right. This library +and the utilities have been tested with g++ 4.4 under Linux, with g++ +4.2 under Mac OS X, and with MS Visual Studio 9 (2008), 10 (2010), 11 +(2012), and 12 (2013) compiled for 32 bit and 64 bit. + +Matlab, JavaScript, and Python interfaces are provided to portions of +%GeographicLib; see \ref other. + +The section \ref geodesic documents the method of solving the geodesic +problem. + +The section \ref transversemercator documents various properties of this +projection. + +The bulk of the testing has used geographically relevant values of the +flattening. Thus, you can expect close to full accuracy for -0.01 ≤ +\e f ≤ 0.01 (but note that GeographicLib::TransverseMercatorExact is +restricted to \e f > 0). However, reasonably accurate results can be +expected if -0.1 ≤ \e f ≤ 0.1. Outside this range, you should +attempt to verify the accuracy of the routines independently. Two types +of problems may occur with larger values of \e f: + - Some classes, specifically GeographicLib::Geodesic, + GeographicLib::GeodesicLine, and GeographicLib::TransverseMercator, + use series expansions using \e f as a small parameter. The accuracy + of these routines will degrade as \e f becomes large. + - Even when exact formulas are used, many of the classes need to invert + the exact formulas (e.g., to invert a projection), typically, using + Newton's method. This usually provides an essentially exact + inversion. However, the choice of starting guess and the exit + conditions have been tuned to cover small values of \e f and the + inversion may be incorrect if \e f is large. + +Undoubtedly, bugs lurk in this code and in the documentation. Please +report any you find to charles@karney.com. + +
+Forward to \ref install. Up to \ref contents. +
+**********************************************************************/ +/** +\page install Installing %GeographicLib + +
+Back to \ref intro. Forward to \ref start. Up to \ref contents. +
+ +%GeographicLib has been developed under Linux with the g++ compiler +(versions 4.0 and later) and under Windows with Visual Studio 2005, 2008, +and 2010. Earlier versions were tested also under Darwin and Solaris. It +should compile on a wide range of other systems. First download either + +GeographicLib-1.34.tar.gz or + +GeographicLib-1.34.zip (or + +GeographicLib-1.34-win32.exe or + +GeographicLib-1.34-win64.exe for binary installation under Windows). +Then pick one of the first five options below: +- \ref cmake. This is the preferred installation method as it will work + on the widest range of platforms. However it requires that you have + cmake installed. +- \ref autoconf. This method works for most Unix-like systems, + including Linux and Mac OS X. +- \ref gnu. This is a simple installation method that works with g++ + and GNU make on Linux and many Unix platforms. +- \ref windows. This is a simple installation method that works with + Visual Studio 2005, 2008, and 2010 under Windows. +- \ref windowsbin. Use this installation method if you only need to use + the \ref utilities supplied with %GeographicLib. (This method also + installs the header files and the library for use by Visual Studio 10.) +- \ref qt. How to compile %GeographicLib so that it can be used by Qt + programs. +- \ref maintainer. This describes addition tasks of interest only to + the maintainers of this code. +. +This section documents only how to install the software. If you +wish to use %GeographicLib to evaluate geoid heights or the earth's +gravitational or magnetic fields, then you must also install the +relevant data files. See \ref geoidinst, \ref gravityinst, and \ref +magneticinst for instructions. + +The first two installation methods use two important techniques which +make software maintanence simpler +- Out-of-source builds: This means that you create a separate + directory for compiling the code. In the description here the + directories are called BUILD and are located in the top-level of the + source tree. You might want to use a suffix to denote the type of + build, e.g., BUILD-vc9 for Visual Studio 9, or BUILD-shared for a + build which creates a shared library. The advantages of out-of-source + builds are: + - You don't mess up the source tree, so it's easy to "clean up". + Indeed the source tree might be on a read-only file system. + - Builds for multiple platforms or compilers don't interfere with each + other. +- The library is installed: After compilation, there is a + separate install step which copies the headers, libraries, + tools, and documentation to a "central" location. You may at this + point delete the source and build directories. If you have + administrative privileges, you can install %GeographicLib for the use + of all users (e.g., in /usr/local). Otherwise, you can install it for + your personal use (e.g., in $HOME/packages). + +\section cmake Installation with cmake + +This is the recommended method of installation; however it requires that +cmake be installed on your system. +This permits %GeographicLib to be built either as a shared or a static +library on a wide variety of systems. cmake can also determine the +capabilities of your system and adjust the compilation of the +libraries and examples appropriately. + +cmake is available for most computer platforms. On Linux systems cmake +will typically one of the standard packages and can be installed by a +command like + \verbatim + yum install cmake \endverbatim +(executed as root). The minimum version of cmake supported for building +%GeographicLib is 2.8.4 (which was released on 2011-02-16). (Actually, +a few earlier versions will also work for non-Windows platforms.) + +On other systems, download a binary installer from http://www.cmake.org +click on download, and save and run the appropriate installer. Run the +cmake command with no arguments to get help. Other useful tools are +ccmake and cmake-gui which offer curses and graphical interfaces to +cmake. Building under cmake depends on whether it is targeting an IDE +(interactive development environment) or generating Unix-style +makefiles. The instructions below have been tested with makefiles and +g++ on Linux and with the Visual Studio IDE on Windows. + +Here are the steps to compile and install %GeographicLib: +- Unpack the source, running one of \verbatim + tar xfpz GeographicLib-1.34.tar.gz + unzip -q GeographicLib-1.34.zip \endverbatim + then enter the directory created with one of \verbatim + cd GeographicLib-1.34 \endverbatim +- Create a separate build directory and enter it, for example, \verbatim + mkdir BUILD + cd BUILD \endverbatim +- Run cmake, pointing it to the source directory (..). On Linux, Unix, + and MacOSX systems, the command is \verbatim + cmake .. \endverbatim + For Windows, the command is typically one of \verbatim + cmake -G "Visual Studio 10" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10/GeographicLib-1.34 .. + cmake -G "Visual Studio 9 2008" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc9/GeographicLib-1.34 .. +\endverbatim + The definitions of CMAKE_INSTALL_PREFIX are optional (see below). The + settings given above are recommended to ensure that packages that use + %GeographicLib use the version compiled with the right compiler. + If you need to rerun cmake, use \verbatim + cmake . \endverbatim + possibly including some options via -D (see the next step). +- cmake allows you to configure how %GeographicLib is built and installed by + supplying options, for example \verbatim + cmake -D CMAKE_INSTALL_PREFIX=/tmp/geographic . \endverbatim + The options you might need to change are + - COMMON_INSTALL_PATH governs the installation + convention. If it is on ON (the Linux default), the installation + is to a common directory, e.g., /usr/local. If it is OFF (the + Windows default), the installation directory contains the package + name, e.g., C:/pkg/GeographicLib-1.34. The installation + directories for the documentation, cmake configuration, python and + matlab interfaces all depend on the variable with deeper paths + relative to CMAKE_INSTALL_PREFIX being used when it's ON: + - documentation: OFF: doc/html; ON: share/doc/GeographicLib/html; + - cmake configuration: OFF cmake; ON: share/cmake/GeographicLib; + - python interface: OFF: python; ON: lib/python/site-packages; + - matlab interface: OFF: matlab; ON: libexec/GeographicLib/matlab; + . + - CMAKE_INSTALL_PREFIX (default: /usr/local + on non-Windows systems, C:/Program Files/GeographicLib + on Windows systems) specifies where the library will be installed. + For windows systems, it is recommended to use a prefix which + includes the compiler version, as shown above (and also, possibly, + whether this is a 64-bit build, e.g., cmake -G "Visual Studio + 10 Win64" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10-x64/GeographicLib-1.34 + ..). If you just want to try the library to see if it suits + your needs, pick, for example, + CMAKE_INSTALL_PREFIX=/tmp/geographic. + - GEOGRAPHICLIB_DATA (default: + /usr/local/share/GeographicLib for non-Windows systems, + C:/Documents and Settings/All Users/Application + Data/GeographicLib for Windows systems) specifies the default + location for the various datasets for use by GeographicLib::Geoid, + GeographicLib::GravityModel, and GeographicLib::MagneticModel. + See \ref geoidinst, \ref gravityinst, and \ref magneticinst for more + information. + - GEOGRAPHICLIB_LIB_TYPE (allowed values: SHARED, STATIC, or + BOTH), specifies the types of libraries build. The default is + STATIC for Windows and SHARED otherwise. If building %GeographicLib + for sytem-wide use, BOTH is recommended, because this provides users + with the choice of which library to use. + - CMAKE_BUILD_TYPE (default: Release). This + flags only affects non-IDE compile environments (like make + g++). + The default is actually blank, but this is treated as + Release. Choose one of + \verbatim + Debug + Release + RelWithDebInfo + MinSizeRel +\endverbatim + (With IDE compile environments, you get to select the build type in + the IDE.) + - MATLAB_COMPILER (default: OFF). Set this to either + "mex" (for Matlab) or "mkoctfile" (for Octave) to specify the + compiler to use for the Matlab/Octave interface. See \ref matlab + for more information. + - GEOGRAPHICLIB_DOCUMENTATION (default: OFF). If set to + ON, then html documentation is created from the source files, + provided a sufficiently recent version of doxygen can be found. + Otherwise, the html documentation will redirect to the appropriate + version of the online documentation. + - BUILD_NETGEOGRAPHICLIB (default: OFF). If set to ON, + build the managed C++ wrapper library + NETGeographicLib. This only makes + sense for Windows systems. + - GEOGRAPHICLIB_PRECISION specifies the precision to be + used for "real" (i.e., floating point) numbers. 1 means float + (single precision); 2 (the default) means double; 3 means long + double; 4 is reserved for quadruple precision. Nearly all the + testing has been carried out with doubles and that's the + recommended configuration. In particular you should avoid + "installing" the library with a precision different from double. +- Build and install the software. In non-IDE environments, run + \verbatim + make # compile the library and the examples + make test # run some tests + make install # as root, if CMAKE_INSTALL_PREFIX is a system directory +\endverbatim + Possible additional targets are \verbatim + make matlabinterface (only for the Release configuration on Windows) + make dist + make exampleprograms + make netexamples (supported only for Release configuration) \endverbatim + On IDE environments, run your IDE (e.g., Visual Studio), load + GeographicLib.sln, pick the build type (e.g., Release), and select + "Build Solution". If this succeeds, select "RUN_TESTS" to build; + finally, select "INSTALL" to install (RUN_TESTS and INSTALL are in + the CMakePredefinedTargets folder). Alternatively, you run the + Visual Studio compiler from the command line with \verbatim + cmake --build . --config Release --target ALL_BUILD + cmake --build . --config Release --target RUN_TESTS + cmake --build . --config Release --target INSTALL \endverbatim + For maximum flexibility, it's a good idea to build and install both + the Debug and Release versions of the library (in that order). The + installation directories will then contain the release versions of the + tools and both versions (debug and release) of the libraries. + If you use cmake to configure and build your programs, then the right + version of the library (debug vs. release) will automatically be used. +- The headers, library, and utilities are installed in the + include/GeographicLib, lib, and bin directories under + CMAKE_INSTALL_PREFIX. (dll dynamic libraries are + installed in bin.) For documentation, open in a web browser + + PREFIX/share/doc/GeographicLib/html/index.html, if + COMMON_INSTALL_PATH is ON, or + PREFIX/doc/index.html, otherwise. + +\section autoconf Installation using the autoconfigure tools + +The method works on most Unix-like systems including Linux and Mac OS X. +Here are the steps to compile and install %GeographicLib: +- Unpack the source, running \verbatim + tar xfpz GeographicLib-1.34.tar.gz \endverbatim + then enter the directory created \verbatim + cd GeographicLib-1.34 \endverbatim +- Create a separate build directory and enter it, for example, \verbatim + mkdir BUILD + cd BUILD \endverbatim +- Configure the software, specifing the path of the source directory, + with \verbatim + ../configure \endverbatim +- By default %GeographicLib will be installed under /usr/local. + You can change this with, for example \verbatim + ../configure --prefix=/tmp/geographic \endverbatim +- Compile and install the software with \verbatim + make + make install \endverbatim +- The headers, library, and utilities are installed in the + include/GeographicLib, lib, and bin directories under + prefix. This installation method does not compile + the Matlab/Octave interface; however the source for the interface is + installed in libexec/GeographicLib/matlab, see \ref matlab of + instructions on compiling the interface. For documentation, open + + share/doc/GeographicLib/html/index.html in a web browser. + +\section gnu Installation with GNU compiler and Make + +This method requires the standard GNU suite of tools, in particular make +and g++. This builds a static library and the examples. + +Here are the steps to compile and install %GeographicLib: +- Unpack the source, running \verbatim + tar xfpz GeographicLib-1.34.tar.gz \endverbatim + then enter the directory created \verbatim + cd GeographicLib-1.34 \endverbatim +- Edit \verbatim + include/GeographicLib/Config.h \endverbatim + If your C++ compiler does not recognize the long double type + (unlikely), insert \code + #undef HAVE_LONG_DOUBLE \endcode + If your machine using big endian ordering, then insert \code + #define WORDS_BIGENDIAN 1 \endcode +- Build and install the software: \verbatim + make # compile the library and the examples + make install # as root \endverbatim + The installation is in directories under /usr/local. You + can specify a different installation directory with, for example, + \verbatim + make PREFIX=/tmp/geographic install \endverbatim +- The headers, library, and utilities are installed in the + include/GeographicLib, lib, and bin directories under + PREFIX. This installation method does not compile + the Matlab/Octave interface; however the source for the interface is + installed in libexec/GeographicLib/matlab, see \ref matlab of + instructions on compiling the interface. For documentation, open + + share/doc/GeographicLib/html/index.html in a web browser. + +\section windows Installation on Windows + +This method requires Visual Studio 2005, 2008, or 2010. This builds a +static library and the utilities. If you only have Visual Studio 2003, +use cmake to create the necessary solution file, see \ref cmake. (cmake +is needed to build the Matlab interface and to run the tests.) +- Unpack the source, running \verbatim + unzip -q GeographicLib-1.34.zip \endverbatim +- Open GeographicLib-1.34/windows/GeographicLib-vc10.sln in Visual Studio + 2010 (for Visual Studio 2005 and 2008, replace -vc10 by -vc8 or -vc9). +- Pick the build type (e.g., Release), and select "Build Solution". +- The library and the compiled examples are in the windows/Release. +- Copy the library windows/Release/GeographicLib.lib and the + headers in include/GeographicLib somewhere convenient. The + headers should remain in a directory named %GeographicLib. If you + expect to use the Matlab/Octave interface, copy matlab/*.m and + matlab/*.cpp to a directory in your matlab/octave path, see \ref + matlab for instructions on compiling the interface. For documentation, + open + doc/html/index.html in a web + browser. + +The Visual Studio 10 solution also contains projects to build +NETGeographicLib and the C# example project. + +\section windowsbin Using a binary installer for Windows + +Use this method if you only need to use the %GeographicLib utilities. +The header files and static and shared versions of library are also +provided; these can only be used by Visual Studio 2010 (in either +release or debug mode). However, if you plan to use the library, it may +be advisable to build it with the compiler you are using for your own +code using either \ref cmake or \ref windows. + +Download and run + +GeographicLib-1.34-win32.exe or + +GeographicLib-1.34-win64.exe: + - read the MIT/X11 License agreement, + - select whether you want your PATH modified, + - select the installation folder, by default + C:\\pkg-vc10\\GeographicLib-1.34 or C:\\pkg-vc10-x64\\GeographicLib-1.34, + - select the start menu folder, + - and install. + . +(Note that the default installation folder adheres the the convention +given in \ref cmake.) The start menu will now include links to the +documentation for the library and for the utilities (and a link for +uninstalling the library). If you ask for your PATH to be modified, it +will include C:/pkg-vc10/GeographicLib-1.34/bin where the utilities are +installed. The headers and library are installed in the +include/GeographicLib and lib folders. With the 64-bit installer, the +Matlab interface is installed in the matlab folder. Add this to your +path in Matlab to access this interface. The libraries were built using +using Visual Studio 10 in release and debug modes. The utilities were +linked against the release-mode shared library. The Matlab interface +was compiled with Matlab R2013a 64-bit, however it may work with some +other 64-bit versions of Matlab. +NETGeographicLib library dlls (release and +debug) are included with the binary installers; these are linked against +the shared library for %GeographicLib. + +\section qt Building the library for use with Qt + +If Qt is using a standard compiler, then build %GeographicLib with that +same compiler (and optimization flags) as Qt. + +If you are using the mingw compiler on Windows for Qt, then you need to +build %GeographicLib with mingw. You can accomplish this with cmake +under cygwin with, for example, \verbatim + export PATH="`cygpath -m c:/QtSDK/mingw/bin`:$PATH" + mkdir BUILD + cd BUILD + cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=C:/pkg-mingw/GeographicLib .. + mingw32-make + mingw32-make install \endverbatim +If cmake complains that sh mustn't be in your path, invoke cmake with +\verbatim + env PATH="$( echo $PATH | tr : '\n' | + while read d; do test -f "$d/sh.exe" || echo -n "$d:"; done | + sed 's/:$//' )" \ + cmake -G "MinGW Makefiles" -D CMAKE_INSTALL_PREFIX=C:/pkg-mingw/GeographicLib .. +\endverbatim +If cmake is not available, there is a simple project file that compiles +the %GeographicLib library only with the Qt compiler: \verbatim + cd src + qmake GeographicLib.pro # configure the project + make # build the library \endverbatim +The library will be in the src directory (or the src/release or +src/debug directory under Windows). The headers are in +include/GeographicLib. + +\section maintainer Maintainer tasks + +Check the code out of git with \verbatim + git clone -b master git://git.code.sf.net/p/geographiclib/code geographiclib +\endverbatim +Here the "master" branch is checked out. There are three branches in +the git repository: +- master: the main branch for code maintainence. Releases are + tagged on this branch as, e.g., v1.34. +- devel: the development branch; changes made here are merged + into master. +- release: the release branch created by unpacking the source + releases (git is \e not used to merge changes from the other + branches into this branch). This is the \e default branch of the + repository (the branch you get if cloning the repository without + specifying a branch). This differs from the master branch in that + some administrative files are excluded while some intermediate files + are included (in order to aid building on as many platforms as + possible). Releases are tagged on this branch as, e.g., r1.34. +. +The autoconf configuration script and the formatted man pages are not +checked into master branch of the repository. In order to create the +autoconf configuration script, run \verbatim + sh autogen.sh \endverbatim +in the top level directory. Provided you are running on a system with +doxygen, pod2man, and pod2html installed, then you can create the +documentation and the man pages by building the system using cmake or +configure. + +In the case of cmake, you then run \verbatim + make dist \endverbatim +which will copy the man pages from the build directory back into the +source tree and package the resulting source tree for distribution as +\verbatim + GeographicLib-1.34.tar.gz + GeographicLib-1.34.zip \endverbatim +Finally, \verbatim + make package \endverbatim +or building PACKAGE in Visual Studio will create a binary installer for +%GeographicLib. For Windows, this requires in the installation of +NSIS. On Windows, you should +configure %GeographicLib with PACKAGE_DEBUG_LIBS=ON, build both +Release and Debug versions of the library and finally build PACKAGE in +Release mode. This will get the release and debug versions of the +library included in the package. For example, the 64-bit binary +installer is created with \verbatim + cmake -G "Visual Studio 10 Win64" \ + -D GEOGRAPHICLIB_LIB_TYPE=BOTH \ + -D PACKAGE_DEBUG_LIBS=ON \ + -D MATLAB_COMPILER=mex \ + -D BUILD_NETGEOGRAPHICLIB=ON \ + .. + cmake --build . --config Debug --target ALL_BUILD + cmake --build . --config Release --target ALL_BUILD + cmake --build . --config Release --target matlabinterface + cmake --build . --config Release --target PACKAGE \endverbatim + +With configure, run \verbatim + make dist-gzip \endverbatim +which will create the additional files and packages the results ready +for distribution as \verbatim + geographiclib-1.34.tar.gz \endverbatim + +
+Back to \ref intro. Forward to \ref start. Up to \ref contents. +
+**********************************************************************/ +/** +\page start Getting started + +
+Back to \ref install. Forward to \ref utilities. Up to \ref contents. +
+ +Much (but not all!) of the useful functionality of %GeographicLib is +available via simple command line utilities. Interfaces to some of them +are available via the web. See \ref utilities for documentation on +these. + +In order to use %GeographicLib from C++ code, you will need to +- Include the header files for the %GeographicLib classes in your code. + E.g., \code + #include \endcode +- Include the GeographicLib:: namespace prefix to the %GeographicLib classes, + or include \code + using namespace GeographicLib; \endcode + in your code. +- Finally compile and link your code. You have two options here. + - Use cmake to build your package. If you are familiar with cmake + this typically will be far the simplest option. + - Set the include paths and linking options "manually". +- Building your code with cmake. In brief, the necessary steps are: + - include in your CMakeLists.txt files \verbatim + find_package (GeographicLib 1.34 REQUIRED) + include_directories (${GeographicLib_INCLUDE_DIRS}) + add_definitions (${GeographicLib_DEFINITIONS}) + add_executable (program source1.cpp source2.cpp) + target_link_libraries (program ${GeographicLib_LIBRARIES}) \endverbatim + (The add_definitions line is only needed for Windows + and can be omitted if you're using cmake version 2.8.11 or later.) + - configure your package, e.g., with \verbatim + mkdir BUILD + cd BUILD + cmake -G "Visual Studio 10" \ + -D CMAKE_PREFIX_PATH=C:/pkg-vc10 \ + -D CMAKE_PREFIX_PATH=C:/pkg-vc10/testgeographic \ + .. \endverbatim + Note that you almost always want to configure and build your code + somewhere other than the source directory (in this case, we use the + BUILD subdirectory). + - build your package. On Linux and MacOS this usually involves just + running make. On Windows, you can load the solution file created by + cmake into Visual Studio; alternatively, you can get cmake to run + build your code with \verbatim + cmake --build . --config Release --target ALL_BUILD \endverbatim + You might also want to install your package (using "make install" or + build the "INSTALL" target with the command above). + . + The most import step is the find_package command. The cmake + documentation describes the locations searched by find_package (the + appropriate rule for %GeographicLib are those for "Config" mode lookups). + In brief, the locations that are searched are (from least specific to + most specific, i.e., in reverse order) are + - under the system paths, i.e., locations such as C:/Program + Files and /usr/local); + - frequently, it's necessary to search within a "package directory" + (or set of directories) for external dependencies; this is given by + a (semicolon separated) list of directories specified by the cmake + variable CMAKE_PREFIX_PATH (illustrated above); + - the package directory for %GeographicLib can be overridden with the + environment variable GeographicLib_DIR (which is the + directory under which %GeographicLib is installed); + - finally, if you need to point to a particular build of %GeographicLib, + define the cmake variable GeographicLib_DIR, which + specifies the directory containing the configuration file + geographiclib-config.cmake (for debugging this be the + top-level build directory, as opposed to installation + directory, for %GeographicLib). + . + Typically, specifying nothing or CMAKE_PREFIX_PATH + suffices. However the two GeographicLib_DIR variables allow + for a specific version to be chosen. On Windows systems (with Visual + Studio), find_package will only find versions of %GeographicLib built with + the right version of the compiler. (If you used a non-cmake method of + installing %GeographicLib, you can try copying cmake/FindGeographicLib.cmake + to somewhere in your CMAKE_MODULE_PATH in order for + find_package to work. However, this method has not been thoroughly + tested.) + + If %GeographicLib is found, then the following cmake variables are set: + - GeographicLib_FOUND = 1 + - GeographicLib_VERSION = 1.34 + - GeographicLib_INCLUDE_DIRS + - GeographicLib_LIBRARIES = one of the following two: + - GeographicLib_SHARED_LIBRARIES = %GeographicLib + - GeographicLib_STATIC_LIBRARIES = GeographicLib_STATIC + - GeographicLib_DEFINITIONS = one of the following two: + - GeographicLib_SHARED_DEFINITIONS = -DGEOGRAPHICLIB_SHARED_LIB=1 + - GeographicLib_STATIC_DEFINITIONS = -DGEOGRAPHICLIB_SHARED_LIB=0 + - GeographicLib_LIBRARY_DIRS + - GeographicLib_BINARY_DIRS + . + Either of GeographicLib_SHARED_LIBRARIES or + GeographicLib_STATIC_LIBRARIES may be empty, if that version + of the library is unavailable. If you require a specific version, + SHARED or STATIC, of the library, add a COMPONENTS clause + to find_package, e.g., + \verbatim + find_package (GeographicLib 1.34 REQUIRED COMPONENTS SHARED) \endverbatim + causes only packages which include the shared library to be found. If + the package includes both versions of the library, then + GeographicLib_LIBRARIES and + GeographicLib_DEFINITIONS are set to the shared versions, + unless you include \verbatim + set (GeographicLib_USE_STATIC_LIBS ON) \endverbatim + before the find_package command. You can check whether + GeographicLib_LIBRARIES refers to the shared or static + library with \verbatim + get_target_property(_LIBTYPE ${GeographicLib_LIBRARIES} TYPE) \endverbatim + which results in _LIBTYPE being set to + SHARED_LIBRARY or STATIC_LIBRARY. + On Windows, cmake takes care of linking to the release or debug + version of the library as appropriate. (This assumes that the Release + and Debug versions of the libraries were built and installed. This is + true for the Windows binary installer for %GeographicLib version 1.34 and + later.) +- Here are the steps to compile and link your code using %GeographicLib + "manually". + - Tell the compiler where to find the header files. With g++ and with + /usr/local specified as the installation directory, + this is accomplished with \verbatim + g++ -c -g -O3 -funroll-loops -I/usr/local/include testprogram.cpp + \endverbatim + With Visual Studio, specify the include directory in the IDE via, + e.g., + \verbatim + C/C++ -> General -> Additional Include Directories = C:\pkg-vc10\GeographicLib\include + \endverbatim + - If using the shared (or static) library with Visual Studio, define + the macro GEOGRAPHICLIB_SHARED_LIB=1 (or + 0), e.g., + \verbatim + C/C++ -> Preprocessor -> Preprocessor Definitions = GEOGRAPHICLIB_SHARED_LIB=1 + \endverbatim + This is only needed for Windows systems when both shared and static + libraries have been installed. (If you configure your package with + cmake, this definition is added automatically.) + - Tell the linker the name, Geographic, and location of the + library. Using g++ as the linker, you would use \verbatim + g++ -g -o testprogram testprogram.o -L/usr/local/lib -lGeographic + \endverbatim + With Visual Studio, you supply this information in the IDE via, + e.g., \verbatim + Linker -> Input -> Additional Dependencies = Geographic-i.lib (for shared library) + Linker -> Input -> Additional Dependencies = Geographic.lib (for static library) + Linker -> General -> Additional Library Directories = C:\pkg-vc10\Geographic\lib + \endverbatim + Note that the library name is Geographic and not + %GeographicLib. For the Debug version of your program on Windows + add "_d" to the library, e.g., Geographic_d-i.lib or + Geographic_d.lib. + - Tell the runtime environment where to find the shared library + (assuming you compiled %Geographic as a shared library). With g++, + this is accomplished by modifying the link line above to read \verbatim + g++ -g -o testprogram testprogram.o -Wl,-rpath=/usr/local/lib \ + -L/usr/local/lib -lGeographic + \endverbatim + (There are two other ways to specify the location of shared libraries + at runtime: (1) define the environment variable + LD_LIBRARY_PATH to be a colon-separated list of + directories to search; (2) as root, specify /usr/local/lib as a + directory searched by ldconfig(8).) On Windows, you need to ensure + that Geographic.dll or Geographic_d.dll is in the same directory as + your executable or else include the directory containing the dll in + your PATH. + +Here is a very simple test code, which uses the GeographicLib::Geodesic +class: +\include example-Geodesic-small.cpp +This example is examples/example-Geodesic-small.cpp. If you +compile, link, and run it according to the instructions above, it should +print out \verbatim + 5551.76 km \endverbatim +Here is a complete CMakeList.txt files you can use to build this test +code using the installed library: \verbatim +project (geodesictest) +cmake_minimum_required (VERSION 2.8.4) + +find_package (GeographicLib 1.34 REQUIRED) + +if (NOT MSVC) + set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +endif () + +include_directories (${GeographicLib_INCLUDE_DIRS}) +add_definitions (${GeographicLib_DEFINITIONS}) +add_executable (${PROJECT_NAME} example-Geodesic-small.cpp) +target_link_libraries (${PROJECT_NAME} ${GeographicLib_LIBRARIES}) + +if (MSVC) + get_target_property (_LIBTYPE ${GeographicLib_LIBRARIES} TYPE) + if (_LIBTYPE STREQUAL "SHARED_LIBRARY") + # On Windows systems, copy the shared library to build directory + add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + copy $ ${CMAKE_CFG_INTDIR} + COMMENT "Copying shared library for GeographicLib") + endif () +endif () \endverbatim + +The next steps are: + - Learn about and run the \ref utilities. + - Read the section, \ref organization, for an overview of the library. + - Browse the Class List for full documentation + on the classes in the library. + - Look at the example code in the examples directory. Each file + provides a very simple standalone example of using one %GeographicLib + class. These are included in the descriptions of the classes. + - Look at the source code for the utilities in the tools directory for + more examples of using %GeographicLib from C++ code, e.g., + GeodesicProj.cpp is a program to performing various geodesic + projections. + +Here's a list of some of the abbreviations used here with links to the +corresponding Wikipedia articles: + - + WGS84, World Geodetic System 1984. + - + UTM, Universal Transverse Mercator coordinate system. + - + UPS, Universal Polar Stereographic coordinate system. + - + MGRS, Military Grid Reference System. + - + EGM, Earth Gravity Model. + - + WMM, World Magnetic Model. + - + IGRF, International Geomagnetic Reference Field. + +
+Back to \ref install. Forward to \ref utilities. Up to \ref contents. +
+**********************************************************************/ +/** +\page utilities Utility programs + +
+Back to \ref start. Forward to \ref organization. Up to \ref contents. +
+ +Various utility programs are provided with %GeographicLib. These should +be installed in a directory included in your PATH (e.g., +/usr/local/bin). These programs are wrapper programs that invoke +the underlying functionality provided by the library. + +The utilities are + - + GeoConvert: convert geographic coordinates using + GeographicLib::GeoCoords. + - + GeodSolve: perform geodesic calculations using + GeographicLib::Geodesic and GeographicLib::GeodesicLine. + - + Planimeter: compute the area of geodesic polygons using + GeographicLib::PolygonArea. + - + TransverseMercatorProj: convert between geographic + and transverse Mercator. This is for testing + GeographicLib::TransverseMercatorExact and + GeographicLib::TransverseMercator. + - + CartConvert: convert geodetic coordinates to geocentric or + local cartesian using GeographicLib::Geocentric and + GeographicLib::LocalCartesian. + - + GeodesicProj: perform projections based on geodesics + using GeographicLib::AzimuthalEquidistant, GeographicLib::Gnomonic, + and GeographicLib::CassiniSoldner. + - + ConicProj: perform conic projections using + GeographicLib::LambertConformalConic and + GeographicLib::AlbersEqualArea. + - + GeoidEval: look up geoid heights using + GeographicLib::Geoid. + - + Gravity: compute the earth's gravitational field using + GeographicLib::GravityModel and GeographicLib::GravityCircle. + - + MagneticField: compute the earth's magnetic field using + GeographicLib::MagneticModel and GeographicLib::MagneticCircle. + . +The documentation for these utilities is in the form of man pages. This +documentation can be accessed by clicking on the utility name in the +list above, running the man command on Unix-like systems, or by invoking +the utility with the --help option. A brief summary of usage is given +by invoking the utility with the -h option. The version of the utility +is given by the --version option. + +The utilities all accept data on standard input, transform it in some +way, and print the results on standard output. This makes the utilities +easy to use within scripts to transform tabular data; however they can +also be used interactively, often with the input supplied via a pipe, +e.g., + - echo 38SMB4488 | GeoConvert -d + +Online versions of four of these utilities are provided: + - GeoConvert + - GeodSolve + - Planimeter + - GeoidEval + +
+Back to \ref start. Forward to \ref organization. Up to \ref contents. +
+**********************************************************************/ +/** +\page organization Code organization + +
+Back to \ref utilities. Forward to \ref other. Up to \ref contents. +
+ +Here is a brief description of the relationship between the various +components of %GeographicLib. All of these are defined in the +GeographicLib namespace. + +GeographicLib::TransverseMercator, GeographicLib::PolarStereographic, +GeographicLib::LambertConformalConic, and GeographicLib::AlbersEqualArea +provide the basic projections. The constructors for these classes +specify the ellipsoid and the forward and reverse projections are +implemented as const member functions. TransverseMercator uses +Krüger's series which have been extended to sixth order in the +square of the eccentricity. PolarStereographic, LambertConformalConic, +and AlbersEqualArea use the exact formulas for the projections (e.g., +from Snyder). + +GeographicLib::TransverseMercator::UTM and +GeographicLib::PolarStereographic::UPS are const static instantiations +specific for the WGS84 ellipsoid with the UTM and UPS scale factors. +(These do \e not add the standard false eastings or false northings for +UTM and UPS.) Similarly GeographicLib::LambertConformalConic::Mercator +is a const static instantiation of this projection for a WGS84 ellipsoid +and a standard parallel of 0 (which gives the Mercator projection). +GeographicLib::AlbersEqualArea::CylindricalEqualArea, +AzimuthalEqualAreaNorth, and AzimuthalEqualAreaSouth, likewise provide +special cases of the equal area projection. + +GeographicLib::UTMUPS uses TransverseMercator::UTM and +PolarStereographic::UPS to perform the UTM and UPS +projections. The class offers a uniform interface to UTM and UPS by +treating UPS as UTM zone 0. This class stores no internal state and the +forward and reverse projections are provided via static member +functions. The forward projection offers the ability to override the +standard UTM/UPS choice and the UTM zone. + +GeographicLib::MGRS transforms between UTM/UPS coordinates and MGRS. +UPS coordinates are handled as UTM zone 0. This class stores no +internal state and the forward (UTM/UPS to MGRS) and reverse (MGRS to +UTM/UPS) conversions are provided via static member functions. + +GeographicLib::GeoCoords holds a single geographic location which may be +specified as latitude and longitude, UTM or UPS, or MGRS. Member +functions are provided to convert between coordinate systems and to +provide formatted representations of them. +GeoConvert is a simple command line +utility to provide access to the GeoCoords class. + +GeographicLib::TransverseMercatorExact is a drop in replacement for +TransverseMercator which uses the exact formulas, based on elliptic +functions, for the projection as given by Lee. +TransverseMercatorProj is a +simple command line utility to test to the TransverseMercator and +TransverseMercatorExact. + +GeographicLib::Geodesic and GeographicLib::GeodesicLine perform geodesic +calculations. The constructor for GeographicLib::Geodesic specifies the +ellipsoid and the direct and inverse calculations are implemented as +const member functions. GeographicLib::Geocentric::WGS84 is a const +static instantiation of Geodesic specific for the WGS84 ellipsoid. In +order to perform a series of direct geodesic calculations on a single +line, the GeographicLib::GeodesicLine class can be used. This packages +all the information needed to specify a geodesic. A const member +function returns the coordinates a specified distance from the starting +point. GeodSolve is a simple command +line utility to perform geodesic calculations. +GeographicLib::PolygonArea is a class which compute the area of geodesic +polygons using the Geodesic class and Planimeter is a command line utility for +the same purpose. GeographicLib::AzimuthalEquidistant, +GeographicLib::CassiniSoldner, and GeographicLib::Gnomonic are +projections based on the Geodesic class. GeodesicProj is a command line utility to +exercise these projections. + +GeographicLib::GeodesicExact and GeographicLib::GeodesicLineExact are +drop in replacements for GeographicLib::Geodesic and +GeographicLib::GeodesicLine in which the solution is given in terms of +elliptic integrals (computed by GeographicLib::EllipticFunction). +These classes should be used if the absolute value of the flattening +exceeds 0.02. The -E option to GeodSolve +uses these classes. + +GeographicLib::Geocentric and GeographicLib::LocalCartesian convert between +geodetic and geocentric or a local cartesian system. The constructor for +specifies the ellipsoid and the forward and reverse projections are +implemented as const member functions. GeographicLib::Geocentric::WGS84 is a +const static instantiation of Geocentric specific for the WGS84 ellipsoid. +CartConvert is a simple command line +utility to provide access to these classes. + +GeographicLib::Geoid evaluates geoid heights by interpolation. This is +provided by the operator() member function. +GeoidEval is a simple command line +utility to provide access to this class. This class requires +installation of data files for the various geoid models; see \ref +geoidinst for details. + +GeographicLib::Ellipsoid is a class which performs latitude +conversions and returns various properties of the ellipsoid. + +GeographicLib::GravityModel evaluates the earth's gravitational field +using a particular gravity model. Various member functions return the +gravitational field, the gravity disturbance, the gravity anomaly, and +the geoid height Gravity is a simple +command line utility to provide access to this class. If the field +several points on a circle of latitude are sought then use +GeographicLib::GravityModel::Circle to return a +GeographicLib::GravityCircle object whose member functions performs the +calculations efficiently. (This is particularly important for high +degree models such as EGM2008.) These classes requires installation of +data files for the various gravity models; see \ref gravityinst for +details. + +GeographicLib::MagneticModel evaluates the earth's magnetic field using +a particular magnetic model. The field is provided by the operator() +member function. MagneticField is a +simple command line utility to provide access to this class. If the +field several points on a circle of latitude are sought then use +GeographicLib::MagneticModel::Circle to return a +GeographicLib::MagneticCircle object whose operator() member function +performs the calculation efficiently. (This is particularly important +for high degree models such as emm2010.) These classes requires +installation of data files for the various magnetic models; see \ref +magneticinst for details. + +GeographicLib::Constants, GeographicLib::Math, GeographicLib::Utility, +GeographicLib::DMS, are general utility class which are used +internally by the library; in addition GeographicLib::EllipticFunction +is used by GeographicLib::TransverseMercatorExact, +GeographicLib::Ellipsoid, and GeographicLib::GeodesicExact, and +GeographicLib::GeodesicLineExact; GeographicLib::Accumulator is used +by GeographicLib::PolygonArea, and GeographicLib::SphericalEngine, +GeographicLib::CircularEngine, GeographicLib::SphericalHarmonic, +GeographicLib::SphericalHarmonic1, and +GeographicLib::SphericalHarmonic2 facilitate the summation of +spherical harmonic series which is needed by and +GeographicLib::MagneticModel and GeographicLib::MagneticCircle. One +important definition is GeographicLib::Math::real which is the type +used for real numbers. This allows the library to be easily switched +to using floats, doubles, or long doubles. However all the testing +has been with real set to double and the library should be installed +in this way. + +In general, the constructors for the classes in %GeographicLib check +their arguments and throw GeographicLib::GeographicErr exceptions with a +explanatory message if these are illegal. The member functions, e.g., +the projections implemented by TransverseMercator and +PolarStereographic, the solutions to the geodesic problem, etc., +typically do not check their arguments; the calling program +should ensure that the arguments are legitimate. However, the functions +implemented by UTMUPS, MGRS, and GeoCoords do check their arguments and +may throw GeographicLib::GeographicErr exceptions. Similarly Geoid may +throw exceptions on file errors. If a function does throw an exception, +then the function arguments used for return values will not have been +altered. + +%GeographicLib attempts to act sensibly with NaNs. NaNs in constructors +typically throw errors (an exception is GeodesicLine). However, calling +the class functions with NaNs as arguments is not an error; NaNs are +returned as appropriate. "INV" is treated as an invalid zone +designation by UTMUPS. "INVALID" is the corresponding invalid MGRS +string. (Similary "nan" is the equivalent invalid Geohash.) NaNs allow +the projection of polylines which are separated by NaNs; in this format +they can be easily plotted in Matlab. + +A note about portability. For the most part, the code uses standard C++ +and should be able to be deployed on any system with a modern C++ +compiler. System dependencies come into + - GeographicLib::Math -- GeographicLib needs to define functions such + as atanh for systems that lack them. The system dependence will + disappear with the adoption of C++11 because the needed functions are + part of that standard. + - use of long double -- the type is used only for testing. On systems + which lack this data type the cmake and autoconf configuration + methods should detect its absence and omit the code that depends on + it. + - GeographicLib::Geoid, GeographicLib::GravityModel, and + GeographicLib::MagneticModel -- these class uses system-dependent + default paths for looking up the respective datasets. It also relies + on getenv to find the value of the environment variables. + - GeographicLib::Utility::readarray reads numerical data from binary + files. This assumes that floating point numbers are in IEEE format. + It attempts to handled the "endianness" of the target platform using + the WORDS_BIGENDIAN macro (which sets the compile-time constant + GeographicLib::Math::bigendian). + +An attempt is made to maintain backward compatibility with +%GeographicLib (especially at the level of your source code). Sometimes +it's necessary to take actions that depend on what version of +%GeographicLib is being used; for example, you may want to use a new +feature of %GeographicLib, but want your code still to work with older +versions. In that case, you can test the values of the macros +GEOGRAPHICLIB_VERSION_MAJOR, GEOGRAPHICLIB_VERSION_MINOR, and +GEOGRAPHICLIB_VERSION_PATCH; these expand to numbers (and the last one +is usually 0); these macros appeared starting in version 1.34. There's +also a macro GEOGRAPHICLIB_VERSION_STRING which expands to, e.g., +"1.34"; this macro has been defined since version 1.9. + +
+Back to \ref utilities. Forward to \ref other. Up to \ref contents. +
+**********************************************************************/ +/** +\page other Implementations in other languages + +
+Back to \ref organization. Forward to \ref geoid. Up to \ref contents. +
+ +Implementations of subsets of %GeographicLib are available in other languages +- \ref c-fortran +- \ref java. +- \ref javascript. +- \ref python. +- \ref matlab. +- \ref maxima. +- \ref dotnet. + +\section c-fortran C and Fortran implementation + +The directories legacy/C and legacy/Fortran +contain implementations of GeographicLib::Geodesic, +GeographicLib::GeodesicLine, and GeographicLib::PolygonArea in C and +Fortran respectively. These are intended for use in old codes written +in these languages and should work any reasonably modern compiler. +These implementations are entirely self-contained and do not depend on +the rest of %GeographicLib. Sample main programs to solve the direct +and inverse geodesic problems and to compute polygonal areas are +provided. + +For documentation, see + - C library for geodesics, + - Fortran library for geodesics. + +\section java Java implementation + +The directory java contains implementations of +GeographicLib::Geodesic, GeographicLib::GeodesicLine, and +GeographicLib::PolygonArea in Java. This implementation is entirely +self-contained and does not depend on the rest of %GeographicLib. +Sample main programs to solve the direct and inverse geodesic problems +and to compute polygonal areas are provided. + +For documentation, see + - Java library for geodesics. + +\section javascript JavaScript implementation + +The directory doc/scripts/GeographicLib contains the classes +- GeographicLib::Math +- GeographicLib::Accumulator +- GeographicLib::Geodesic +- GeographicLib::GeodesicLine +- GeographicLib::PolygonArea +- GeographicLib::DMS +. +translated into JavaScript. See Interface.js for a simple JavaScript +interface to these routines (documented near the top of the file). +Examples of using this interface are +- a geodesic calculator showing + the solution of direct and inverse geodesic problem, finding + intermediate points on a geodesic line, and computing the area of a + geodesic polygon. +- displaying geodesics in Google + Maps which shows the geodesic, the geodesic circle, and various + geodesic envelopes. +. +These examples include a "stripped" version of the JavaScript code, \code + \endcode +which loads faster. + +\section python Python implementation + +A python implementation of the geodesic routines from GeographicLib +are provided in the python/geographiclib directory (which is installed +as PREFIX/lib/python/site-packages/geographiclib, if +COMMON_INSTALL_PATH is ON, and as PREFIX/python/geographiclib, +otherwise). This contains implementations of the classes +- GeographicLib::Math +- GeographicLib::Accumulator +- GeographicLib::Geodesic +- GeographicLib::GeodesicLine +- GeographicLib::PolygonArea +. +You can also download the python interface independent of the rest of +%GeographicLib from +- + http://pypi.python.org/pypi/geographiclib +. +and then unpack the .tar.gz or .zip file. + +You can "install" these routines, so that they are in python's default +path with, for example \verbatim + cd geographiclib-1.16 + python setup.py install +\endverbatim +(this will require root privileges). Or else you can set the path +within python using \code +>>> import sys +>>> sys.path.append("/usr/local/lib/python/site-packages") +\endcode + +An example of using this interface is \code +>>> from geographiclib.geodesic import Geodesic +>>> # The geodesic inverse problem +... Geodesic.WGS84.Inverse(-41.32, 174.81, 40.96, -5.50) +>>> # The geodesic direct problem +... Geodesic.WGS84.Direct(40.6, -73.8, 45, 10000e3) +>>> # How to obtain several points along a geodesic +... line = Geodesic.WGS84.Line(40.6, -73.8, 45) +>>> line.Position( 5000e3) +>>> line.Position(10000e3) +>>> # Computing the area of a geodesic polygon +... def p(lat,lon): return {'lat': lat, 'lon': lon} +... +>>> Geodesic.WGS84.Area([p(0, 0), p(0, 90), p(90, 0)]) +>>> # Introductory help +... help(Geodesic) +\endcode + +Another illustrative exercise is finding the point midway between JFK +Airport to Singapore Changi Airport +\code +from geographiclib.geodesic import Geodesic + +# Coordinates of airports +lat1, lon1 = 40.640, -73.779 # JFK +lat2, lon2 = 1.359, 103.989 # SIN + +# Compute path from 1 to 2 +g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2) + +# Compute midpoint starting at 1 +h = Geodesic.WGS84.Direct(lat1, lon1, g['azi1'], g['s12']/2) +print(h['lat2'], h['lon2']); +\endcode + +(Note: The initial version of setup.py was provided by Andrew MacIntyre +of the Australian Communications and Media Authority.) + +\section matlab Matlab and Octave implementations + +The matlab directory contains + - Native Matlab implementations of the geodesic routines. To use + these, start Matlab or Octave and run one of (for example) \verbatim + addpath /usr/local/libexec/GeographicLib/matlab + addpath 'C:/pkg-vc10-x64/GeographicLib-1.34/libexec/GeographicLib/matlab' + \endverbatim + The available functions are: + - geoddoc: briefly descibe the routines + - geodreckon: solve the direct geodesic problem + - geoddistance: solve the inverse geodesic problem + - geodarea: compute the area of ellipsoidal polygons + . + Use the help function to get documentation, e.g., \code + help geoddistance \endcode + to obtain documentation. These functions are also available as a + standalone package from + + Matlab File Exchange using the link + - + http://www.mathworks.com/matlabcentral/fileexchange/39108 + - Native Matlab implementations of projections which are related to + geodesics. These are + - geodproj: briefly descibe the routines + - eqdazim_fwd, eqdazim_inv: azimuthal equidistant + - cassini_fwd, cassini_inv: Cassini-Soldner + - tranmerc_fwd, tranmerc_inv: transverse Mercator + - gnomonic_fwd, gnomonic_inv: ellipsoidal gnomonic + - utm_fwd, utm_inv: universal transverse Mercator + . + These functions are also available as a package from + + Matlab File Exchange using the link + - + http://www.mathworks.com/matlabcentral/fileexchange/39366 + . + (This requires that the previous package also be installed.) + - Interface code so that some %GeographicLib classes can be accessed + from Matlab or Octave. The rest of this section describes how to + compile and use these interfaces. + +There are two ways of compiling the interface code: (1) using cmake and +(2) invoking the compiler from Matlab. + - Using cmake: Before running cmake, configure MATLAB on + Windows to use the same compiler that you're going to use for compiling + %GeographicLib. For example \verbatim + mex.bat -setup + + Please choose your compiler for building MEX-files: + Would you like mex to locate installed compilers [y]/n? y + Select a compiler: + [1] Microsoft Visual C++ 2012 in C:\Program Files (x86)\Microsoft Visual Studio 11.0 + [2] Microsoft Visual C++ 2010 in C:\Program Files (x86)\Microsoft Visual Studio 10.0 + + [0] None + + Compiler: 2 + etc. \endverbatim + (This will require that mex.bat is in your PATH. With Linux, use + mex -setup.) Then configure cmake with, for example + \verbatim + cmake -G "Visual Studio 10" -D MATLAB_COMPILER=mex .. + cmake --build . --config Release --target matlabinterface \endverbatim + (Note that only the Release configuration is supported for Matlab.) + If you are running a 64-bit version of Matlab, be sure to select a + 64-bit generator with cmake, e.g., "Visual Studio 10 Win64". Finally + compile %GeographicLib with Visual Studio. (The binary installer for + 64-bit Windows includes the compiled interface built with Visual + Studio 10 and Matlab R2013a 64-bit).
+ On Linux systems, you can compile the interface for use with octave + instead by using \verbatim + cmake -D MATLAB_COMPILER=mkoctfile .. + make matlabinterface \endverbatim + - Invoking the compiler from Matlab or Octave: Start Matlab or + Octave and run, e.g., \code + mex -setup + cd 'C:/pkg-vc10-x64/GeographicLib-1.34/matlab' + help geographiclibinterface + geographiclibinterface('C:/pkg-vc10/GeographicLib-1.34'); + addpath(pwd); + \endcode + The first command allows you to select the compiler to use (which + should be the same as that used to compile %GeographicLib). + +To use the interface routines for %GeographicLib, run one of (for +example) \verbatim + addpath /usr/local/libexec/GeographicLib/matlab + addpath 'C:/pkg-vc10-x64/GeographicLib-1.34/libexec/GeographicLib/matlab' +\endverbatim +in Octave or Matlab. The available functions are: + - geodesicdirect: solve direct geodesic problem + (see GeographicLib::Geodesic::Direct) + - geodesicinverse: solve inverse geodesic problem + (see GeographicLib::Geodesic::Inverse) + - geodesicline: compute points along a geodesic + (see GeographicLib::GeodesicLine::Position) + - polygonarea: compute area of a geodesic polygon + (see GeographicLib::PolygonArea) + - utmupsforward: convert geographic coordinates to UTM/UPS + (see GeographicLib::UTMUPS::Forward) + - utmupsreverse: convert UTM/UPS coordinates to geographic + (see GeographicLib::UTMUPS::Reverse) + - mgrsforward: convert UTM/UPS coordinates to MGRS + (see GeographicLib::MGRS::Forward) + - mgrsreverse: convert MGRS coordinates to UTM/UPS + (see GeographicLib::MGRS::Reverse) + - geoidheight: compute geoid height + (see GeographicLib::Geoid::operator()()) + - geocentricforward: convert geographic coordinates to geocentric + (see GeographicLib::Geocentric::Forward) + - geocentricreverse: convert geocentric coordinates to geographic + (see GeographicLib::Geocentric::Reverse) + - localcartesianforward: convert geographic coordinates to local cartesian + (see GeographicLib::LocalCartesian::Forward) + - localcartesianreverse: convert local cartesian coordinates to geographic + (see GeographicLib::LocalCartesian::Reverse) + . +These routines just offer a simple interface to the corresponding C++ +class. Use the help function to get documentation, e.g., \code + help geodesicdirect \endcode +Unfortunately, the help function does not work for compiled functions in +Octave; in this case, just list the .m file, e.g., \code + type geodesicdirect \endcode +Other useful functions, e.g., to convert from geographic +coordinates to MGRS can easily be written with Matlab code. + +Note that geoidheight, when compiled with Visual Studio 2008 causes +Matlab to crash. (The problem does not occur with Visual Studio 2005 or +Visual Studio 2010.) + +\section maxima Maxima routines + +Maxima is a free computer algebra system which can be downloaded from +http://maxima.sf.net. Maxima was used to generate the series used by +GeographicLib::TransverseMercator ( +tmseries.mac) and GeographicLib::Geodesic ( +geod.mac) and to generate accurate data for testing +( tm.mac and +geodesic.mac). The latter uses Maxima's bigfloat arithmetic +together with series extended to high order or solutions in terms of +elliptic integrals ( ellint.mac). These files +contain brief instructions on how to use them. + +\section dotnet .NET wrapper + +This is a comprehensive wrapper library, written and maintained by Scott +Heiman, which exposes all of the functionality of %GeographicLib to the +.NET family of languages. For documentation, see + - NETGeographicLib .NET wrapper library. + +
+Back to \ref organization. Forward to \ref geoid. Up to \ref contents. +
+**********************************************************************/ +/** +\page geoid Geoid height + +
+Back to \ref other. Forward to \ref gravity. Up to \ref contents. +
+ +The gravitational equipotential surface approximately coinciding with +mean sea level is called the geoid. The GeographicLib::Geoid class and +the GeoidEval utility evaluate the height +of the geoid above the WGS84 ellipsoid. This can be used to convert +heights above mean sea level to heights above the WGS84 ellipsoid. +Because the normal to the ellipsoid differs from the normal to the geoid +(the direction of a plumb line) there is a slight ambiguity in the +measurement of heights; however for heights up to 10 km this ambiguity +is only 1 mm. + +The geoid is usually approximated by an "earth gravity model" (EGM). +The models published by the NGA are: +- EGM84: + http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html +- EGM96: + http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html +- EGM2008: + http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008 +. +GeographicLib::Geoid offers a uniform way to handle all 3 geoids at a +variety of grid resolutions. (In contrast, the software tools that NGA +offers are different for each geoid, and the interpolation programs are +different for each grid resolution. In addition these tools are written +in Fortran with is nowadays difficult to integrate with other software.) + +Unlike other components of %GeographicLib, there is a appreciable error +in the results obtained (at best, the RMS error is 1 mm). However the +class provides methods to report the maximum and RMS errors in the +results. The class also returns the gradient of the geoid. This can be +used to estimate the direction of a plumb line relative to the WGS84 +ellipsoid. + +The GeographicLib::GravityModel class calculates geoid heights using the +underlying gravity model. This is slower then GeographicLib::Geoid but +considerably more accurate. This class also can accurately compute all +the components of the acceleration due to gravity (and hence the +direction of plumb line). + +Go to + - \ref geoidinst + - \ref geoidformat + - \ref geoidinterp + - \ref geoidcache + - \ref testgeoid + +\section geoidinst Installing the geoid datasets + +The geoid heights are computed using interpolation into a rectangular +grid. The grids are read from data files which have been are computed +using the NGA synthesis programs in the case of the EGM84 and EGM96 +models and using the NGA binary gridded data files in the case of +EGM2008. These data files are available for download: +
+ + + + + + + + + + + + + + + +
Available geoid data files
name geoid grid + size\n(MB) +
Download Links (size, MB)
tar fileWindows\n installerzip file
egm84-30 + EGM84 +
30'
+
0.6
+
+ + link (0.5)
+
+ + link (0.8)
+
+ + link (0.5)
+
egm84-15 + EGM84 +
15'
+
2.1
+
+ + link (1.5)
+
+ + link (1.9)
+
+ + link (2.0)
+
egm96-15 + EGM96 +
15'
+
2.1
+
+ + link (1.5)
+
+ + link (1.9)
+
+ + link (2.0)
+
egm96-5 + EGM96 +
5'
+
19
+
+ + link (11)
+
+ + link (11)
+
+ + link (17)
+
egm2008-5 + EGM2008 +
5'
+
19
+
+ + link (11)
+
+ + link (11)
+
+ + link (17)
+
egm2008-2_5 + EGM2008 +
2.5'
+
75
+
+ + link (35)
+
+ + link (33)
+
+ + link (65)
+
egm2008-1 + EGM2008 +
1'
+
470
+
+ + link (170)
+
+ + link (130)
+
+ + link (390)
+
+
+The "size" column is the size of the uncompressed data and it also +gives the memory requirements for caching the entire dataset using the +GeographicLib::Geoid::CacheAll method. +At a minimum you should install egm96-5 and either egm2008-1 or +egm2008-2_5. Many applications use the EGM96 geoid, however the use of +EGM2008 is growing. (EGM84 is rarely used now.) + +For Linux and Unix systems, %GeographicLib provides a shell script +geographiclib-get-geoids (typically installed in /usr/local/sbin) which +automates the process of downloading and installing the geoid data. For +example +\verbatim + geographiclib-get-geoids best # to install egm84-15, egm96-5, egm2008-1 + geographiclib-get-geoids -h # for help +\endverbatim +This script should be run as a user with write access to the +installation directory, which is typically +/usr/local/share/GeographicLib (this can be overridden with the -p +flag), and the data will then be placed in the "geoids" subdirectory. + +Windows users should download and run the Windows installers. These +will prompt for an installation directory with the default being one of +\verbatim + C:/Documents and Settings/All Users/Application Data/GeographicLib + C:/ProgramData/GeographicLib +\endverbatim +(which you probably should not change) and the data is installed in the +"geoids" sub-directory. (The second directory name is an alternate name +that Windows 7 uses for the "Application Data" directory.) + +Otherwise download \e either the tar.bz2 file \e or the zip file (they +have the same contents). If possible use the tar.bz2 files, since these +are compressed about 2 times better than the zip file. To unpack these, +run, for example +\verbatim + mkdir -p /usr/local/share/GeographicLib + tar xofjC egm96-5.tar.bz2 /usr/local/share/GeographicLib + tar xofjC egm2008-2_5.tar.bz2 /usr/local/share/GeographicLib + etc. +\endverbatim +and, again, the data will be placed in the "geoids" subdirectory. + +However you install the geoid data, all the datasets should +be installed in the same directory. GeographicLib::Geoid and +GeoidEval uses a compile time default to +locate the datasets. This is +- /usr/local/share/GeographicLib/geoids, for non-Windows systems +- C:/Documents and Settings/All Users/Application Data/GeographicLib/geoids, + for Windows systems +. +consistent with the examples above. This may be overridden at run-time +by defining the GEOID_PATH or the GEOGRAPHICLIB_DATA environment variables; +see GeographicLib::Geoid::DefaultGeoidPath() for details. Finally, the +path may be set using the optional second argument to the +GeographicLib::Geoid constructor or with the "-d" flag to +GeoidEval. Supplying the "-h" flag to +GeoidEval reports the default geoid path +for that utility. The "-v" flag causes GeoidEval to report the full +path name of the data file it uses. + +\section geoidformat The format of the geoid data files + +The gridded data used by the GeographicLib::Geoid class is stored in +16-bit PGM files. Thus the data for egm96-5 might be stored in the file +- /usr/local/share/GeographicLib/geoids/egm96-5.pgm +. +PGM simple graphic format with the following properties +- it is well documented + here; +- there are no separate "little-endian" and "big-endian" versions; +- it uses 1 or 2 bytes per pixel; +- pixels can be randomly accessed; +- comments can be added to the file header; +- it is sufficiently simple that it can be easily read without using the + libnetpbm + library (and thus we avoid adding a software dependency to + %GeographicLib). +. +The major drawback of this format is that since there are only 65535 +possible pixel values, the height must be quantized to 3 mm. However, +the resulting quantization error (up to 1.5 mm) is typically smaller +than the linear interpolation errors. The comments in the header for +egm96-5 are +\verbatim + # Geoid file in PGM format for the GeographicLib::Geoid class + # Description WGS84 EGM96, 5-minute grid + # URL http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html + # DateTime 2009-08-29 18:45:03 + # MaxBilinearError 0.140 + # RMSBilinearError 0.005 + # MaxCubicError 0.003 + # RMSCubicError 0.001 + # Offset -108 + # Scale 0.003 + # Origin 90N 0E + # AREA_OR_POINT Point + # Vertical_Datum WGS84 +\endverbatim +Of these lines, the Scale and Offset lines are required and define the +conversion from pixel value to height (in meters) using \e height = +\e offset + \e scale \e pixel. The Geoid constructor also reads the +Description, DateTime, and error lines (if present) and stores the +resulting data so that it can be returned by +GeographicLib::Geoid::Description, GeographicLib::Geoid::DateTime, +GeographicLib::Geoid::MaxError, and GeographicLib::Geoid::RMSError +methods. The other lines serve as additional documentation but are not +used by this class. Accompanying egm96-5.pgm (and similarly with the +other geoid data files) are two files egm96-5.wld and +egm96-5.pgm.aux.xml. The first is an ESRI "world" file and the second +supplies complete projection metadata for use by +GDAL. Neither of these files is read +by GeographicLib::Geoid. + +You can use gdal_translate to convert the data files to a standard +GeoTiff, e.g., with +\verbatim + gdal_translate -ot Float32 -scale 0 65000 -108 87 egm96-5.pgm egm96-5.tif +\endverbatim +The arguments to -scale here are specific to the Offset and Scale +parameters used in the pgm file (note 65000 * 0.003 - 108 = 87). You +can check these by running GeoidEval with +the "-v" option. + +Here is a sample script which uses GDAL to create a 1-degree +squared grid of geoid heights at 3" resolution (matching DTED1) by +bilinear interpolation. +\verbatim + #! /bin/sh + lat=37 + lon=067 + res=3 # resolution in seconds + TEMP=`mktemp junkXXXXXXXXXX` # temporary file for GDAL + gdalwarp -q -te `echo $lon $lat $res | awk '{ + lon = $1; lat = $2; res = $3; + printf "%.14f %.14f %.14f %.14f", + lon -0.5*res/3600, lat -0.5*res/3600, + lon+1+0.5*res/3600, lat+1+0.5*res/3600; + }'` -ts $((3600/res+1)) $((3600/res+1)) -r bilinear egm96-5.tif $TEMP + gdal_translate -quiet \ + -mo AREA_OR_POINT=Point \ + -mo Description="WGS84 EGM96, $res-second grid" \ + -mo Vertical_Datum=WGS84 \ + -mo Tie_Point_Location=pixel_corner \ + $TEMP e$lon-n$lat.tif + rm -f $TEMP +\endverbatim + +Because the pgm files are uncompressed, they can take up a lot of disk +space. Some compressed formats compress in tiles and so might be +compatible with the requirement that the data can be randomly accessed. +In particular gdal_translate can be used to convert the pgm files to +compressed tiff files with +\verbatim +gdal_translate -co COMPRESS=LZW -co PREDICTOR=2 \ + -co TILED=YES -co BLOCKXSIZE=256 -co BLOCKYSIZE=256 \ + egmyy-g.pgm egmyy-g.tif +\endverbatim +The resulting files sizes are +\verbatim + pgm tif + egm84-30 0.6 MB 0.5 MB + egm84-15 2.1 MB 1.4 MB + egm96-15 2.1 MB 1.5 MB + egm96-5 19 MB 8.5 MB + egm2008-5 19 MB 9.8 MB + egm2008-2_5 75 MB 28 MB + egm2008-1 470 MB 97 MB +\endverbatim +Currently, there are no plans for %GeographicLib to support this +compressed format. + +\section geoidinterp Interpolating the geoid data + +GeographicLib::Geoid evaluates the geoid height using bilinear or cubic +interpolation. The gradient of the geoid height is obtained by +differentiating the interpolated height and referencing the result to +distance on the WGS84 ellipsoid. + +WARNING: Although GeographicLib::Geoid computes the gradient of +the geoid height, this is subject to large quantization errors as a +result of the way that the geoid data is stored. This is particularly +acute for fine grids, at high latitudes, and for the easterly gradient. +If you need to compute the direction of the acceleration due to gravity +accurately, you should use GeographicLib::GravityModel::Gravity. + +The bilinear interpolation is based on the values at the 4 corners of +the enclosing cell. The interpolated height is a continuous function of +position; however the gradient has discontinuities are cell boundaries. +The quantization of the data files exacerbates the errors in the +gradients. + +The cubic interpolation is a least-squares fit to the values on a +12-point stencil with weights as follows: +\verbatim + . 1 1 . + 1 2 2 1 + 1 2 2 1 + . 1 1 . +\endverbatim +The cubic is constrained to be independent of longitude when evaluating +the height at one of the poles. Cubic interpolation is considerably +more accurate than bilinear interpolation; however, in this +implementation there are small discontinuities in the heights are cell +boundaries. The over-constrained cubic fit slightly reduces the +quantization errors on average. + +The algorithm for the least squares fit is taken from, F. H. Lesh, +Multi-dimensional least-squares polynomial curve fitting, CACM 2, 29-30 +(1959). This algorithm is not part of GeographicLib::Geoid; instead it is +implemented as +Maxima +code which is used to precompute the matrices to convert the function +values on the stencil into the coefficients from the cubic polynomial. +This code is included as a comment in Geoid.cpp. + +The interpolation methods are quick and give good accuracy. Here is a +summary of the combined quantization and interpolation errors for the +heights. +
+ + + + + + + + + + + + +
Interpolation and quantization errors for geoid heights
name + geoid + grid +
bilinear error
cubic error
max
rms
+
max
rms
+
egm84-30 EGM84
30'
+
1.546 m
70 mm
+
0.274 m
14 mm
+
egm84-15 EGM84
15'
+
0.413 m
18 mm
+
0.021 m
1.2 mm
+
egm96-15 EGM96
15'
+
1.152 m
40 mm
+
0.169 m
7.0 mm
+
egm96-5 EGM96
5'
+
0.140 m
4.6 mm
+
0.0032 m
0.7 mm
+
egm2008-5 EGM2008
5'
+
0.478 m
12 mm
+
0.294 m
4.5 mm
+
egm2008-2_5EGM2008
2.5'
+
0.135 m
3.2 mm
+
0.031 m
0.8 mm
+
egm2008-1 EGM2008
1'
+
0.025 m
0.8 mm
+
0.0022 m
0.7 mm
+
+The errors are with respect to the specific NGA earth gravity model +(not to any "real" geoid). The RMS values are obtained using 5 million +uniformly distributed random points. The maximum values are obtained by +evaluating the errors using a different grid with points at the +centers of the original grid. (The RMS difference between EGM96 and +EGM2008 is about 0.5 m. The RMS difference between EGM84 and EGM96 is +about 1.5 m.) + +The errors in the table above include the quantization errors that arise +because the height data that GeographicLib::Geoid uses are quantized to +3 mm. If, instead, GeographicLib::Geoid were to use data files without +such quantization artifacts, the overall error would be reduced but +only modestly as shown in the following table, where only the +changed rows are included and where the changed entries are given in +bold: +
+ + + + + + + + +
Interpolation (only!) errors for geoid heights
name + geoid + grid +
bilinear error
cubic error
max
rms
+
max
rms
+
egm96-5 EGM96
5'
+
0.140 m
4.6 mm
+
0.0026 m
0.1 mm
+
egm2008-2_5EGM2008
2.5'
+
0.135 m
3.2 mm
+
0.031 m
0.4 mm
+
egm2008-1 EGM2008
1'
+
0.025 m
0.6 mm
+
0.0010 m
0.011 mm
+
+ +\section geoidcache Caching the geoid data + +A simple way of calling Geoid is as follows +\code + #include + #include + ... + GeographicLib::Geoid g("egm96-5"); + double lat, lon; + while (std::cin >> lat >> lon) + std::cout << g(lat, lon) << "\n"; + ... +\endcode + +The first call to g(lat, lon) causes the data for the stencil points (4 +points for bilinear interpolation and 12 for cubic interpolation) to be +read and the interpolated value returned. A simple 0th-order caching +scheme is provided by default, so that, if the second and subsequent +points falls within the same grid cell, the data values are not reread +from the file. This is adequate for most interactive use and also +minimizes disk accesses for the case when a continuous track is being +followed. + +If a large quantity of geoid calculations are needed, the calculation +can be sped up by preloading the data for a rectangular block with +GeographicLib::Geoid::CacheArea or the entire dataset with +GeographicLib::Geoid::CacheAll. If the requested points lie within the +cached area, the cached data values are used; otherwise the data is read +from disk as before. Caching all the data is a reasonable choice for +the 5' grids and coarser. Caching all the data for the 1' grid will +require 0.5 GB of RAM and should only be used on systems with sufficient +memory. + +The use of caching does not affect the values returned. Because of the +caching and the random file access, this class is \e not normally thread +safe; i.e., a single instantiation cannot be safely used by multiple +threads. If multiple threads need to calculate geoid heights, there are +two alternatives: + - they should all construct thread-local instantiations. + - GeographicLib::Geoid should be constructed with \e threadsafe = true. + This causes all the data to be read at the time of construction (and + if this fails, an exception is thrown), the data file to be closed + and the single-cell caching to be turned off. The resulting object + may then be shared safely between threads. + +\section testgeoid Test data for geoids + +A test set for the geoid models is available at + - + GeoidHeights.dat.gz + . +This is about 11 MB (compressed). This test set consists of a set of +500000 geographic coordinates together with the corresponding geoid +heights according to various earth gravity models. + +Each line of the test set gives 6 space delimited numbers + - latitude (degrees, exact) + - longitude (degrees, exact) + - EGM84 height (meters, accurate to 1 μm) + - EGM96 height (meters, accurate to 1 μm) + - EGM2008 height (meters, accurate to 1 μm) + . +The latitude and longitude are all multiples of 10−6 +deg and should be regarded as exact. The geoid heights are computed +using the harmonic NGA synthesis programs, where the programs were +compiled (with gfortran) and run under Linux. In the case of the +EGM2008 program, a SAVE statement needed to be added to +subroutine latf, in order for the program to compile +correctly with a stack-based compiler. Similarly the EGM96 code +requires a SAVE statement in subroutine +legfdn. + +
+Back to \ref other. Forward to \ref gravity. Up to \ref contents. +
+**********************************************************************/ +/** +\page gravity Gravity models + +
+Back to \ref geoid. Forward to \ref magnetic. Up to \ref contents. +
+ +%GeographicLib can compute the earth's gravitational field with an +earth gravity model using the GeographicLib::GravityModel and +GeographicLib::GravityCircle classes and with the +Gravity utility. These models expand the +gravitational potential of the earth as sum of spherical harmonics. The +models also specify a reference ellipsoid, relative to which geoid +heights and gravity disturbances are measured. + +The supported models are + - egm84, the + + Earth Gravity Model 1984, which includes terms up to degree 180. + - egm96, the + + Earth Gravity Model 1996, which includes terms up to degree 360. + - egm2008, the + + Earth Gravity Model 2008, which includes terms up to degree 2190. + - wgs84, the + + WGS84 Reference Ellipsoid. This is just reproduces the normal + gravitational field for the reference ellipsoid. Usually + GeographicLib::NormalGravity::WGS84 should be used instead. + +See + - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San + Francisco, 1967). + . +for more information. + +Acknowledgment: I would like to thank Mathieu Peyréga for +sharing EGM_Geoid_CalculatorClass from his Geo library with me. His +implementation was the first I could easily understand and he and I +together worked through some of the issues with overflow and underflow +the occur while performing high-degree spherical harmonic sums. + +Go to + - \ref gravityinst + - \ref gravityformat + - \ref gravitynga + - \ref gravitygeoid + - \ref gravityatmos + - \ref gravityparallel + +\section gravityinst Installing the gravity models + +These gravity models are available for download: +
+ + + + + + + + + + + + +
Available gravity models
name max\n degree + size\n(kB) +
Download Links (size, kB)
tar fileWindows\n installerzip file
egm84 +
180
+
27
+
+ + link (26)
+
+ + link (55)
+
+ + link (26)
+
egm96 +
360
+
2100
+
+ + link (2100)
+
+ + link (2300)
+
+ + link (2100)
+
egm2008 +
2190
+
76000
+
+ + link (75000)
+
+ + link (72000)
+
+ + link (73000)
+
wgs84 +
20
+
1
+
+ + link (1)
+
+ + link (30)
+
+ + link (1)
+
+
+The "size" column is the size of the uncompressed data. + +For Linux and Unix systems, %GeographicLib provides a shell script +geographiclib-get-gravity (typically installed in /usr/local/sbin) +which automates the process of downloading and installing the gravity +models. For example +\verbatim + geographiclib-get-gravity all # to install egm84, egm96, egm2008, wgs84 + geographiclib-get-gravity -h # for help +\endverbatim +This script should be run as a user with write access to the +installation directory, which is typically +/usr/local/share/GeographicLib (this can be overridden with the -p +flag), and the data will then be placed in the "gravity" subdirectory. + +Windows users should download and run the Windows installers. These +will prompt for an installation directory with the default being one of +\verbatim + C:/Documents and Settings/All Users/Application Data/GeographicLib + C:/ProgramData/GeographicLib +\endverbatim +(which you probably should not change) and the data is installed in the +"gravity" sub-directory. (The second directory name is an alternate name +that Windows 7 uses for the "Application Data" directory.) + +Otherwise download \e either the tar.bz2 file \e or the zip file (they +have the same contents). To unpack these, run, for example +\verbatim + mkdir -p /usr/local/share/GeographicLib + tar xofjC egm96.tar.bz2 /usr/local/share/GeographicLib + tar xofjC egm2008.tar.bz2 /usr/local/share/GeographicLib + etc. +\endverbatim +and, again, the data will be placed in the "gravity" subdirectory. + +However you install the gravity models, all the datasets should be +installed in the same directory. GeographicLib::GravityModel and +Gravity uses a compile time default to +locate the datasets. This is +- /usr/local/share/GeographicLib/gravity, for non-Windows systems +- C:/Documents and Settings/All Users/Application Data/GeographicLib/gravity, + for Windows systems +. +consistent with the examples above. This may be overridden at run-time +by defining the GRAVITY_PATH or the GEOGRAPHICLIB_DATA environment +variables; see GeographicLib::GravityModel::DefaultGravityPath() for +details. Finally, the path may be set using the optional second +argument to the GeographicLib::GravityModel constructor or with the "-d" +flag to +Gravity. Supplying the "-h" flag to +Gravity reports the default path for +gravity models for that utility. The "-v" flag causes Gravity to report +the full path name of the data file it uses. + +\section gravityformat The format of the gravity model files + +The constructor for GeographicLib::GravityModel reads a file called +NAME.egm which specifies various properties for the gravity model. It +then opens a binary file NAME.egm.cof to obtain the coefficients of the +spherical harmonic sum. + +The first line of the .egm file must consist of "EGMF-v" where EGMF +stands for "Earth Gravity Model Format" and v is the version number of +the format (currently "1"). + +The rest of the File is read a line at a time. A # character and +everything after it are discarded. If the result is just white space it +is discarded. The remaining lines are of the form "KEY WHITESPACE +VALUE". In general, the KEY and the VALUE are case-sensitive. + +GeographicLib::GravityModel only pays attention to the following +keywords + - keywords that affect the field calculation, namely: + - ModelRadius (required), the normalizing radius for the model + in meters. + - ReferenceRadius (required), the major radius \e a for the + reference ellipsoid meters. + - ModelMass (required), the mass constant \e GM for the model + in meters3/seconds2. + - ReferenceMass (required), the mass constant \e GM for the + reference ellipsoid in meters3/seconds2. + - AngularVelocity (required), the angular velocity ω for + the model \e and the reference ellipsoid in rad + seconds−1. + - Flattening, the flattening of the reference ellipsoid; this + can be given a fraction, e.g., 1/298.257223563. One of + Flattening and DynamicalFormFactor is required. + - DynamicalFormFactor, the dynamical form factor + J2 for the reference ellipsoid. One of + Flattening and DynamicalFormFactor is required. + - HeightOffset (default 0), the constant height offset + (meters) added to obtain the geoid height. + - CorrectionMultiplier (default 1), the multiplier for the + "zeta-to-N" correction terms for the geoid height to convert them + to meters. + - Normalization (default full), the normalization used for the + associated Legendre functions (full or schmidt). + - ID (required), 8 printable characters which serve as a + signature for the .egm.cof file (they must appear as the first 8 + bytes of this file). + . + The parameters ModelRadius, ModelMass, and + AngularVelocity apply to the gravity model, while + ReferenceRadius, ReferenceMass, AngularVelocity, + and either Flattening or DynamicalFormFactor + characterize the reference ellipsoid. AngularVelocity + (because it can be measured precisely) is the same for the gravity + model and the reference ellipsoid. ModelRadius is merely a + scaling parameter for the gravity model and there's no requirement + that it be close to the major radius of the earth (although that's + typically how it is chosen). ModelMass and + ReferenceMass need not be the same and, indeed, they are + slightly difference for egm2008. As a result the disturbing + potential \e T has a 1/\e r dependence at large distances. + - keywords that store data that the user can query: + - Name, the name of the model. + - Description, a more descriptive name of the model. + - ReleaseDate, when the model was created. + - keywords that are examined to verify that their values are valid: + - ByteOrder (default little), the order of bytes in the + .egm.cof file. Only little endian is supported at present. + . +Other keywords are ignored. + +The coefficient file NAME.egm.cof is a binary file in little endian +order. The first 8 bytes of this file must match the ID given in +NAME.egm. This is followed by 2 sets of spherical harmonic +coefficients. The first of these gives the gravity potential and the +second gives the zeta-to-N corrections to the geoid height. The format +for each set of coefficients is: + - \e N, the maximum degree of the sum stored as a 4-byte signed integer. + This must satisfy \e N ≥ −1. + - \e M, the maximum order of the sum stored as a 4-byte signed integer. + This must satisfy \e N ≥ \e M ≥ −1. + - \e C\e nm, the coefficients of the cosine coefficients of + the sum in column (i.e., \e m) major order. There are (\e M + 1) + (2\e N - \e M + 2) / 2 elements which are stored as IEEE doubles (8 + bytes). For example for \e N = \e M = 3, there are 10 coefficients + arranged as + C00, + C10, + C20, + C30, + C11, + C21, + C31, + C22, + C32, + C33. + - \e S\e nm, the coefficients of the sine coefficients of + the sum in column (i.e., \e m) major order starting at \e m = 1. + There are \e M (2\e N - \e M + 1) / 2 elements which are stored as + IEEE doubles (8 bytes). For example for \e N = \e M = 3, there are 6 + coefficients arranged as + S11, + S21, + S31, + S22, + S32, + S33. + . +Although the coefficient file is in little endian order, %GeographicLib +can read it on big endian machines. It can only be read on machines +which store doubles in IEEE format. + +As an illustration, here is egm2008.egm: +\verbatim +EGMF-1 +# An Earth Gravity Model (Format 1) file. For documentation on the +# format of this file see +# http://geographiclib.sf.net/html/gravity.html#gravityformat +Name egm2008 +Publisher National Geospatial Intelligence Agency +Description Earth Gravity Model 2008 +URL http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008 +ReleaseDate 2008-06-01 +ConversionDate 2011-11-19 +DataVersion 1 +ModelRadius 6378136.3 +ModelMass 3986004.415e8 +AngularVelocity 7292115e-11 +ReferenceRadius 6378137 +ReferenceMass 3986004.418e8 +Flattening 1/298.257223563 +HeightOffset -0.41 + +# Gravitational and correction coefficients taken from +# EGM2008_to2190_TideFree and Zeta-to-N_to2160_egm2008 from +# the egm2008 distribution. +ID EGM2008A +\endverbatim + +\section gravitynga Comments on the NGA harmonic synthesis code + +GeographicLib::GravityModel attempts to reproduce the results of NGA's +harmonic synthesis code for EGM2008, hsynth_WGS84.f. Listed here are +issues that I encountered using the NGA code: + -# A compiler which allocates local variables on the stack produces an + executable with just returns NaNs. The problem here is a missing + SAVE statement in subroutine latf. + -# Because the model and references masses for egm2008 differ (by about + 1 part in 109), there should be a 1/\e r contribution to + the disturbing potential \e T. However, this term is set to zero in + hsynth_WGS84 (effectively altering the normal potential). This + shifts the surface \e W = U0 outward by about 5 mm. + Note too that the reference ellipsoid is no longer a level surface of + the effective normal potential. + -# Subroutine radgrav computes the ellipsoidal coordinate + β incorrectly. This leads to small errors in the deflection + of the vertical, ξ and η, when the height above the + ellipsoid, \e h, is non-zero (about 10−7 arcsec at + \e h = 400 km). + -# There are several expressions which will return inaccurate results + due to cancellation. For example, subroutine grs + computes the flattening using \e f = 1 - sqrt(1 - + e2). Much better is to use \e f = + e2/(1 + sqrt(1 - e2)). The + expressions for \e q and \e q' in grs and + radgrav suffer from similar problems. The resulting + errors are tiny (about 50 pm in the geoid height); however, given + that's there's essentially no cost to using more accurate + expressions, it's preferable to do so. + -# hsynth_WGS84 returns an "undefined" value for \e xi and \e eta at the + poles. Better would be to return the value obtained by taking the + limit \e lat -> +/- 90°. + . +Issues 1--4 have been reported to the authors of hsynth_WGS84. +Issue 1 is peculiar to Fortran and is not encountered in C++ code and +GeographicLib::GravityModel corrects issues 3--5. On issue 2, +GeographicLib::GravityModel neglects the 1/\e r term in \e T in +GeographicLib::GravityModel::GeoidHeight and +GeographicLib::GravityModel::SphericalAnomaly in order to produce +results which match NGA's for these quantities. On the other hand, +GeographicLib::GravityModel::Disturbance and +GeographicLib::GravityModel::T do include this term. + +\section gravitygeoid Details of the geoid height and anomaly calculations + +Ideally, the geoid represents a surface of constant gravitational +potential which approximates mean sea level. In reality some +approximations are taken in determining this surface. The steps taking +by GeographicLib::GravityModel in computing the geoid height are +described here (in the context of EGM2008). This mimics NGA's code +hsynth_WGS84 closely because most users of EGM2008 use the gridded data +generated by this code (e.g., GeographicLib::Geoid) and it is desirable +to use a consistent definition of the geoid height. + - The model potential is band limited; the minimum wavelength that is + represented is 360°/2160 = 10' (i.e., about 10NM or + 18.5km). The maximum degree for the spherical harmonic sum is 2190; + however the model was derived using ellipsoidal harmonics of degree + and order 2160 and the degree was increased to 2190 in order to + capture the ellipsoidal harmonics faithfully with spherical + harmonics. + - The 1/\e r term is omitted from the \e T (this is issue 2 in \ref + gravitynga). This moves the equipotential surface by about 5mm. + - The surface \e W = U0 is determined by Bruns' + formula, which is roughly equivalent to a single iteration of + Newton's method. The RMS error in this approximation is about 1.5mm + with a maximum error of about 10 mm. + - The model potential is only valid above the earth's surface. A + correction therefore needs to be included where the geoid lies + beneath the terrain. This is NGA's "zeta-to-N" correction, which is + represented by a spherical harmonic sum of degree and order 2160 (and + so it misses short wavelength terrain variations). In addition, it + entails estimating the isostatic equilibrium of the earth's crust. + The correction lies in the range [-5.05 m, 0.05 m], however for 99.9% + of the earth's surface the correction is less than 10 mm in + magnitude. + - The resulting surface lies above the observed mean sea level, + so -0.41m is added to the geoid height. (Better would be to change + the potential used to define the geoid; but this would only change + the result by about 2mm.) + . +A useful discussion of the problems with defining a geoid is given by +Dru A. Smith in + +There is no such thing as "The" EGM96 geoid: Subtle points on the use of +a global geopotential model, IGeS Bulletin No. 8, International +Geoid Service, Milan, Italy, pp. 17--28 (1998). + +GeographicLib::GravityModel::GeoidHeight reproduces the results of the +several NGA codes for harmonic synthesis with the following maximum +discrepancies: + - egm84 = 1.1mm. This is probably due to inconsistent parameters for the + reference ellipsoid in the NGA code. (In particular, the value of + mass constant excludes the atmosphere; however, it's not clear + whether the other parameters have been correspondingly adjusted.) + Note that geoid heights predicted by egm84 differ from those of more + recent gravity models by about 1 meter. + - egm96 = 23nm. + - egm2008 = 78pm. After addressing some of the issues alluded to in + issue 4 in \ref gravitynga, the maximum discrepancy becomes 23pm. + +The formula for the gravity anomaly vector involves computing gravity +and normal gravity at two different points (with the displacement +between the points unknown ab initio). Since the gravity anomaly +is already a small quantity it is sometimes acceptable to employ +approximations that change the quantities by \e O(\e f). The NGA code +uses the spherical approximation described by Heiskanen and Moritz, +Sec. 2-14 and GeographicLib::GravityModel::SphericalAnomaly uses the +same approximation for compatibility. In this approximation, the +gravity disturbance delta = grad \e T is calculated. +Here, \e T once again excludes the 1/\e r term (this is issue 2 in \ref +gravitynga and is consistent with the computation of the geoid height). +Note that delta compares the gravity and the normal gravity at +the \e same point; the gravity anomaly vector is then found by +estimating the gradient of the normal gravity in the limit that the +earth is spherically symmetric. delta is expressed in \e +spherical coordinates as \e deltax, \e deltay, \e deltaz where, for +example, \e deltaz is the \e radial component of delta (not the +component perpendicular to the ellipsoid) and \e deltay is similarly +slightly different from the usual northerly component. The components +of the anomaly are then given by + - gravity anomaly, \e Dg01 = \e deltaz - 2T/\e R, where \e R + distance to the center of the earth; + - northerly component of the deflection of the vertical, \e xi = - + deltay/\e gamma, where \e gamma is the magnitude of the normal + gravity; + - easterly component of the deflection of the vertical, \e eta = - + deltax/\e gamma. + . +GeographicLib::NormalGravity computes the normal gravity accurately and +avoids issue 3 of \ref gravitynga. Thus while +GeographicLib::GravityModel::SphericalAnomaly reproduces the results for +\e xi and \e eta at \e h = 0, there is a slight discrepancy if \e h is +non-zero. + +\section gravityatmos The effect of the mass of the atmosphere + +All of the supported models use WGS84 for the reference ellipsoid. This +has (see + +TR8350.2, table 3.1) + - \e a = 6378137 m + - \e f = 1/298.257223563 + - ω = 7292115 × 10−11 rad + s−1 + - \e GM = 3986004.418 × 108 m3 + s−2. + . +The value of \e GM includes the mass of the atmosphere and so strictly +only applies above the earth's atmosphere. Near the surface of the +earth, the value of \e g will be less (in absolute value) than the value +predicted by these models by about δ\e g = (4πG/\e +g) \e A = 8.552 × 10−11 \e A m2/kg, +where \e G is the gravitational constant, \e g is the earth's gravity, +and \e A is the pressure of the atmosphere. At sea level we have \e A = +101.3 kPa, and δ\e g = 8.7 × 10−6 m +s−2, approximately. (In other words the effect is +about 1 part in a million; by way of comparison, buoyancy effects +are about 100 times larger.) + +\section gravityparallel Geoid heights on a multi-processor system + +The egm2008 model includes many terms (over 2 million spherical +harmonics). For that reason computations using this model may be slow; +for example it takes about 78 ms to compute the geoid height at a single +point. There are two ways to speed up this computation: + - Use a GeographicLib::GravityCircle to compute the geoid height at + several points on a circle of latitude. This reduces the cost per + point to about 92 μs (a reduction by a factor of over 800). + - Compute the values on several circles of latitude in parallel. One + of the simplest ways of doing this is with + OpenMP; on an 8-processor system, + this can speed up the computation by another factor of 8. + . +Both of these techniques are illustrated by the following code, +which computes a table of geoid heights on +a regular grid and writes on the result in a +.gtx +file. On an 8-processor Intel 2.66 GHz machine using OpenMP +(-DHAVE_OPENMP=1), it takes about 40 minutes of elapsed time to compute +the geoid height for EGM2008 on a 1' gride. (Without these +optimizations, the computation would have taken about 200 days!) +\include GeoidToGTX.cpp + +This example, examples/GeoidToGTX.cpp, is built if cmake +is configured with -D GEOGRAPHICLIB_EXAMPLES=ON. cmake +will add in support for OpenMP, if it is available. + +
+Back to \ref geoid. Forward to \ref magnetic. Up to \ref contents. +
+**********************************************************************/ +/** +\page magnetic Magnetic models + +
+Back to \ref gravity. Forward to \ref geodesic. Up to \ref contents. +
+ +%GeographicLib can compute the earth's magnetic field by a magnetic +model using the GeographicLib::MagneticModel and +GeographicLib::MagneticCircle classes and with the +MagneticField utility. These models +expand the internal magnetic potential of the earth as sum of spherical +harmonics. They neglect magnetic fields due to the ionosphere, the +magnetosphere, nearby magnetized materials, electric machinery, etc. +Users of GeographicLib::MagneticModel are advised to read the +"Health +Warning" this is provided with igrf11. Although the advice is +specific to igrf11, many of the comments apply to all magnetic field +models. + +The supported models are + - wmm2010, the + World + Magnetic Model 2010, which approximates the main magnetic field + for the period 2010--2015. + - igrf11, the + International + Geomagnetic Reference Field (11th generation), which approximates + the main magnetic field for the period 1900--2015. + - emm2010, the + Enhanced + Magnetic Model 2010, which approximates the main and crustal + magnetic fields for the period 2010--2015. + +Go to + - \ref magneticinst + - \ref magneticformat + +\section magneticinst Installing the magnetic field models + +These magnetic models are available for download: +
+ + + + + + + + + + + +
Available magnetic models
name max\n degree + time\n interval + size\n(kB) +
Download Links (size, kB)
tar fileWindows\n installerzip file
wmm2010 +
12
+
2010--2015
+
3
+
+ + link (2)
+
+ + link (300)
+
+ + link (2)
+
igrf11 +
13
+
1900--2015
+
25
+
+ + link (7)
+
+ + link (310)
+
+ + link (8)
+
emm2010 +
739
+
2010--2015
+
4400
+
+ + link (3700)
+
+ + link (3000)
+
+ + link (4100)
+
+
+The "size" column is the size of the uncompressed data. + +For Linux and Unix systems, %GeographicLib provides a shell script +geographiclib-get-magnetic (typically installed in /usr/local/sbin) +which automates the process of downloading and installing the magnetic +models. For example +\verbatim + geographiclib-get-magnetic all # to install wmm2010, igrf11, emm2010 + geographiclib-get-magnetic -h # for help +\endverbatim +This script should be run as a user with write access to the +installation directory, which is typically +/usr/local/share/GeographicLib (this can be overridden with the -p +flag), and the data will then be placed in the "magnetic" subdirectory. + +Windows users should download and run the Windows installers. These +will prompt for an installation directory with the default being one of +\verbatim + C:/Documents and Settings/All Users/Application Data/GeographicLib + C:/ProgramData/GeographicLib +\endverbatim +(which you probably should not change) and the data is installed in the +"magnetic" sub-directory. (The second directory name is an alternate name +that Windows 7 uses for the "Application Data" directory.) + +Otherwise download \e either the tar.bz2 file \e or the zip file (they +have the same contents). To unpack these, run, for example +\verbatim + mkdir -p /usr/local/share/GeographicLib + tar xofjC wmm2010.tar.bz2 /usr/local/share/GeographicLib + tar xofjC emm2010.tar.bz2 /usr/local/share/GeographicLib + etc. +\endverbatim +and, again, the data will be placed in the "magnetic" subdirectory. + +However you install the magnetic models, all the datasets should be +installed in the same directory. GeographicLib::MagneticModel and +MagneticField uses a compile time +default to locate the datasets. This is +- /usr/local/share/GeographicLib/magnetic, for non-Windows systems +- C:/Documents and Settings/All Users/Application Data/GeographicLib/magnetic, + for Windows systems +. +consistent with the examples above. This may be overridden at run-time +by defining the MAGNETIC_PATH or the GEOGRAPHIC_DATA environment +variables; see GeographicLib::MagneticModel::DefaultMagneticPath() for +details. Finally, the path may be set using the optional second +argument to the GeographicLib::MagneticModel constructor or with the +"-d" flag to MagneticField. +Supplying the "-h" flag to +MagneticField reports the default +path for magnetic models for that utility. The "-v" flag causes +MagneticField to report the full path name of the data file it uses. + +\section magneticformat The format of the magnetic model files + +The constructor for GeographicLib::MagneticModel reads a file called +NAME.wmm which specifies various properties for the magnetic model. It +then opens a binary file NAME.wmm.cof to obtain the coefficients of the +spherical harmonic sum. + +The first line of the .wmm file must consist of "WMMF-v" where WMMF +stands for "World Magnetic Model Format" and v is the version number of +the format (currently "1"). + +The rest of the File is read a line at a time. A # character and +everything after it are discarded. If the result is just white space it +is discarded. The remaining lines are of the form "KEY WHITESPACE +VALUE". In general, the KEY and the VALUE are case-sensitive. + +GeographicLib::MagneticModel only pays attention to the following +keywords + - keywords that affect the field calculation, namely: + - Radius (required), the normalizing radius of the model in + meters. + - NumModels (default 1), the number of models. WMM2010 + consists of a single model giving the magnetic field and its time + variation at 2010. IGRF11 consists of 23 models for 1900 thru 2010 + at 5 year intervals. The time variation is given only for the last + model to allow extrapolation beyond 2010. For dates prior to 2010, + linear interpolation is used. + - Epoch (required), the time origin (in fractional years) for + the first model. + - DeltaEpoch (default 1), the interval between models in years + (only relevant for NumModels > 1). + - Normalization (default schmidt), the normalization used for + the associated Legendre functions (schmidt or full). + - ID (required), 8 printable characters which serve as a + signature for the .wmm.cof file (they must appear as the first 8 + bytes of this file). + - keywords that store data that the user can query: + - Name, the name of the model. + - Description, a more descriptive name of the model. + - ReleaseDate, when the model was created. + - MinTime, the minimum date at which the model should be used. + - MaxTime, the maximum date at which the model should be used. + - MinHeight, the minimum height above the ellipsoid for which + the model should be used. + - MaxHeight, the maximum height above the ellipsoid for which + the model should be used. + . + GeographicLib::MagneticModel does not enforce the restrictions + implied by last four quantities. However, + MagneticField issues a warning if + these limits are exceeded. + - keywords that are examined to verify that their values are valid: + - Type (default linear), the type of the model. "linear" + means that the time variation is piece-wise linear (either using + interpolation between the field at two dates or using the field and + its first derivative with respect to time). This is the only type + of model supported at present. + - ByteOrder (default little), the order of bytes in the + .wmm.cof file. Only little endian is supported at present. + . +Other keywords are ignored. + +The coefficient file NAME.wmm.cof is a binary file in little endian +order. The first 8 bytes of this file must match the ID given in +NAME.wmm. This is followed by NumModels + 1 sets of spherical harmonic +coefficients. The first NumModels of these model the magnetic field at +Epoch + \e i * DeltaEpoch for 0 ≤ \e i < NumModels. The last set of +coefficients model the rate of change of the magnetic field at Epoch + +(NumModels − 1) * DeltaEpoch. The format for each set of coefficients +is: + - \e N, the maximum degree of the sum stored as a 4-byte signed integer. + This must satisfy \e N ≥ −1. + - \e M, the maximum order of the sum stored as a 4-byte signed integer. + This must satisfy \e N ≥ \e M ≥ −1. + - \e C\e nm, the coefficients of the cosine coefficients of + the sum in column (i.e., \e m) major order. There are (\e M + 1) + (2\e N − \e M + 2) / 2 elements which are stored as IEEE doubles (8 + bytes). For example for \e N = \e M = 3, there are 10 coefficients + arranged as + C00, + C10, + C20, + C30, + C11, + C21, + C31, + C22, + C32, + C33. + - \e S\e nm, the coefficients of the sine coefficients of + the sum in column (i.e., \e m) major order starting at \e m = 1. + There are \e M (2\e N − \e M + 1) / 2 elements which are stored as + IEEE doubles (8 bytes). For example for \e N = \e M = 3, there are 6 + coefficients arranged as + S11, + S21, + S31, + S22, + S32, + S33. + . +Although the coefficient file is in little endian order, %GeographicLib +can read it on big endian machines. It can only be read on machines +which store doubles in IEEE format. + +As an illustration, here is igrf11.wmm: +\verbatim +WMMF-1 +# A World Magnetic Model (Format 1) file. For documentation on the +# format of this file see +# http://geographiclib.sf.net/html/magnetic.html#magneticformat +Name igrf11 +Description International Geomagnetic Reference Field 11th Generation +URL http://ngdc.noaa.gov/IAGA/vmod/igrf.html +Publisher National Oceanic and Atmospheric Administration +ReleaseDate 2009-12-15 +DataCutOff 2009-10-01 +ConversionDate 2011-11-04 +DataVersion 1 +Radius 6371200 +NumModels 23 +Epoch 1900 +DeltaEpoch 5 +MinTime 1900 +MaxTime 2015 +MinHeight -1000 +MaxHeight 600000 + +# The coefficients are stored in a file obtained by appending ".cof" to +# the name of this file. The coefficients were obtained from IGRF11.COF +# in the geomag70 distribution. +ID IGRF11-A +\endverbatim + +
+Back to \ref gravity. Forward to \ref geodesic. Up to \ref contents. +
+**********************************************************************/ +/** +\page geodesic Geodesics on an ellipsoid of revolution + +
+Back to \ref magnetic. Forward to \ref triaxial. Up to \ref contents. +
+ +GeographicLib::Geodesic and GeographicLib::GeodesicLine provide accurate +solutions to the direct and inverse geodesic problems. The +GeodSolve utility provides an interface +to these classes. GeographicLib::AzimuthalEquidistant implements the +azimuthal equidistant projection in terms of geodesics. +GeographicLib::CassiniSoldner implements a transverse cylindrical +equidistant projection in terms of geodesics. The GeodesicProj utility provides an +interface to these projections. + +The algorithms used by GeographicLib::Geodesic and +GeographicLib::GeodesicLine are based on a Taylor expansion of the +geodesic integrals valid when the flattening \e f is small. +GeographicLib::GeodesicExact and GeographicLib::GeodesicLineExact +evaluate the integrals exactly (in terms of incomplete elliptic +integrals). For the WGS84 ellipsoid, the series solutions are about +2--3 times faster and 2--3 times more accurate (because it's easier to +control round-off errors with series solutions); thus +GeographicLib::Geodesic and GeographicLib::GeodesicLine are +recommended for most geodetic applications. However, in applications +where the absolute value of \e f is greater than about 0.02, the exact +classes should be used. + +Go to + - \ref testgeod + - \ref geodseries + - \ref geodellip + - \ref meridian + - \ref geodshort + . +For some background information on geodesics on triaxial ellipsoids, see +\ref triaxial. + +References + - F. W. Bessel, + The calculation + of longitude and latitude from geodesic measurements (1825), + Astron. Nachr. 331(8), 852-861 (2010); + translated by C. F. F. Karney and R. E. Deakin. Preprint: + arXiv:0908.1824. + - F. R. Helmert, + + Mathematical and Physical Theories of Higher Geodesy, Part 1 (1880), + Aeronautical Chart and Information Center (St. Louis, 1964), + Chaps. 5--7. + - J. Danielsen, + The Area under the Geodesic, + Survey Review 30(232), 61--66 (1989). + - C. F. F. Karney, + + Algorithms for geodesics, + J. Geodesy 87(1), 43--55 (Jan. 2013); + DOI: + 10.1007/s00190-012-0578-z; + addenda: + geod-addenda.html; + resource page: + geod.html. + - A collection of some papers on geodesics is available at + http://geographiclib.sourceforge.net/geodesic-papers/biblio.html + - The wikipedia page, + + Geodesics on an ellipsoid. + +\section testgeod Test data for geodesics + +A test set a geodesics is available at + - + GeodTest.dat.gz + . +This is about 39 MB (compressed). This consists of a set of geodesics +for the WGS84 ellipsoid. A subset of this (consisting of 1/50 of the +members — about 690 kB, compressed) is available at + - + GeodTest-short.dat.gz + +Each line of the test set gives 10 space delimited numbers + - latitude for point 1, \e lat1 (degrees, exact) + - longitude for point 1, \e lon1 (degrees, always 0) + - azimuth for point 1, \e azi1 (clockwise from north in degrees, exact) + - latitude for point 2, \e lat2 (degrees, accurate to + 10−18 deg) + - longitude for point 2, \e lon2 (degrees, accurate to + 10−18 deg) + - azimuth for point 2, \e azi2 (degrees, accurate to + 10−18 deg) + - geodesic distance from point 1 to point 2, \e s12 (meters, exact) + - arc distance on the auxiliary sphere, \e a12 (degrees, accurate to + 10−18 deg) + - reduced length of the geodesic, \e m12 (meters, accurate to 0.1 pm) + - the area under the geodesic, \e S12 (m2, accurate to + 1 mm2) + . +These are computed using as direct geodesic calculations with the given +\e lat1, \e lon1, \e azi1, and \e s12. The distance \e s12 always +corresponds to an arc length \e a12 ≤ 180°, so the given +geodesics give the shortest paths from point 1 to point 2. For +simplicity and without loss of generality, \e lat1 is chosen in +[0°, 90°], \e lon1 is taken to be zero, \e azi1 is +chosen in [0°, 180°]. Furthermore, \e lat1 and \e +azi1 are taken to be multiples of 10−12 deg and \e s12 +is a multiple of 0.1 μm in [0 m, 20003931.4586254 m]. This results \e +lon2 in [0°, 180°] and \e azi2 in [0°, 180°]. + +The direct calculation uses an expansion of the geodesic equations +accurate to f30 (approximately 1 part in 1050) +and is computed with with +Maxima's +bfloats and fpprec set to 100 (so the errors in the data are probably +1/2 of the values quoted above). + +The contents of the file are as follows: + - 100000 entries randomly distributed + - 50000 entries which are nearly antipodal + - 50000 entries with short distances + - 50000 entries with one end near a pole + - 50000 entries with both ends near opposite poles + - 50000 entries which are nearly meridional + - 50000 entries which are nearly equatorial + - 50000 entries running between vertices (\e azi1 = \e azi2 = 90°) + - 50000 entries ending close to vertices + . +(a total of 500000 entries). The values for \e s12 for the geodesics +running between vertices are truncated to a multiple of 0.1 pm and this +is used to determine point 2. + +This data can be fed to the GeodSolve +utility as follows + - Direct from point 1: +\verbatim + gunzip -c GeodTest.dat.gz | cut -d' ' -f1,2,3,7 | ./GeodSolve +\endverbatim + This should yield columns 4, 5, 6, and 9 of the test set. + - Direct from point 2: +\verbatim + gunzip -c GeodTest.dat.gz | cut -d' ' -f4,5,6,7 | + sed "s/ \([^ ]*$\)/ -\1/" | ./GeodSolve +\endverbatim + (The sed command negates the distance.) This should yield columns 1, + 2, and 3, and the negative of column 9 of the test set. + - Inverse between points 1 and 2: +\verbatim + gunzip -c GeodTest.dat.gz | cut -d' ' -f1,2,4,5 | ./GeodSolve -i +\endverbatim + This should yield columns 3, 6, 7, and 9 of the test set. + . +Add, e.g., "-p 6", to the call to GeodSolve to change the precision of +the output. Adding "-f" causes GeodSolve to print 12 fields specifying +the geodesic; these include the 10 fields in the test set plus the +geodesic scales \e M12 and \e M21 which are inserted between \e m12 and +\e S12. + +Code for computing arbitrarily accurate geodesics in maxima is available +in geodesic.mac (this depends on + ellint.mac and uses the series computed by + geod.mac). This solve both the direct and +inverse geodesic problems and offers the ability to solve the problems +either using series expansions (similar to GeographicLib::Geodesic) or +in terms of elliptic integrals (similar to +GeographicLib::GeodesicExact). + +\section geodseries Expansions for geodesics + +We give here the series expansions for the various geodesic integrals +valid to order f10. In this release of the code, we +use a 6th-order expansions. This is sufficient to maintain accuracy +for doubles for the SRMmax ellipsoid (\e a = 6400 km, \e f = 1/150). +However, the preprocessor macro GEOGRAPHICLIB_GEODESIC_ORDER can be +used to select any order up to 8. (If using long doubles, with a +64-bit fraction, the default order is 7.) The series expanded to +order f30 are given in +geodseries30.html. + +In the formulas below ^ indicates exponentiation (\e f^3 = +f3) and / indicates real division (3/5 = 0.6). The +equations need to be converted to Horner form, but are here left in +expanded form so that they can be easily truncated to lower order. +These expansions were obtained using the Maxima code, +geod.mac. + +In the expansions below, we have + - \f$ \alpha \f$ is the azimuth + - \f$ \alpha_0 \f$ is the azimuth at the equator crossing + - \f$ \lambda \f$ is the longitude measured from the equator crossing + - \f$ \sigma \f$ is the spherical arc length + - \f$ \omega = \tan^{-1}(\sin\alpha_0\tan\sigma) \f$ is the spherical longitude + - \f$ a \f$ is the equatorial radius + - \f$ b \f$ is the polar semi-axis + - \f$ f \f$ is the flattening + - \f$ e^2 = f(2 - f) \f$ + - \f$ e'^2 = e^2/(1-e^2) \f$ + - \f$ k^2 = e'^2 \cos^2\alpha_0 = 4 \epsilon / (1 - \epsilon)^2 \f$ + - \f$ n = f / (2 - f) \f$ + - \f$ c^2 = a^2/2 + b^2/2 (\tanh^{-1}e)/e \f$ + - \e ep2 = \f$ e'^2 \f$ + - \e k2 = \f$ k^2 \f$ + - \e eps = \f$ \epsilon \f$ + +The formula for distance is +\f[ + \frac sb = I_1(\sigma) +\f] +where +\f[ +\begin{aligned} + I_1(\sigma) &= A_1\bigl(\sigma + B_1(\sigma)\bigr) \\ + B_1(\sigma) &= \sum_{j=1} C_{1j} \sin 2j\sigma +\end{aligned} +\f] +and +\verbatim +A1 = (1 + 1/4 * eps^2 + + 1/64 * eps^4 + + 1/256 * eps^6 + + 25/16384 * eps^8 + + 49/65536 * eps^10) / (1 - eps); +\endverbatim +\verbatim +C1[1] = - 1/2 * eps + + 3/16 * eps^3 + - 1/32 * eps^5 + + 19/2048 * eps^7 + - 3/4096 * eps^9; +C1[2] = - 1/16 * eps^2 + + 1/32 * eps^4 + - 9/2048 * eps^6 + + 7/4096 * eps^8 + + 1/65536 * eps^10; +C1[3] = - 1/48 * eps^3 + + 3/256 * eps^5 + - 3/2048 * eps^7 + + 17/24576 * eps^9; +C1[4] = - 5/512 * eps^4 + + 3/512 * eps^6 + - 11/16384 * eps^8 + + 3/8192 * eps^10; +C1[5] = - 7/1280 * eps^5 + + 7/2048 * eps^7 + - 3/8192 * eps^9; +C1[6] = - 7/2048 * eps^6 + + 9/4096 * eps^8 + - 117/524288 * eps^10; +C1[7] = - 33/14336 * eps^7 + + 99/65536 * eps^9; +C1[8] = - 429/262144 * eps^8 + + 143/131072 * eps^10; +C1[9] = - 715/589824 * eps^9; +C1[10] = - 2431/2621440 * eps^10; +\endverbatim + +The function \f$ \tau(\sigma) = s/(b A_1) = \sigma + B_1(\sigma) \f$ +may be inverted by series reversion giving +\f[ + \sigma(\tau) = \tau + \sum_{j=1} C'_{1j} \sin 2j\sigma +\f] +where +\verbatim +C1'[1] = + 1/2 * eps + - 9/32 * eps^3 + + 205/1536 * eps^5 + - 4879/73728 * eps^7 + + 9039/327680 * eps^9; +C1'[2] = + 5/16 * eps^2 + - 37/96 * eps^4 + + 1335/4096 * eps^6 + - 86171/368640 * eps^8 + + 4119073/28311552 * eps^10; +C1'[3] = + 29/96 * eps^3 + - 75/128 * eps^5 + + 2901/4096 * eps^7 + - 443327/655360 * eps^9; +C1'[4] = + 539/1536 * eps^4 + - 2391/2560 * eps^6 + + 1082857/737280 * eps^8 + - 2722891/1548288 * eps^10; +C1'[5] = + 3467/7680 * eps^5 + - 28223/18432 * eps^7 + + 1361343/458752 * eps^9; +C1'[6] = + 38081/61440 * eps^6 + - 733437/286720 * eps^8 + + 10820079/1835008 * eps^10; +C1'[7] = + 459485/516096 * eps^7 + - 709743/163840 * eps^9; +C1'[8] = + 109167851/82575360 * eps^8 + - 550835669/74317824 * eps^10; +C1'[9] = + 83141299/41287680 * eps^9; +C1'[10] = + 9303339907/2972712960 * eps^10; +\endverbatim + +The reduced length is given by +\f[ +\begin{aligned} + \frac mb &= \sqrt{1 + k^2 \sin^2\sigma_2} \cos\sigma_1 \sin\sigma_2 \\ + &\quad {}-\sqrt{1 + k^2 \sin^2\sigma_1} \sin\sigma_1 \cos\sigma_2 \\ + &\quad {}-\cos\sigma_1 \cos\sigma_2 \bigl(J(\sigma_2) - J(\sigma_1)\bigr) +\end{aligned} +\f] +where +\f[ +\begin{aligned} + J(\sigma) &= I_1(\sigma) - I_2(\sigma) \\ + I_2(\sigma) &= A_2\bigl(\sigma + B_2(\sigma)\bigr) \\ + B_2(\sigma) &= \sum_{j=1} C_{2j} \sin 2j\sigma +\end{aligned} +\f] +\verbatim +A2 = (1 + 1/4 * eps^2 + + 9/64 * eps^4 + + 25/256 * eps^6 + + 1225/16384 * eps^8 + + 3969/65536 * eps^10) * (1 - eps); +\endverbatim +\verbatim +C2[1] = + 1/2 * eps + + 1/16 * eps^3 + + 1/32 * eps^5 + + 41/2048 * eps^7 + + 59/4096 * eps^9; +C2[2] = + 3/16 * eps^2 + + 1/32 * eps^4 + + 35/2048 * eps^6 + + 47/4096 * eps^8 + + 557/65536 * eps^10; +C2[3] = + 5/48 * eps^3 + + 5/256 * eps^5 + + 23/2048 * eps^7 + + 191/24576 * eps^9; +C2[4] = + 35/512 * eps^4 + + 7/512 * eps^6 + + 133/16384 * eps^8 + + 47/8192 * eps^10; +C2[5] = + 63/1280 * eps^5 + + 21/2048 * eps^7 + + 51/8192 * eps^9; +C2[6] = + 77/2048 * eps^6 + + 33/4096 * eps^8 + + 2607/524288 * eps^10; +C2[7] = + 429/14336 * eps^7 + + 429/65536 * eps^9; +C2[8] = + 6435/262144 * eps^8 + + 715/131072 * eps^10; +C2[9] = + 12155/589824 * eps^9; +C2[10] = + 46189/2621440 * eps^10; +\endverbatim + +The longitude is given in terms of the spherical longitude by +\f[ +\lambda = \omega - f \sin\alpha_0 I_3(\sigma) +\f] +where +\f[ +\begin{aligned} + I_3(\sigma) &= A_3\bigl(\sigma + B_3(\sigma)\bigr) \\ + B_3(\sigma) &= \sum_{j=1} C_{3j} \sin 2j\sigma +\end{aligned} +\f] +and +\verbatim +A3 = 1 - (1/2 - 1/2*n) * eps + - (1/4 + 1/8*n - 3/8*n^2) * eps^2 + - (1/16 + 3/16*n + 1/16*n^2 - 5/16*n^3) * eps^3 + - (3/64 + 1/32*n + 5/32*n^2 + 5/128*n^3 - 35/128*n^4) * eps^4 + - (3/128 + 5/128*n + 5/256*n^2 + 35/256*n^3 + 7/256*n^4) * eps^5 + - (5/256 + 15/1024*n + 35/1024*n^2 + 7/512*n^3) * eps^6 + - (25/2048 + 35/2048*n + 21/2048*n^2) * eps^7 + - (175/16384 + 35/4096*n) * eps^8 + - 245/32768 * eps^9; +\endverbatim +\verbatim +C3[1] = + (1/4 - 1/4*n) * eps + + (1/8 - 1/8*n^2) * eps^2 + + (3/64 + 3/64*n - 1/64*n^2 - 5/64*n^3) * eps^3 + + (5/128 + 1/64*n + 1/64*n^2 - 1/64*n^3 - 7/128*n^4) * eps^4 + + (3/128 + 11/512*n + 3/512*n^2 + 1/256*n^3 - 7/512*n^4) * eps^5 + + (21/1024 + 5/512*n + 13/1024*n^2 + 1/512*n^3) * eps^6 + + (243/16384 + 189/16384*n + 83/16384*n^2) * eps^7 + + (435/32768 + 109/16384*n) * eps^8 + + 345/32768 * eps^9; +C3[2] = + (1/16 - 3/32*n + 1/32*n^2) * eps^2 + + (3/64 - 1/32*n - 3/64*n^2 + 1/32*n^3) * eps^3 + + (3/128 + 1/128*n - 9/256*n^2 - 3/128*n^3 + 7/256*n^4) * eps^4 + + (5/256 + 1/256*n - 1/128*n^2 - 7/256*n^3 - 3/256*n^4) * eps^5 + + (27/2048 + 69/8192*n - 39/8192*n^2 - 47/4096*n^3) * eps^6 + + (187/16384 + 39/8192*n + 31/16384*n^2) * eps^7 + + (287/32768 + 47/8192*n) * eps^8 + + 255/32768 * eps^9; +C3[3] = + (5/192 - 3/64*n + 5/192*n^2 - 1/192*n^3) * eps^3 + + (3/128 - 5/192*n - 1/64*n^2 + 5/192*n^3 - 1/128*n^4) * eps^4 + + (7/512 - 1/384*n - 77/3072*n^2 + 5/3072*n^3 + 65/3072*n^4) * eps^5 + + (3/256 - 1/1024*n - 71/6144*n^2 - 47/3072*n^3) * eps^6 + + (139/16384 + 143/49152*n - 383/49152*n^2) * eps^7 + + (243/32768 + 95/49152*n) * eps^8 + + 581/98304 * eps^9; +C3[4] = + (7/512 - 7/256*n + 5/256*n^2 - 7/1024*n^3 + 1/1024*n^4) * eps^4 + + (7/512 - 5/256*n - 7/2048*n^2 + 9/512*n^3 - 21/2048*n^4) * eps^5 + + (9/1024 - 43/8192*n - 129/8192*n^2 + 39/4096*n^3) * eps^6 + + (127/16384 - 23/8192*n - 165/16384*n^2) * eps^7 + + (193/32768 + 3/8192*n) * eps^8 + + 171/32768 * eps^9; +C3[5] = + (21/2560 - 9/512*n + 15/1024*n^2 - 7/1024*n^3 + 9/5120*n^4) * eps^5 + + (9/1024 - 15/1024*n + 3/2048*n^2 + 57/5120*n^3) * eps^6 + + (99/16384 - 91/16384*n - 781/81920*n^2) * eps^7 + + (179/32768 - 55/16384*n) * eps^8 + + 141/32768 * eps^9; +C3[6] = + (11/2048 - 99/8192*n + 275/24576*n^2 - 77/12288*n^3) * eps^6 + + (99/16384 - 275/24576*n + 55/16384*n^2) * eps^7 + + (143/32768 - 253/49152*n) * eps^8 + + 33/8192 * eps^9; +C3[7] = + (429/114688 - 143/16384*n + 143/16384*n^2) * eps^7 + + (143/32768 - 143/16384*n) * eps^8 + + 429/131072 * eps^9; +C3[8] = + (715/262144 - 429/65536*n) * eps^8 + + 429/131072 * eps^9; +C3[9] = + 2431/1179648 * eps^9; +\endverbatim + +The formula for area between the geodesic and the equator is given in +Sec. 6 of +Algorithms for geodesics in terms of \e S, +\f[ +S = c^2 \alpha + e^2 a^2 \cos\alpha_0 \sin\alpha_0 I_4(\sigma) +\f] +where +\f[ +I_4(\sigma) = \sum_{j=0} C_{4j} \cos(2j+1)\sigma +\f] +In the paper, this was expanded in \f$ e'^2 \f$ and \f$ k^2 \f$. +However, the series converges faster for eccentric ellipsoids if the +expansion is in \f$ n \f$ and \f$ \epsilon \f$. The series to order +\f$ f^{10} \f$ becomes +\verbatim +C4[0] = + (2/3 - 4/15*n + 8/105*n^2 + 4/315*n^3 + 16/3465*n^4 + 20/9009*n^5 + 8/6435*n^6 + 28/36465*n^7 + 32/62985*n^8 + 4/11305*n^9) + - (1/5 - 16/35*n + 32/105*n^2 - 16/385*n^3 - 64/15015*n^4 - 16/15015*n^5 - 32/85085*n^6 - 112/692835*n^7 - 128/1616615*n^8) * eps + - (2/105 + 32/315*n - 1088/3465*n^2 + 1184/5005*n^3 - 128/3465*n^4 - 3232/765765*n^5 - 1856/1616615*n^6 - 6304/14549535*n^7) * eps^2 + + (11/315 - 368/3465*n - 32/6435*n^2 + 976/4095*n^3 - 154048/765765*n^4 + 368/11115*n^5 + 5216/1322685*n^6) * eps^3 + + (4/1155 + 1088/45045*n - 128/1287*n^2 + 64/3927*n^3 + 2877184/14549535*n^4 - 370112/2078505*n^5) * eps^4 + + (97/15015 - 464/45045*n + 4192/153153*n^2 - 88240/969969*n^3 + 31168/1322685*n^4) * eps^5 + + (10/9009 + 4192/765765*n - 188096/14549535*n^2 + 23392/855855*n^3) * eps^6 + + (193/85085 - 6832/2078505*n + 106976/14549535*n^2) * eps^7 + + (632/1322685 + 3456/1616615*n) * eps^8 + + 107/101745 * eps^9; +C4[1] = + (1/45 - 16/315*n + 32/945*n^2 - 16/3465*n^3 - 64/135135*n^4 - 16/135135*n^5 - 32/765765*n^6 - 112/6235515*n^7 - 128/14549535*n^8) * eps + - (2/105 - 64/945*n + 128/1485*n^2 - 1984/45045*n^3 + 256/45045*n^4 + 64/109395*n^5 + 128/855855*n^6 + 2368/43648605*n^7) * eps^2 + - (1/105 - 16/2079*n - 5792/135135*n^2 + 3568/45045*n^3 - 103744/2297295*n^4 + 264464/43648605*n^5 + 544/855855*n^6) * eps^3 + + (4/1155 - 2944/135135*n + 256/9009*n^2 + 17536/765765*n^3 - 3053056/43648605*n^4 + 1923968/43648605*n^5) * eps^4 + + (1/9009 + 16/19305*n - 2656/153153*n^2 + 65072/2078505*n^3 + 526912/43648605*n^4) * eps^5 + + (10/9009 - 1472/459459*n + 106112/43648605*n^2 - 204352/14549535*n^3) * eps^6 + + (349/2297295 + 28144/43648605*n - 32288/8729721*n^2) * eps^7 + + (632/1322685 - 44288/43648605*n) * eps^8 + + 43/479655 * eps^9; +C4[2] = + (4/525 - 32/1575*n + 64/3465*n^2 - 32/5005*n^3 + 128/225225*n^4 + 32/765765*n^5 + 64/8083075*n^6 + 32/14549535*n^7) * eps^2 + - (8/1575 - 128/5775*n + 256/6825*n^2 - 6784/225225*n^3 + 4608/425425*n^4 - 128/124355*n^5 - 5888/72747675*n^6) * eps^3 + - (8/1925 - 1856/225225*n - 128/17325*n^2 + 42176/1276275*n^3 - 2434816/72747675*n^4 + 195136/14549535*n^5) * eps^4 + + (8/10725 - 128/17325*n + 64256/3828825*n^2 - 128/25935*n^3 - 266752/10392525*n^4) * eps^5 + - (4/25025 + 928/3828825*n + 292288/72747675*n^2 - 106528/6613425*n^3) * eps^6 + + (464/1276275 - 17152/10392525*n + 83456/72747675*n^2) * eps^7 + + (1168/72747675 + 128/1865325*n) * eps^8 + + 208/1119195 * eps^9; +C4[3] = + (8/2205 - 256/24255*n + 512/45045*n^2 - 256/45045*n^3 + 1024/765765*n^4 - 256/2909907*n^5 - 512/101846745*n^6) * eps^3 + - (16/8085 - 1024/105105*n + 2048/105105*n^2 - 1024/51051*n^3 + 4096/373065*n^4 - 1024/357357*n^5) * eps^4 + - (136/63063 - 256/45045*n + 512/1072071*n^2 + 494336/33948915*n^3 - 44032/1996995*n^4) * eps^5 + + (64/315315 - 16384/5360355*n + 966656/101846745*n^2 - 868352/101846745*n^3) * eps^6 + - (16/97461 + 14848/101846745*n + 74752/101846745*n^2) * eps^7 + + (5024/33948915 - 96256/101846745*n) * eps^8 + - 1744/101846745 * eps^9; +C4[4] = + (64/31185 - 512/81081*n + 1024/135135*n^2 - 512/109395*n^3 + 2048/1247103*n^4 - 2560/8729721*n^5) * eps^4 + - (128/135135 - 2048/405405*n + 77824/6891885*n^2 - 198656/14549535*n^3 + 8192/855855*n^4) * eps^5 + - (512/405405 - 2048/530145*n + 299008/130945815*n^2 + 280576/43648605*n^3) * eps^6 + + (128/2297295 - 2048/1438965*n + 241664/43648605*n^2) * eps^7 + - (17536/130945815 + 1024/43648605*n) * eps^8 + + 2944/43648605 * eps^9; +C4[5] = + (128/99099 - 2048/495495*n + 4096/765765*n^2 - 6144/1616615*n^3 + 8192/4849845*n^4) * eps^5 + - (256/495495 - 8192/2807805*n + 376832/53348295*n^2 - 8192/855855*n^3) * eps^6 + - (6784/8423415 - 432128/160044885*n + 397312/160044885*n^2) * eps^7 + + (512/53348295 - 16384/22863555*n) * eps^8 + - 16768/160044885 * eps^9; +C4[6] = + (512/585585 - 4096/1422135*n + 8192/2078505*n^2 - 4096/1322685*n^3) * eps^6 + - (1024/3318315 - 16384/9006855*n + 98304/21015995*n^2) * eps^7 + - (103424/189143955 - 8192/4203199*n) * eps^8 + - 1024/189143955 * eps^9; +C4[7] = + (1024/1640925 - 65536/31177575*n + 131072/43648605*n^2) * eps^7 + - (2048/10392525 - 262144/218243025*n) * eps^8 + - 84992/218243025 * eps^9; +C4[8] = + (16384/35334585 - 131072/82447365*n) * eps^8 + - 32768/247342095 * eps^9; +C4[9] = + 32768/92147055 * eps^9; +\endverbatim + +\section geodellip Geodesics in terms of elliptic integrals + +GeographicLib::GeodesicExact and GeographicLib::GeodesicLineExact solve +the geodesic problem using elliptic integrals. The formulation of +geodesic in terms of incomplete elliptic integrals is given in + - C. F. F. Karney, + Geodesics + on an ellipsoid of revolution, + Feb. 2011; preprint + arxiv:1102.1215v1. + . +It is most convenient to use the form derived for a prolate ellipsoid in +Appendix D. For an oblate ellipsoid this results in elliptic integrals +with an imaginary modulus. However, the integrals themselves are real +and the algorithms used to compute the elliptic integrals handles the +case of an imaginary modulus using real arithmetic. + +The key relations used by %GeographicLib are +\f[ + \begin{aligned} + \frac sb &= E(\sigma, ik), \\ + \lambda &= (1 - f) \sin\alpha_0 G(\sigma, \cos^2\alpha_0, ik) \\ + &= \chi + - \frac{e'^2}{\sqrt{1+e'^2}}\sin\alpha_0 H(\sigma, -e'^2, ik), \\ + J(\sigma) &= k^2 D(\sigma, ik), + \end{aligned} +\f] +where \f$ \chi \f$ is a modified spherical longitude given by +\f[ +\tan\chi = \sqrt{\frac{1+e'^2}{1+k^2\sin^2\sigma}}\tan\omega, +\f] +and +\f[ + \begin{aligned} + D(\phi,k) &= \int_0^\phi + \frac{\sin^2\theta}{\sqrt{1 - k^2\sin^2\theta}}\,d\theta\\ + &=\frac{F(\phi, k) - E(\phi, k)}{k^2},\\ + G(\phi,\alpha^2,k) &= \int_0^\phi + \frac{\sqrt{1 - k^2\sin^2\theta}}{1 - \alpha^2\sin^2\theta}\,d\theta\\ + &=\frac{k^2}{\alpha^2}F(\phi, k) + +\biggl(1-\frac{k^2}{\alpha^2}\biggr)\Pi(\phi, \alpha^2, k),\\ + H(\phi, \alpha^2, k) + &= \int_0^\phi + \frac{\cos^2\theta}{(1-\alpha^2\sin^2\theta)\sqrt{1-k^2\sin^2\theta}} + \,d\theta \\ + &= + \frac1{\alpha^2} F(\phi, k) + + \biggl(1 - \frac1{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k), + \end{aligned} +\f] +and \f$F(\phi, k)\f$, \f$E(\phi, k)\f$, \f$D(\phi, k)\f$, and +\f$\Pi(\phi, \alpha^2, k)\f$, are incomplete elliptic integrals (see +http://dlmf.nist.gov/19.2.ii). The formula for \f$ s \f$ and the +first expression for \f$ \lambda \f$ are given by Legendre (1811) and +are the most common representation of geodesics in terms of elliptic +integrals. The second (equivalent) expression for \f$ \lambda \f$, +which was given by Cayley (1870), is useful in that the elliptic +integral is relegated to a small correction term. This form allows +the longitude to be computed more accurately and is used in +%GeographicLib. (The equivalence of the two expressions for \f$ +\lambda \f$ follows from http://dlmf.nist.gov/19.7.E8.) + +Nominally, GeographicLib::GeodesicExact and +GeographicLib::GeodesicLineExact will give "exact" results for any value +of the flattening. However, the geographic latitude is a distorted +measure of distance from the equator with very eccentric ellipsoids and +this introducing an irreducible representational error in the algorithms +in this case. It is therefore recommended to restrict the use of these +classes to \e b/\e a ∈ [0.01, 100] or \e f ∈ [-99, 0.99]. +Note that GeographicLib::GeodesicExact still uses a series expansion for +the area \e S12. However the series is taken out to 30th order and +gives accurate results for \e b/\e a ∈ [1/2, 2]; the accuracy is +about 8 decimal digits for \e b/\e a ∈ [1/4, 4]. Additional work +planned for this aspect of the geodesic problem: +- formulate the area integral \e S12 in terms of elliptic integrals; +- generate accurate test geodesics for highly eccentric ellipsoids so + that the roundoff errors can be quantified. + +Thomas (1952) and Rollins (2010) use a different independent variable +for geodesics, \f$\theta\f$ instead of \f$\sigma\f$, where \f$ +\tan\theta = \sqrt{1 + k^2} \tan\sigma \f$. The corresponding +expressions for \f$ s \f$ and \f$ \lambda \f$ are given here for +completeness: +\f[ +\begin{aligned} +\frac sb &= \sqrt{1-k'^2} \Pi(\theta, k'^2, k'), \\ +\lambda &= (1-f) \sqrt{1-k'^2} \sin\alpha_0 \Pi(\theta, k'^2/e^2, k'), +\end{aligned} +\f] +where \f$ k' = k/\sqrt{1 + k^2} \f$. The expression for \f$ s \f$ +can be written in terms of elliptic integrals of the second kind and +Cayley's technique can be used to subtract out the leading order +behavior of \f$ \lambda \f$ to give +\f[ +\begin{aligned} +\frac sb &=\frac1{\sqrt{1-k'^2}} + \biggl( E(\theta, k') - + \frac{k'^2 \sin\theta \cos\theta}{\sqrt{1-k'^2\sin^2\theta}} \biggr), \\ +\lambda &= \psi + (1-f) \sqrt{1-k'^2} \sin\alpha_0 +\bigl( F(\theta, k') - \Pi(\theta, e^2, k') \bigr), +\end{aligned} +\f] +where +\f[ +\begin{aligned} +\tan\psi &= \sqrt{\frac{1+k^2\sin^2\sigma}{1+e'^2}}\tan\omega \\ + &= \sqrt{\frac{1-e^2}{1+k^2\cos^2\theta}}\sin\alpha_0\tan\theta. +\end{aligned} +\f] +The tangents of the three "longitude-like" angles are in geometric +progression, \f$ \tan\chi/\tan\omega = \tan\omega/\tan\psi \f$. + +\section meridian Parameters for the meridian + +The formulas for \f$ s \f$ given in the previous section are the same as +those for the distance along a meridian for an ellipsoid with equatorial +radius \f$ a \sqrt{1 - e^2 \sin^2\alpha_0} \f$ and polar semi-axis \f$ b +\f$. Here is a list of possible ways of expressing the meridian +distance in terms of elliptic integrals using the notation: +- \f$ a \f$, equatorial axis, +- \f$ b \f$, polar axis, +- \f$ e = \sqrt{(a^2 - b^2)/a^2} \f$, eccentricity, +- \f$ e' = \sqrt{(a^2 - b^2)/b^2} \f$, second eccentricity, +- \f$ \phi = \mathrm{am}(u, e) \f$, the geographic latitude, +- \f$ \phi' = \mathrm{am}(v', ie') = \pi/2 - \phi \f$, + the geographic colatitude, +- \f$ \beta = \mathrm{am}(v, ie') \f$, the parametric latitude + (\f$ \tan^2\beta = (1 - e^2) \tan^2\phi \f$), +- \f$ \beta' = \mathrm{am}(u', e) = \pi/2 - \beta \f$, + the parametric colatitude, +- \f$ M \f$, the length of a quarter meridian (equator to pole), +- \f$ y \f$, the distance along the meridian (measured from the equator). +- \f$ y' = M -y \f$, the distance along the meridian (measured from the pole). +. +The eccentricities \f$ (e, e') \f$ are real (resp. imaginary) for +oblate (resp. prolate) ellipsoids. The elliptic variables \f$(u, +u')\f$ and \f$(v, v')\f$ are defined by +- \f$ u = F(\phi, e) ,\quad u' = F(\beta', e) \f$ +- \f$ v = F(\beta, ie') ,\quad v' = F(\phi', ie') \f$, +. +and are linearly related by +- \f$ u + u' = K(e) ,\quad v + v' = K(ie') \f$ +- \f$ v = \sqrt{1-e^2} u ,\quad u = \sqrt{1+e'^2} v \f$. +. +The cartesian coordinates for the meridian \f$ (x, y) \f$ are given by +\f[ +\begin{aligned} + x &= a \cos\beta = a \cos\phi / \sqrt{1 - e^2 \sin^2\phi} \\ + &= a \sin\beta' = (a^2/b) \sin\phi' / \sqrt{1 + e'^2 \sin^2\phi'} \\ + &= a \,\mathrm{cn}(v, ie) = a \,\mathrm{cd}(u, e) \\ + &= a \,\mathrm{sn}(u', e) = (a^2/b) \,\mathrm{sd}(v', ie'), +\end{aligned} +\f] +\f[ +\begin{aligned} + z &= b \sin\beta = (b^2/a) \sin\phi / \sqrt{1 - e^2 \sin^2\phi} \\ + &= b \cos\beta' = b \cos\phi' / \sqrt{1 + e'^2 \sin^2\phi'} \\ + &= b \,\mathrm{sn}(v, ie) = (b^2/a) \,\mathrm{sd}(u, e) \\ + &= b \,\mathrm{cn}(u', e) = b \,\mathrm{cd}(v', ie'). +\end{aligned} +\f] +The distance along the meridian can be expressed variously as +\f[ +\begin{aligned} + y &= b \int \sqrt{1 + e'^2 \sin^2\beta}\, d\beta + = b E(\beta, ie') \\ + &= \frac{b^2}a \int \frac1{(1 - e^2 \sin^2\phi)^{3/2}}\, d\phi + = \frac{b^2}a \Pi(\phi, e^2, e) \\ + &= a \biggl(E(\phi, e) - + \frac{e^2\sin\phi \cos\phi}{\sqrt{1 - e^2\sin^2\phi}}\biggr) \\ + &= b \int \mathrm{dn}^2(v, ie')\, dv + = \frac{b^2}a \int \mathrm{nd}^2(u, e)\, du + = \cal E(v, ie'), +\end{aligned} +\f] +\f[ +\begin{aligned} + y' &= a \int \sqrt{1 - e^2 \sin^2\beta'}\, d\beta' + = a E(\beta', e) \\ + &= \frac{a^2}b \int \frac1{(1 + e'^2 \sin^2\phi')^{3/2}}\, d\phi' + = \frac{a^2}b \Pi(\phi', -e'^2, ie') \\ + &= b \biggl(E(\phi', ie') + + \frac{e'^2\sin\phi' \cos\phi'}{\sqrt{1 + e'^2\sin^2\phi'}}\biggr) \\ + &= a \int \mathrm{dn}^2(u', e)\, du' + = \frac{a^2}b \int \mathrm{nd}^2(v', ie')\, dv' + = \cal E(u', e), +\end{aligned} +\f] +with the quarter meridian distance given by +\f[ + M = aE(e) = bE(ie') = (b^2/a)\Pi(e^2,e) = (a^2/b)\Pi(-e'^2,ie'). +\f] +(Here \f$ E, F, \Pi \f$ are elliptic integrals defined in +http://dlmf.nist.gov/19.2.ii. \f$ \cal E, \mathrm{am}, \mathrm{sn}, +\mathrm{cn}, \mathrm{sd}, \mathrm{cd}, \mathrm{dn}, \mathrm{nd} \f$ are +Jacobi elliptic functions defined in http://dlmf.nist.gov/22.2 and +http://dlmf.nist.gov/22.16.) + +There are several considerations in the choice of independent variable +for evaluate the meridian distance +- The use of an imaginary modulus (namely, \f$ ie' \f$, above) is of no + practical concern. The integrals are real in this case and modern + methods (%GeographicLib uses the method given in + http://dlmf.nist.gov/19.36.i) for computing integrals handles this + case using just real arithmetic. +- If the "natural" origin is the equator, choose one of \f$ \phi, \beta, + u, v \f$ (this might be preferred in geodesy). If it's the pole, + choose one of the complementary quantities \f$ \phi', \beta', u', v' + \f$ (this might be preferred by mathematicians). +- Applying these formulas to the geodesic problems, \f$ \beta \f$ + becomes the arc length, \f$ \sigma \f$, on the auxiliary sphere. This + is the traditional method of solution used by Legendre (1806), Oriani + (1806), Bessel (1825), Helmert (1880), Rainsford (1955), Thomas + (1970), Vincenty (1975), Rapp (1993), and so on. Many of the + solutions in terms of elliptic functions use one of the elliptic + variables (\f$ u \f$ or \f$ v \f$), see, for example, Jacobi (1855), + Halphen (1888), Forsyth (1896). In the context of geodesics \f$ + \phi \f$ becomes Thomas' variable \f$ \theta \f$; this is used by + Thomas (1952) and Rollins (2010) in their formulation of the + geodesic problem (see the previous section). +- For highly eccentric ellipsoids the variation of the meridian with + respect to \f$ \beta \f$ is considerably "better behaved" than other + choices (see the figure below). The choice of \f$ \phi \f$ is + probably a poor one in this case. +. +%GeographicLib uses the geodesic generalization of +\f$ y = b E(\beta, ie') \f$, namely \f$ s = b E(\sigma, ik) \f$. See +\ref geodellip. + +\image html meridian-measures.png "Comparison of meridian measures" + +\section geodshort Short geodesics + +Here we describe Bowring's method for solving the inverse geodesic +problem in the limit of short geodesics and contrast it with the great +circle solution using Bessel's auxiliary sphere. References: + - B. R. Bowring, The Direct and Inverse Problems for Short Geodesic + Lines on the Ellipsoid, Surveying and Mapping 41(2), 135--141 (1981). + - R. H. Rapp, + + Geometric Geodesy, Part I, Ohio State Univ. (1991), Sec. 6.5. + +Bowring considers the conformal mapping of the ellipsoid to a sphere of +radius \f$ R \f$ such that circles of latitude and meridians are +preserved (and hence the azimuth of a line is preserved). Let \f$ +(\phi, \lambda) \f$ and \f$ (\phi', \lambda') \f$ be the latitude and +longitude on the ellipsoid and sphere respectively. Define isometric +latitudes for the sphere and the ellipsoid as +\f[ +\begin{aligned} + \psi' &= \sinh^{-1} \tan \phi', \\ + \psi &= \sinh^{-1} \tan \phi - e \tanh^{-1}(e \sin\phi). +\end{aligned} +\f] +The most general conformal mapping satisfying Bowring's conditions is +\f[ +\psi' = A \psi + K, \quad \lambda' = A \lambda, +\f] +where \f$ A \f$ and \f$ K \f$ are constants. (In fact a constant can be +added to the equation for \f$ \lambda' \f$, but this does affect the +analysis.) The scale of this mapping is +\f[ +m(\phi) = \frac{AR}{\nu}\frac{\cos\phi'}{\cos\phi}, +\f] +where \f$ \nu = a/\sqrt{1 - e^2\sin^2\phi} \f$ is the transverse radius +of curvature. (Note that in Bowring's Eq. (10), \f$ \phi \f$ should be +replaced by \f$ \phi' \f$.) The mapping from the ellipsoid to the sphere +depends on three parameters \f$ R, A, K \f$. These will be selected to +satisfy certain conditions at some representative latitude \f$ \phi_0 +\f$. Two possible choices are given below. + +\subsection bowring Bowring's method + +Bowring (1981) requires that +\f[ +m(\phi_0) = 1,\quad +\left.\frac{dm(\phi)}{d\phi}\right|_{\phi=\phi_0} = 0,\quad +\left.\frac{d^2m(\phi)}{d\phi^2}\right|_{\phi=\phi_0} = 0, +\f] +i.e, \f$m\approx 1\f$ in the vicinity of \f$\phi = \phi_0\f$. +This gives +\f[ +\begin{aligned} +R &= \frac{\sqrt{1 + e'^2}}{B^2} a, \\ +A &= \sqrt{1 + e'^2 \cos^4\phi_0}, \\ +\tan\phi'_0 &= \frac1B \tan\phi_0, +\end{aligned} +\f] +where \f$ e' = e/\sqrt{1-e^2} \f$ is the second eccentricity, \f$ B = +\sqrt{1+e'^2\cos^2\phi_0} \f$, and \f$ K \f$ is defined implicitly by +the equation for \f$\phi'_0\f$. The radius \f$ R \f$ is the (Gaussian) +mean radius of curvature of the ellipsoid at \f$\phi_0\f$ (so near +\f$\phi_0\f$ the ellipsoid can be deformed to fit the sphere snugly). +The third derivative of \f$ m \f$ is given by +\f[ +\left.\frac{d^3m(\phi)}{d\phi^3}\right|_{\phi=\phi_0} = +\frac{-2e'^2\sin2\phi_0}{B^4}. +\f] + +The method for solving the inverse problem between two nearby points \f$ +(\phi_1, \lambda_1) \f$ and \f$ (\phi_2, \lambda_2) \f$ is as follows: +Set \f$\phi_0 = (\phi_1 + \phi_2)/2\f$. Compute \f$ R, A, \phi'_0 \f$, +and hence find \f$ (\phi'_1, \lambda'_1) \f$ and \f$ (\phi'_2, +\lambda'_2) \f$. Finally, solve for the great circle on a sphere of +radius \f$ R \f$; the resulting distance and azimuths are good +approximations for the corresponding quantities for the ellipsoidal +geodesic. + +Consistent with the accuracy of this method, we can compute +\f$\phi'_1\f$ and \f$\phi'_2\f$ using a Taylor expansion about +\f$\phi_0\f$. This also avoids numerical errors that arise from +subtracting nearly equal quantities when using the equation for +\f$\phi'\f$ directly. Write \f$\Delta \phi = \phi - \phi_0\f$ and +\f$\Delta \phi' = \phi' - \phi'_0\f$; then we have +\f[ +\Delta\phi' \approx +\frac{\Delta\phi}B \biggl[1 + +\frac{\Delta\phi}{B^2}\frac{e'^2}2 + \biggl(3\sin\phi_0\cos\phi_0 + + \frac{\Delta\phi}{B^2} + \bigl(B^2 - \sin^2\phi_0(2 - 3 e'^2 \cos^2\phi_0)\bigr)\biggr)\biggr], +\f] +where the error is \f$O(f\Delta\phi^4)\f$. +This is essentially Bowring's method. Significant differences between +this result, "Bowring (improved)", compared to Bowring's paper, "Bowring +(original)", are: + - Bowring elects to use \f$\phi_0 = \phi_1\f$. This simplifies the + calculations somewhat but increases the error by about a factor of + 4. + - Bowring's expression for \f$ \Delta\phi' \f$ is only accurate in the + limit \f$ e' \rightarrow 0 \f$. + . +In fact, arguably, the highest order \f$O(f\Delta\phi^3)\f$ terms should +be dropped altogether. Their inclusion does result in a better estimate +for the distance. However, if your goal is to generate both accurate +distances \e and accurate azimuths, then \f$\Delta\phi\f$ needs to be +restricted sufficiently to allow these terms to be dropped to give the +"Bowring (truncated)" method. + +With highly eccentric ellipsoids, the parametric latitude \f$ \beta \f$ +is a better behaved independent variable to use. In this case, \f$ +\phi_0 \f$ is naturally defined using \f$\beta_0 = (\beta_1 + +\beta_2)/2\f$ and in terms of \f$\Delta\beta = \beta - \beta_0\f$, we +have +\f[ +\Delta\phi' \approx +\frac{\Delta\beta}{B'} \biggl[1 + +\frac{\Delta\beta}{B'^2}\frac{e'^2}2 + \biggl(\sin\beta_0\cos\beta_0 + + \frac{\Delta\beta}{3B'^2} + \bigl( \cos^2\beta_0 - \sin^2\beta_0 B'^2\bigr) +\biggr)\biggr], +\f] +where \f$B' = \sqrt{1+e'^2\sin^2\beta_0} = \sqrt{1+e'^2}/B\f$, and the +error once again is \f$O(f\Delta\phi^4)\f$. This is the "Bowring +(using \f$\beta\f$)" method. + +\subsection auxsphere Bessel's auxiliary sphere + +%GeographicLib's uses the auxiliary sphere method of Legendre, Bessel, +and Helmert. For short geodesics, this is equivalent to picking +\f$ R, A, K \f$ so that +\f[ +m(\phi_0) = 1,\quad +\left.\frac{dm(\phi)}{d\phi}\right|_{\phi=\phi_0} = 0,\quad +\tan\phi'_0 = (1 - f) \tan\phi_0. +\f] +Bowring's requirement that the second derivative of \f$m\f$ vanish has +been replaced by the last relation which states that \f$\phi'_0 = +\beta_0\f$, the parametric latitude corresponding to \f$\phi_0\f$. This +gives +\f[ +\begin{aligned} +R &= B'(1-f)a, \\ +A &= \frac1{B'(1-f)}, \\ +\left.\frac{d^2m(\phi)}{d\phi^2}\right|_{\phi=\phi_0} &= +-e^2B'^2\sin^2\phi_0. +\end{aligned} +\f] + +Similar to Bowring's method, we can compute \f$\phi'_1\f$ and +\f$\phi'_2\f$ using a Taylor expansion about \f$\beta_0\f$. This results +in the simple expression +\f[ +\Delta\phi' \approx \Delta\beta, +\f] +where the error is \f$O(f\Delta\beta^2)\f$. + +\subsection shorterr Estimating the accuracy + +In assessing the accuracy of these methods we use two metrics: + - The absolute error in the distance. + - The consistency of the predicted azimuths. Imagine starting + ellipsoidal geodesics at \f$ (\phi_1, \lambda_1) \f$ and \f$ (\phi_2, + \lambda_2) \f$ with the predicted azimuths. What is the distance + between them when they are extended a distance \f$ a \f$ beyond the + second point? + . +(The second metric is much more stringent.) We may now compare the +methods by asking for a bound to the length of a geodesic which ensures +that the one or other of the errors fall below 1 mm (an "engineering" +definition of accurate) or 1 nm (1 nanometer, about the round-off +limit). + +
+ + + + + + + + + + + + + + + +
Maximum distance that can be used in various methods for +computing short geodesics while keeping the errors within prescribed +bounds
method +
distance metric
azimuth metric
1 mm error1 nm error1 mm error1 nm error
Bowring (original) +
87 km
+
870 m
+
35 km
+
350 m
+
Bowring (improved) +
180 km
+
1.8 km
+
58 km
+
580 m
+
Bowring (truncated) +
52 km
+
520 m
+
52 km
+
520 m
+
Bowring (using \f$\beta\f$) +
380 km
+
24 km
+
60 km
+
600 m
+
Bessel's aux. sphere +
42 km
+
420 m
+
1.7 km
+
1.7 m
+
+
+ +For example, if you're only interested in measuring distances and an +accuracy of 1 mm is sufficient, then Bowring's improved method can be +used for distances up to 180 km. On the other hand, %GeographicLib uses +Bessel's auxiliary sphere and we require both the distance and the +azimuth to be accurate, so the great circle approximation can only be +used for distances less than 1.7 m. The reason that %GeographicLib does +not use Bowring's method is that the information necessary for auxiliary +sphere method is already available as part of the general solution and, +as much as possible, we allow all geodesics to be computed by the +general method. + +
+Back to \ref magnetic. Forward to \ref triaxial. Up to \ref contents. +
+**********************************************************************/ +/** +\page triaxial Geodesics on a triaxial ellipsoid + +
+Back to \ref geodesic. Forward to \ref transversemercator. Up to +\ref contents. +
+ +Jacobi (1839) showed that the problem of geodesics on a triaxial +ellipsoid (with 3 unequal axes) can be reduced to quadrature. Despite +this, the detailed behavior of the geodesics is not very well known. In +this section, I briefly give Jacobi's solution and illustrate the +behavior of the geodesics and outline an algorithm for the solution of +the inverse problem. + +See also + - The wikipedia page, + + Geodesics on a triaxial ellipsoid. + +Go to + - \ref triaxial-coords + - \ref triaxial-jacobi + - \ref triaxial-survey + - \ref triaxial-stab + - \ref triaxial-inverse + +NOTES + -# A triaxial ellipsoid approximates the earth only slightly better + than an ellipsoid of revolution. If you are really considering + measuring distances on the earth using a triaxial ellipsoid, you + should also be worrying about the shape of the geoid, which + essentially makes the geodesic problem a hopeless mess; see, for + example, Waters + (2011). + -# There is nothing new in this section. It is just an exercise in + exploring Jacobi's solution. My interest here is in generating long + geodesics with the correct long-time behavior. Arnold gives a + nice qualitative description of the solution in Mathematical + Methods of Classical Mechanics (2nd edition, Springer, 1989), + pp. 264--266. + -# Possible reasons this problem might, nevertheless, be of interest + are: + - It is the first example of a dynamical system which has a + non-trivial constant of motion. As such, Jacobi's paper generated + a lot of excitement and was followed by many papers elaborating + his solution. In particular, the unstable behavior of one of the + closed geodesics of the ellipsoid, is an early example of a system + with a positive Lyapunov exponent (one of the essential + ingredients for chaotic behavior in dynamical systems). + - Knowledge of ellipsoidal coordinates (used by Jacobi) might be + useful in other areas of geodesy. + - Geodesics which pass through the pole on an ellipsoid of revolution + represent a degenerate class (they are all closed and all pass + through the opposite pole). It is of interest to see how this + degeneracy is broken with a surface with a more general shape. + -# My interest in this problem was piqued by Jean-Marc Baillard. I put + him onto Jacobi's solution without having looked at it in detail + myself; and he quickly implemented the solution for an HP-41 + calculator(!) which is posted + here. + -# I do not give full citations of the papers here. You can find these + in the + + Online Geodesic Bibliography; this includes links to online + versions of the papers. + -# An alternative to exploring geodesics using Jacobi's solution is to + integrate the equations for the geodesics directly. This is the + approach taken by + + Oliver Knill and Michael Teodorescu. However it is difficult to + ensure that the long time behavior is correctly modeled with such an + approach. + -# At this point, I have no plans to add the solution of triaxial + geodesic problem to %GeographicLib. + -# If you only want to learn about geodesics on a biaxial ellipsoid (an + ellipsoid of revolution), then see \ref geodesic or the paper + - C. F. F. Karney, + + Algorithms for geodesics, + J. Geodesy 87(1), 43--55 (Jan. 2013); + DOI: + 10.1007/s00190-012-0578-z; + addenda: + geod-addenda.html. + +\section triaxial-coords Triaxial coordinate systems + +Consider the ellipsoid defined by +\f[ + f = \frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1, +\f] +where, without loss of generality, \f$ a \ge b \ge c \gt 0\f$. A +point on the surface is specified by a latitude and longitude. The \e +geographical latitude and longitude \f$(\phi, \lambda)\f$ are defined by +\f[ + \frac{\nabla f}{\left| \nabla f\right|} = \left( +\begin{array}{c} \cos\phi \cos\lambda \\ \cos\phi \sin\lambda \\ \sin\phi +\end{array}\right). +\f] +The \e parametric latitude and longitude \f$(\phi', \lambda')\f$ are +defined by +\f[ +\begin{aligned} + x &= a \cos\phi' \cos\lambda', \\ + y &= b \cos\phi' \sin\lambda', \\ + z &= c \sin\phi'. +\end{aligned} +\f] +Jacobi employed the \e ellipsoidal latitude and longitude \f$(\beta, +\omega)\f$ defined by +\f[ +\begin{aligned} + x &= a \cos\omega + \frac{\sqrt{a^2 - b^2\sin^2\beta - c^2\cos^2\beta}} + {\sqrt{a^2 - c^2}}, \\ + y &= b \cos\beta \sin\omega, \\ + z &= c \sin\beta + \frac{\sqrt{a^2\sin^2\omega + b^2\cos^2\omega - c^2}} + {\sqrt{a^2 - c^2}}. +\end{aligned} +\f] +Grid lines of constant \f$\beta\f$ and \f$\omega\f$ are given in Fig. 1. + +
+Geodesic grid on a triaxial ellipsoid +Fig. 1 +
\n +Fig. 1: +The ellipsoidal grid. The blue (resp. green) lines are lines of constant +\f$\beta\f$ (resp. \f$\omega\f$); the grid spacing is 10°. Also +shown in red are two of the principal sections of the ellipsoid, defined +by \f$x = 0\f$ and \f$z = 0\f$. The third principal section, \f$y = +0\f$, is covered by the lines \f$\beta = \pm 90^\circ\f$ and \f$\omega = +90^\circ \pm 90^\circ\f$. These lines meet at four umbilical points (two +of which are visible in this figure) where the principal radii of +curvature are equal. The parameters of the ellipsoid are \f$a = +1.01\f$, \f$b = 1\f$, \f$c = 0.8\f$, and it is viewed in an orthographic +projection from a point above \f$\phi = 40^\circ\f$, \f$\lambda = +30^\circ\f$. These parameters were chosen to accentuate the ellipsoidal +effects on geodesics (relative to those on the earth) while still +allowing the connection to an ellipsoid of revolution to be made. + +The grid lines of the ellipsoid coordinates are "lines of curvature" on +the ellipsoid, i.e., they are parallel to the direction of principal +curvature (Monge, 1796). They are also intersections of the ellipsoid +with confocal systems of hyperboloids of one and two sheets (Dupin, +1813). Finally they are geodesic ellipses and hyperbolas defined using +two adjacent umbilical points. For example, the lines of constant +\f$\beta\f$ in Fig. 1 can be generated with the familiar string +construction for ellipses with the ends of the string pinned to the two +umbilical points. + +Inter-conversions between these three latitudes and longitudes and the +cartesian coordinates are simple algebraic exercises. + +\section triaxial-jacobi Jacobi's solution + +Solving the geodesic problem for an ellipsoid of revolution is, from the +mathematical point of view, trivial; because of symmetry, geodesics have +a constant of the motion (analogous to the angular momentum) which was +found by Clairaut (1733). By 1806 (with the work of Legendre, Oriani, +et al.), there was a complete understanding of the qualitative behavior +of geodesics on an ellipsoid of revolution. + +On the other hand, geodesics on a triaxial ellipsoid have no obvious +constant of the motion and thus represented a challenging "unsolved" +problem in the first half of the nineteenth century. Jacobi discovered +that the geodesic equations are separable if they are expressed in +ellipsoidal coordinates. You can get an idea of the importance Jacobi +attached to his discovery from the + +letter he wrote to his friend and neighbor Bessel: +
The day before yesterday, I reduced to quadrature the +problem of geodesic lines on an ellipsoid with three unequal +axes. They are the simplest formulas in the world, Abelian +integrals, which become the well known elliptic integrals if 2 axes are +set equal.\n +Königsberg, 28th Dec. '38. +
+ +On the same day he wrote a similar letter to the editor of Compte Rendus +and his result was published in J. Crelle in (1839) with a French +translation (from German) appearing in J. Liouville in (1841). + +Here is the solution, exactly as given by Jacobi + here +(with minor changes in notation): +\f[ +\begin{aligned} +\delta &= \int \frac +{\sqrt{b^2\sin^2\beta + c^2\cos^2\beta}\,d\beta} +{\sqrt{a^2 - b^2\sin^2\beta - c^2\cos^2\beta} + \sqrt{(b^2-c^2)\cos^2\beta - \gamma}}\\ +&\quad - +\int \frac +{\sqrt{a^2\sin^2\omega + b^2\cos^2\omega}\,d\omega} +{\sqrt{a^2\sin^2\omega + b^2\cos^2\omega - c^2} + \sqrt{(a^2-b^2)\sin^2\omega + \gamma}} +\end{aligned} +\f] +As Jacobi notes "a function of the angle \f$\beta\f$ equals a +function of the angle \f$\omega\f$. These two functions are just +Abelian integrals..." Two constants \f$\delta\f$ and \f$\gamma\f$ +appear in the solution. Typically \f$\delta\f$ is zero if the lower +limits of the integrals are taken to be the starting point of the geodesic +and the direction of the geodesics is determined by \f$\gamma\f$. +However for geodesics that start at an umbilical points, we have \f$\gamma += 0\f$ and \f$\delta\f$ determines the direction at the umbilical point. +Incidentally the constant \f$\gamma\f$ may be expressed as +\f[ +\gamma = (b^2-c^2)\cos^2\beta\sin^2\alpha-(a^2-b^2)\sin^2\omega\cos^2\alpha +\f] +where \f$\alpha\f$ is the angle the geodesic makes with lines of +constant \f$\omega\f$. In the limit \f$a\rightarrow b\f$, this reduces +to \f$\cos\beta\sin\alpha = \text{const.}\f$, the familiar Clairaut +relation. A nice derivation of Jacobi's result is given by Darboux +(1894) +§§583--584 where he gives the solution found by Liouville +(1846) for general quadratic surfaces. In this formulation, the +distance along the geodesic, \f$s\f$, is also found using +\f[ +\begin{aligned} +\frac{ds}{(b^2-c^2)\cos^2\beta + (a^2-b^2)\sin^2\omega} +&= \frac +{\sqrt{b^2\sin^2\beta + c^2\cos^2\beta}\,d\beta} +{\sqrt{a^2 - b^2\sin^2\beta - c^2\cos^2\beta} + \sqrt{(b^2-c^2)\cos^2\beta - \gamma}}\\ +&= \frac +{\sqrt{a^2\sin^2\omega + b^2\cos^2\omega}\,d\omega} +{\sqrt{a^2\sin^2\omega + b^2\cos^2\omega - c^2} + \sqrt{(a^2-b^2)\sin^2\omega + \gamma}} +\end{aligned} +\f] +An alternative expression for the distance is +\f[ +\begin{aligned} +ds +&= \frac +{\sqrt{b^2\sin^2\beta + c^2\cos^2\beta} + \sqrt{(b^2-c^2)\cos^2\beta - \gamma}\,d\beta} +{\sqrt{a^2 - b^2\sin^2\beta - c^2\cos^2\beta}}\\ +&\quad {}+ \frac +{\sqrt{a^2\sin^2\omega + b^2\cos^2\omega} + \sqrt{(a^2-b^2)\sin^2\omega + \gamma}\,d\omega} +{\sqrt{a^2\sin^2\omega + b^2\cos^2\omega - c^2}} +\end{aligned} +\f] + +Jacobi's solution is a convenient way to compute geodesics on an +ellipsoid. Care must be taken with the signs of the square roots (which +are determined by the initial azimuth of the geodesic). Also if +\f$\gamma \gt 0\f$ (resp. \f$\gamma \lt 0\f$), then the \f$\beta\f$ +(resp. \f$\omega\f$) integrand diverges. The integrand can be +transformed into a finite one by a change of variable, e.g., +\f$\sin\beta = \sin\sigma \sqrt{1 - \gamma/(b^2-c^2)}\f$. The resulting +integrals are periodic, so the behavior of an arbitrarily long geodesic +is entirely captured by tabulating the integrals over a single period. + +The situation is more complicated if \f$\gamma = 0\f$ (corresponding to +umbilical geodesics). Both integrands have simple poles at the umbilical +points. However, this behavior may be subtracted from the integrands to +yield (for example) the sum of a term involving +\f$\tanh^{-1}\sin\beta\f$ and a finite integral. Since both integrals +contain similar logarithmic singularities they can be equated (thus +fixing the ratio \f$\cos\beta/\sin\omega\f$ at the umbilical point) and +connection formulas can be found which allow the geodesic to be followed +through the umbilical point. The study of umbilical geodesics was of +special interest to a group of Irish mathematicians in the 1840's and +1850's, including Michael and William Roberts (twins!), Hart, Graves, +and Salmon. + +\section triaxial-survey Survey of triaxial geodesics + +Before delving into the nature of geodesics on a triaxial geodesic, it +is worth reviewing geodesics on an ellipsoid of revolution. There are +two classes of simple closed geodesics (i.e., geodesics which close on +themselves without intersection): the equator and all the meridians. +All other geodesics oscillate between two equal and opposite circles of +latitude; but after completing a full oscillation in latitude these fall +slightly short (for an oblate ellipsoid) of completing a full circuit in +longitude. + +Turning to the triaxial case, we find that there are only 3 simple +closed geodesics, the three principal sections of the ellipsoid given by +\f$x = 0\f$, \f$y = 0\f$, and \f$z = 0\f$. To survey the other +geodesics, it is convenient to consider geodesics which intersect the +middle principal section, \f$y = 0\f$, at right angles. Such geodesics +are shown in Figs. 2--6, where I use the same ellipsoid parameters as in +Fig. 1 and the same viewing direction. In addition, the three principal +ellipses are shown in red in each of these figures. + +If the starting point is \f$\beta_1 \in (-90^\circ, 90^\circ)\f$, +\f$\omega_1 = 0\f$, and \f$\alpha_1 = 90^\circ\f$, then the geodesic +encircles the ellipsoid in a "circumpolar" sense. The geodesic +oscillates north and south of the equator; on each oscillation it +completes slightly less that a full circuit around the ellipsoid +resulting in the geodesic filling the area bounded by the two latitude +lines \f$\beta = \pm \beta_1\f$. Two examples are given in +Figs. 2 and 3. Figure 2 shows practically the same behavior as for an +oblate ellipsoid of revolution (because \f$a \approx b\f$). However, if +the starting point is at a higher latitude (Fig. 3) the distortions +resulting from \f$a \ne b\f$ are evident. + +
+Example of a circumpolar geodesic on a
+triaxial ellipsoid +Fig. 2 +
\n +Fig. 2: +Example of a circumpolar geodesic on a triaxial ellipsoid. The starting +point of this geodesic is \f$\beta_1 = 45.1^\circ\f$, \f$\omega_1 = +0^\circ\f$, and \f$\alpha_1 = 90^\circ\f$. + +
+Another example of a circumpolar geodesic on a
+triaxial ellipsoid +Fig. 3 +
\n +Fig. 3: +Another example of a circumpolar geodesic on a triaxial ellipsoid. The +starting point of this geodesic is \f$\beta_1 = 87.48^\circ\f$, \f$\omega_1 = +0^\circ\f$, and \f$\alpha_1 = 90^\circ\f$. + +If the starting point is \f$\beta_1 = 90^\circ\f$, \f$\omega_1 \in +(0^\circ, 180^\circ)\f$, and \f$\alpha_1 = 0^\circ\f$, then the geodesic +encircles the ellipsoid in a "transpolar" sense. The geodesic +oscillates east and west of the ellipse \f$x = 0\f$; on each oscillation +it completes slightly more that a full circuit around the ellipsoid +resulting in the geodesic filling the area bounded by the two longitude +lines \f$\omega = \omega_1\f$ and \f$\omega = 180^\circ - \omega_1\f$. +If \f$a = b\f$, all meridians are geodesics; the effect of \f$a \ne b\f$ +causes such geodesics to oscillate east and west. Two examples are +given in Figs. 4 and 5. + +
+Example of a transpolar geodesic on a
+triaxial ellipsoid +Fig. 4 +
\n +Fig. 4: +Example of a transpolar geodesic on a triaxial ellipsoid. The +starting point of this geodesic is \f$\beta_1 = 90^\circ\f$, \f$\omega_1 = +39.9^\circ\f$, and \f$\alpha_1 = 0^\circ\f$. + +
+Another example of a transpolar geodesic on a
+triaxial ellipsoid +Fig. 5 +
\n +Fig. 5: +Another example of a transpolar geodesic on a triaxial ellipsoid. The +starting point of this geodesic is \f$\beta_1 = 90^\circ\f$, \f$\omega_1 = +9.966^\circ\f$, and \f$\alpha_1 = 0^\circ\f$. + +If the starting point is \f$\beta_1 = 90^\circ\f$, \f$\omega_1 = +0^\circ\f$ (an umbilical point), and \f$\alpha_1 = 45^\circ\f$ (the +geodesic leaves the ellipse \f$y = 0\f$ at right angles), then the +geodesic repeatedly intersects the opposite umbilical point and returns to +its starting point. However on each circuit the angle at which it +intersects \f$y = 0\f$ becomes closer to \f$0^\circ\f$ or +\f$180^\circ\f$ so that asymptotically the geodesic lies on the ellipse +\f$y = 0\f$. This is shown in Fig. 6. Note that a single geodesic does +not fill an area on the ellipsoid. + +
+Example of an umbilical geodesic on a
+triaxial ellipsoid +Fig. 6 +
\n +Fig. 6: +Example of an umbilical geodesic on a triaxial ellipsoid. The +starting point of this geodesic is \f$\beta_1 = 90^\circ\f$, \f$\omega_1 = +0^\circ\f$, and \f$\alpha_1 = 45^\circ\f$ and the geodesics is followed +forwards and backwards until it lies close to the plane \f$y = 0\f$ in +both directions. + +Umbilical geodesic enjoy several interesting properties. + - Through any point on the ellipsoid, there are two umbilical geodesics. + - The geodesic distance between opposite umbilical points is the same + regardless of the initial direction of the geodesic. + - Whereas the closed geodesics on the ellipses \f$x = 0\f$ and \f$z = + 0\f$ are stable (an geodesic initially close to and nearly parallel to + the ellipse remains close to the ellipse), the closed geodesic on the + ellipse \f$y = 0\f$, which goes through all 4 umbilical points, is \e + unstable. If it is perturbed, it will swing out of the plane \f$y = + 0\f$ and flip around before returning to close to the plane. (This + behavior may repeat depending on the nature of the initial + perturbation.). + +\section triaxial-stab The stability of closed geodesics + +The stability of the three simple closed geodesics can be determined by +examining the properties of Jacobi's solution. In particular the +unstable behavior of umbilical geodesics was shown by Hart (1849). +However an alternative approach is to use the equations that Gauss +(1828) gives for a perturbed geodesic +\f[ +\frac {d^2m}{ds^2} + Km = 0 +\f] +where \f$m\f$ is the distance of perturbed geodesic from a reference +geodesic and \f$K\f$ is the Gaussian curvature of the surface. If the +reference geodesic is closed, then this is a linear homogeneous +differential equation with periodic coefficients. In fact it's a +special case of Hill's equation which can be treated using Floquet +theory, see DLMF, §28.29. +Using the notation of §3 of + Algorithms for +geodesics, the stability is determined by computing the reduced +length \f$m_{12}\f$ and the geodesic scales \f$M_{12}, M_{21}\f$ over +half the perimeter of the ellipse and determining the eigenvalues +\f$\lambda_{1,2}\f$ of +\f[ +{\cal M} = \left(\begin{array}{cc} +M_{12} & m_{12}\\ +-\frac{1 - M_{12}M_{21}}{m_{12}} & M_{21} +\end{array}\right). +\f] +Because \f$\mathrm{det}\,{\cal M} = 1\f$, the eigenvalues are determined +by \f$\mathrm{tr}\,{\cal M}\f$. In particular if +\f$\left|\mathrm{tr}\,{\cal M}\right| < 2\f$, we have +\f$\left|\lambda_{1,2}\right| = 1\f$ and the solution is stable; if +\f$\left|\mathrm{tr}\,{\cal M}\right| > 2\f$, one of +\f$\left|\lambda_{1,2}\right|\f$ is larger than unity and the solution +is (exponentially) unstable. In the transition case, +\f$\left|\mathrm{tr}\,{\cal M}\right| = 2\f$, the solution is stable +provided that the off-diagonal elements of \f${\cal M}\f$ are zero; +otherwise the solution is linearly unstable. + +The exponential instability of the geodesic on the ellipse \f$y = 0\f$ +is confirmed by this analysis and results from the resonance between the +natural frequency of the equation for \f$m\f$ and the driving frequency +when \f$b\f$ lies in \f$(c, a)\f$. If \f$b\f$ is equal to either of the +other axes (and the triaxial ellipsoid degenerates to an ellipsoid of +revolution), then the solution is linearly unstable. (For example, a +geodesic is which is close to a meridian on an oblate ellipsoid, slowly +moves away from that meridian.) + +\section triaxial-inverse The inverse problem + +In order to solve the inverse geodesic problem, it helps to have an +understanding of the properties of all the geodesics emanating from a +single point \f$(\beta_1, \omega_1)\f$. + - If the point is an umbilical point, all the lines meet at the + opposite umbilical point. + - Otherwise, the first envelope of the geodesics is a 4-pointed + astroid. The cusps of the astroid lie on either \f$\beta = - + \beta_1\f$ or \f$\omega = \omega_1 + \pi\f$; see + Sinclair + (2003). + - All geodesics intersect (or, in the case of \f$\alpha_1 = 0\f$ or + \f$\pi\f$, touch) the line \f$\omega = \omega_1 + \pi\f$. + - All geodesics intersect (or, in the case of \f$\alpha_1 = + \pm\pi/2\f$, touch) the line \f$\beta = -\beta_1\f$. + - Two geodesics with azimuths \f$\pm\alpha_1\f$ first intersect on + \f$\omega = \omega_1 + \pi\f$ and their lengths to the point of + intersection are equal. + - Two geodesics with azimuths \f$\alpha_1\f$ and \f$\pi-\alpha_1\f$ + first intersect on \f$\beta = -\beta_1\f$ and their lengths to the + point of intersection are equal. + . +(These assertions follow directly from the equations for the geodesics; +some of them are somewhat surprising given the asymmetries of the +ellipsoid.) Consider now terminating the geodesics from \f$(\beta_1, +\omega_1)\f$ at the point where they first intersect (or touch) the line +\f$\beta = -\beta_1\f$. To focus the discussion, take \f$\beta_1 \le +0\f$. + - The geodesics completely fill the portion of the ellipsoid satisfying + \f$\beta \le -\beta_1\f$. + - None of geodesics intersect any other geodesics. + - Any initial portion of these geodesics is a shortest path. + - Each geodesic intersects the line \f$\beta = \beta_2\f$, where + \f$\beta_1 < \beta_2 < -\beta_1\f$, exactly once. + - For a given \f$\beta_2\f$, this defines a continuous monotonic + mapping of the circle of azimuths \f$\alpha_1\f$ to the circle of + longitudes \f$\omega_2\f$. + - If \f$\beta_2 = \pm \beta_1\f$, then the previous two assertions need + to be modified similarly to the case for an ellipsoid of revolution. + +These properties show that the inverse problem can be solved using +techniques similar to those employed for an ellipsoid of revolution (see +§4 of + Algorithms for +geodesics). + - If the points are opposite umbilical points, an arbitrary + \f$\alpha_1\f$ may be chosen. + - If the points are neighboring umbilical points, the shortest path + lies on the ellipse \f$y = 0\f$. + - If only one point is an umbilicial point, the azimuth at the + non-umbilical point is found using the generalization of Clairaut's + equation (given above) with \f$\gamma = 0\f$. + - If both points lie on the equator \f$\beta = 0\f$, then determine the + reduced length \f$m_{12}\f$ for the geodesic which is the shorter + path along the ellipse \f$z = 0\f$. If \f$m_{12} \ge 0\f$, then this + is the shortest path on the ellipsoid; otherwise proceed to the + general case (next). + - Swap the points, if necessary, so that the first point is the one + closest to a pole. Estimate \f$\alpha_1\f$ (by some means) and solve + the \e hybrid problem, i.e., determine the longitude \f$\omega_2\f$ + corresponding to the first intersection of the geodesic with \f$\beta + = \beta_2\f$. Adjust \f$\alpha_1\f$ so that the value of + \f$\omega_2\f$ matches the given \f$\omega_2\f$ (there is a single + root). If a sufficiently close solution can be found, Newton's + method can be employed since the necessary derivative can be + expressed in terms of the reduced length \f$m_{12}\f$. + +The shortest path found by this method is unique unless: + - The length of the geodesic vanishes \f$s_{12}=0\f$, in which case any + constant can be added to the azimuths. + - The points are opposite umbilical points. In this case, + \f$\alpha_1\f$ can take on any value and \f$\alpha_2\f$ needs to be + adjusted to maintain the value of \f$\tan\alpha_1 / \tan\alpha_2\f$. + - \f$\beta_1 + \beta_2 = 0\f$ and \f$\cos\alpha_1\f$ and + \f$\cos\alpha_2\f$ have opposite signs. In this case, there another + shortest geodesic with azimuths \f$\pi - \alpha_1\f$ and + \f$\pi - \alpha_2\f$. + +
+Back to \ref geodesic. Forward to \ref transversemercator. Up to +\ref contents. +
+**********************************************************************/ +/** +\page transversemercator Transverse Mercator projection + +
+Back to \ref triaxial. Forward to \ref geocentric. Up to \ref contents. +
+ +GeographicLib::TransverseMercator and +GeographicLib::TransverseMercatorExact provide accurate implementations +of the transverse Mercator projection. The + TransverseMercatorProj +utility provides an interface to these classes. + +Go to + - \ref testmerc + - \ref tmseries + - \ref tmfigures + +References + - L. Krüger, + Konforme + Abbildung des Erdellipsoids in der Ebene (Conformal mapping of + the ellipsoidal earth to the plane), Royal Prussian Geodetic Institute, + New Series 52, 172 pp. (1912). + - L. P. Lee, + Conformal Projections Based on Elliptic Functions, + (B. V. Gutsell, Toronto, 1976), 128pp., + ISBN: 0919870163 + (Also appeared as: + Monograph 16, Suppl. No. 1 to Canadian Cartographer, Vol 13). + Part V, pp. 67--101, + Conformal + Projections Based On Jacobian Elliptic Functions. + - C. F. F. Karney, + + Transverse Mercator with an accuracy of a few nanometers, + J. Geodesy 85(8), 475--485 (Aug. 2011); + preprint: + arXiv:1002.1417; + resource page: + tm.html. + . +The algorithm for GeographicLib::TransverseMercator is based on +Krüger (1912); that for GeographicLib::TransverseMercatorExact is +based on Lee (1976). + +See tm-grid.kmz, for an +illustration of the exact transverse Mercator grid in Google Earth. + +\section testmerc Test data for the transverse Mercator projection + +A test set for the transverse Mercator projection is available at + - + TMcoords.dat.gz + . +This is about 17 MB (compressed). This test set consists of a set of +geographic coordinates together with the corresponding transverse +Mercator coordinates. The WGS84 ellipsoid is used, with central +meridian 0°, central scale factor 0.9996 (the UTM value), +false easting = false northing = 0 m. + +Each line of the test set gives 6 space delimited numbers + - latitude (degrees, exact) + - longitude (degrees, exact — see below) + - easting (meters, accurate to 0.1 pm) + - northing (meters, accurate to 0.1 pm) + - meridian convergence (degrees, accurate to 10−18 deg) + - scale (accurate to 10−20) + . +The latitude and longitude are all multiples of 10−12 +deg and should be regarded as exact, except that longitude = +82.63627282416406551 should be interpreted as exactly 90 (1 - \e e) +degrees. These results are computed using Lee's formulas with +Maxima's +bfloats and fpprec set to 80 (so the errors in the data are probably 1/2 +of the values quoted above). The Maxima code, +tm.mac and ellint.mac, +was used to prepare this data set is included in the distribution; you +will need to have Maxima installed to use this code. The comments at +the top of tm.mac illustrate how to run it. + +The contents of the file are as follows: + - 250000 entries randomly distributed in lat in [0°, 90°], lon + in [0°, 90°]; + - 1000 entries randomly distributed on lat in [0°, 90°], lon = + 0°; + - 1000 entries randomly distributed on lat = 0°, lon in [0°, + 90°]; + - 1000 entries randomly distributed on lat in [0°, 90°], lon = + 90°; + - 1000 entries close to lat = 90° with lon in [0°, 90°]; + - 1000 entries close to lat = 0°, lon = 0° with lat ≥ + 0°, lon ≥ 0°; + - 1000 entries close to lat = 0°, lon = 90° with lat ≥ + 0°, lon ≤ 90°; + - 2000 entries close to lat = 0°, lon = 90° (1 − \e e) + with lat ≥ 0°; + - 25000 entries randomly distributed in lat in [−89°, + 0°], lon in [90° (1 − \e e), 90°]; + - 1000 entries randomly distributed on lat in [−89°, 0°], + lon = 90°; + - 1000 entries randomly distributed on lat in [−89°, 0°], + lon = 90° (1 − \e e); + - 1000 entries close to lat = 0°, lon = 90° (lat < 0°, lon + ≤ 90°); + - 1000 entries close to lat = 0°, lon = 90° (1 − \e e) + (lat < 0°, lon ≤ 90° (1 − \e e)); + . +(a total of 287000 entries). The entries for lat < 0° and +lon in [90° (1 − \e e), 90°] use the "extended" +domain for the transverse Mercator projection explained in Sec. 5 of +arXiv:1002.1417. The first +258000 entries have lat ≥ 0° and are suitable for testing +implementations following the standard convention. + +\section tmseries Series approximation for transverse Mercator + +Krüger (1912) gives a 4th-order approximation to the transverse +Mercator projection. This is accurate to about 200 nm (200 +nanometers) within the UTM domain. Here we present the series +extended to 10th order. By default, GeographicLib::TransverseMercator +uses the 6th-order approximation. The preprocessor macro +GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER can be used to select an order +from 4 thru 8. The series expanded to order n30 are +given in tmseries30.html. + +In the formulas below ^ indicates exponentiation (\e n^3 = \e n*\e n*\e +n) and / indicates real division (3/5 = 0.6). The equations need to be +converted to Horner form, but are here left in expanded form so that +they can be easily truncated to lower order in \e n. Some of the +integers here are not representable as 32-bit integers and will need to +be included as double literals. + +\e A in Krüger, p. 12, eq. (5) +\verbatim + A = a/(n + 1) * (1 + 1/4 * n^2 + + 1/64 * n^4 + + 1/256 * n^6 + + 25/16384 * n^8 + + 49/65536 * n^10); +\endverbatim + +γ in Krüger, p. 21, eq. (41) +\verbatim +alpha[1] = 1/2 * n + - 2/3 * n^2 + + 5/16 * n^3 + + 41/180 * n^4 + - 127/288 * n^5 + + 7891/37800 * n^6 + + 72161/387072 * n^7 + - 18975107/50803200 * n^8 + + 60193001/290304000 * n^9 + + 134592031/1026432000 * n^10; +alpha[2] = 13/48 * n^2 + - 3/5 * n^3 + + 557/1440 * n^4 + + 281/630 * n^5 + - 1983433/1935360 * n^6 + + 13769/28800 * n^7 + + 148003883/174182400 * n^8 + - 705286231/465696000 * n^9 + + 1703267974087/3218890752000 * n^10; +alpha[3] = 61/240 * n^3 + - 103/140 * n^4 + + 15061/26880 * n^5 + + 167603/181440 * n^6 + - 67102379/29030400 * n^7 + + 79682431/79833600 * n^8 + + 6304945039/2128896000 * n^9 + - 6601904925257/1307674368000 * n^10; +alpha[4] = 49561/161280 * n^4 + - 179/168 * n^5 + + 6601661/7257600 * n^6 + + 97445/49896 * n^7 + - 40176129013/7664025600 * n^8 + + 138471097/66528000 * n^9 + + 48087451385201/5230697472000 * n^10; +alpha[5] = 34729/80640 * n^5 + - 3418889/1995840 * n^6 + + 14644087/9123840 * n^7 + + 2605413599/622702080 * n^8 + - 31015475399/2583060480 * n^9 + + 5820486440369/1307674368000 * n^10; +alpha[6] = 212378941/319334400 * n^6 + - 30705481/10378368 * n^7 + + 175214326799/58118860800 * n^8 + + 870492877/96096000 * n^9 + - 1328004581729009/47823519744000 * n^10; +alpha[7] = 1522256789/1383782400 * n^7 + - 16759934899/3113510400 * n^8 + + 1315149374443/221405184000 * n^9 + + 71809987837451/3629463552000 * n^10; +alpha[8] = 1424729850961/743921418240 * n^8 + - 256783708069/25204608000 * n^9 + + 2468749292989891/203249958912000 * n^10; +alpha[9] = 21091646195357/6080126976000 * n^9 + - 67196182138355857/3379030566912000 * n^10; +alpha[10]= 77911515623232821/12014330904576000 * n^10; +\endverbatim + +β in Krüger, p. 18, eq. (26*) +\verbatim + beta[1] = 1/2 * n + - 2/3 * n^2 + + 37/96 * n^3 + - 1/360 * n^4 + - 81/512 * n^5 + + 96199/604800 * n^6 + - 5406467/38707200 * n^7 + + 7944359/67737600 * n^8 + - 7378753979/97542144000 * n^9 + + 25123531261/804722688000 * n^10; + beta[2] = 1/48 * n^2 + + 1/15 * n^3 + - 437/1440 * n^4 + + 46/105 * n^5 + - 1118711/3870720 * n^6 + + 51841/1209600 * n^7 + + 24749483/348364800 * n^8 + - 115295683/1397088000 * n^9 + + 5487737251099/51502252032000 * n^10; + beta[3] = 17/480 * n^3 + - 37/840 * n^4 + - 209/4480 * n^5 + + 5569/90720 * n^6 + + 9261899/58060800 * n^7 + - 6457463/17740800 * n^8 + + 2473691167/9289728000 * n^9 + - 852549456029/20922789888000 * n^10; + beta[4] = 4397/161280 * n^4 + - 11/504 * n^5 + - 830251/7257600 * n^6 + + 466511/2494800 * n^7 + + 324154477/7664025600 * n^8 + - 937932223/3891888000 * n^9 + - 89112264211/5230697472000 * n^10; + beta[5] = 4583/161280 * n^5 + - 108847/3991680 * n^6 + - 8005831/63866880 * n^7 + + 22894433/124540416 * n^8 + + 112731569449/557941063680 * n^9 + - 5391039814733/10461394944000 * n^10; + beta[6] = 20648693/638668800 * n^6 + - 16363163/518918400 * n^7 + - 2204645983/12915302400 * n^8 + + 4543317553/18162144000 * n^9 + + 54894890298749/167382319104000 * n^10; + beta[7] = 219941297/5535129600 * n^7 + - 497323811/12454041600 * n^8 + - 79431132943/332107776000 * n^9 + + 4346429528407/12703122432000 * n^10; + beta[8] = 191773887257/3719607091200 * n^8 + - 17822319343/336825216000 * n^9 + - 497155444501631/1422749712384000 * n^10; + beta[9] = 11025641854267/158083301376000 * n^9 + - 492293158444691/6758061133824000 * n^10; + beta[10]= 7028504530429621/72085985427456000 * n^10; +\endverbatim + +The high-order expansions for α and β were produced by the +Maxima program tmseries.mac (included in the +distribution). To run, start Maxima and enter +\verbatim + load("tmseries.mac")$ +\endverbatim +Further instructions are included at the top of the file. + +\section tmfigures Figures from paper on transverse Mercator projection + +This section gives color versions of the figures in + - C. F. F. Karney, + + Transverse Mercator with an accuracy of a few nanometers, + J. Geodesy 85(8), 475--485 (Aug. 2011); + preprint: + arXiv:1002.1417; + resource page: + tm.html. + +\b NOTE: +The numbering of the figures matches that in the paper cited above. The +figures in this section are relatively small in order to allow them to +be displayed quickly. Vector versions of these figures are available in + tm-figs.pdf. This allows you to magnify the +figures to show the details more clearly. + +\image html gauss-schreiber-graticule-a.png "Fig. 1(a)" +Fig. 1(a): +The graticule for the spherical transverse Mercator projection. +The equator lies on \e y = 0. +Compare this with Lee, Fig. 1 (right), which shows the graticule for +half a sphere, but note that in his notation \e x and \e y have switched +meanings. The graticule for the ellipsoid differs from that for a +sphere only in that the latitude lines have shifted slightly. (The +conformal transformation from an ellipsoid to a sphere merely relabels +the lines of latitude.) This projection places the point latitude = +0°, longitude = 90° at infinity. + +\image html gauss-krueger-graticule-a.png "Fig. 1(b)" +Fig. 1(b): +The graticule for the Gauss-Krüger transverse Mercator projection. +The equator lies on \e y = 0 for longitude < 81°; beyond +this, it arcs up to meet \e y = 1. Compare this with Lee, Fig. 45 +(upper), which shows the graticule for the International Ellipsoid. Lee, +Fig. 46, shows the graticule for the entire ellipsoid. This projection +(like the Thompson projection) projects the ellipsoid to a finite area. + +\image html thompson-tm-graticule-a.png "Fig. 1(c)" +Fig. 1(c): +The graticule for the Thompson transverse Mercator projection. The +equator lies on \e y = 0 for longitude < 81°; at longitude = +81°, it turns by 120° and heads for \e y = 1. +Compare this with Lee, Fig. 43, which shows the graticule for the +International Ellipsoid. Lee, Fig. 44, shows the graticule for the +entire ellipsoid. This projection (like the Gauss-Krüger +projection) projects the ellipsoid to a finite area. + +\image html gauss-krueger-error.png "Fig. 2" +Fig. 2: +The truncation error for the series for the Gauss-Krüger transverse +Mercator projection. The blue curves show the truncation error for the +order of the series \e J = 2 (top) thru \e J = 12 (bottom). The red +curves show the combined truncation and round-off errors for + - float and \e J = 4 (top) + - double and \e J = 6 (middle) + - long double and \e J = 8 (bottom) + +\image html gauss-krueger-graticule.png "Fig. 3(a)" +Fig. 3(a): +The graticule for the extended domain. The blue lines show +latitude and longitude at multiples of 10°. The green lines +show 1° intervals for longitude in [80°, 90°] and latitude in +[−5°, 10°]. + +\image html gauss-krueger-convergence-scale.png "Fig. 3(b)" +Fig. 3(b): +The convergence and scale for the Gauss-Krüger +transverse Mercator projection in the extended domain. The blue lines +emanating from the top left corner (the north pole) are lines of +constant convergence. Convergence = 0° is given by the +dog-legged line joining the points (0,1), (0,0), (1.71,0), +(1.71,−∞). +Convergence = 90° is given by the line y = 1. The other +lines show multiples of 10° between 0° and +90°. The other blue, the green and the black lines show +scale = 1 thru 2 at intervals of 0.1, 2 thru 15 at intervals of 1, and +15 thru 35 at intervals of 5. Multiples of 5 are shown in black, +multiples of 1 are shown in blue, and the rest are shown in green. +Scale = 1 is given by the line segment (0,0) to (0,1). The red line +shows the equator between lon = 81° and 90°. The +scale and convergence at the branch point are 1/\e e = 10 and +0°, respectively. + +\image html thompson-tm-graticule.png "Fig. 3(c)" +Fig. 3(c): +The graticule for the Thompson transverse Mercator +projection for the extended domain. The range of the projection is the +rectangular region shown + - 0 ≤ \e u ≤ K(e2), + 0 ≤ \e v ≤ K(1 − e2) + . +The coloring of the lines is the same as Fig. 3(a), except that latitude +lines extended down to −10° and a red line has been added +showing the line \e y = 0 for \e x > 1.71 in the Gauss-Krüger +projection (Fig. 3(a)). The extended Thompson projection figure has +reflection symmetry on all the four sides of Fig. 3(c). + +
+Back to \ref triaxial. Forward to \ref geocentric. Up to \ref contents. +
+**********************************************************************/ +/** +\page geocentric Geocentric coordinates + +
+Back to \ref transversemercator. Forward to \ref old. Up to \ref contents. +
+ +The implementation of GeographicLib::Geocentric::Reverse is adapted from + - H. Vermeille, + + Direct transformation from geocentric coordinates to geodetic + coordinates, J. Geodesy 76, 451--454 (2002). + +This provides a closed-form solution but can't directly be applied close to +the center of the earth. Several changes have been made to remove this +restriction and to improve the numerical accuracy. Now the method is +accurate for all inputs (even if \e h is infinite). The changes are +described in Appendix B of + - C. F. F. Karney, + Geodesics + on an ellipsoid of revolution, + Feb. 2011; preprint + arxiv:1102.1215v1. + +The problems encountered near the center of the ellipsoid are: + - There's a potential division by zero in the definition of \e s. The + equations are easily reformulated to avoid this problem. + - t3 may be negative. This is OK; we just take the + real root. + - The solution for \e t may be complex. However this leads to 3 real roots + for u/\e r. It's then just a matter of picking the one that computes + the geodetic result which minimizes |\e h| and which avoids large + round-off errors. + - Some of the equations result in a large loss of accuracy due to + subtracting nearly equal quantities. E.g., \e k= sqrt(\e u + \e v + + w2) − \e w is inaccurate if \e u + \e v is small; + we can fix this by writing \e k = (\e u + \e v)/(sqrt(\e u + \e v + + w2) + \e w). + +The error is computed as follows. Write a version of +Geocentric::WGS84.Forward which uses long doubles (including using long +doubles for the WGS84 parameters). Generate random (long double) +geodetic coordinates (\e lat0, \e lon0, \e h0) and use the "long double" +WGS84.Forward to obtain the corresponding (long double) geocentric +coordinates (\e x0, \e y0, \e z0). [We restrict \e h0 so that +\e h0 ≥ − \e a (1 − e2) / sqrt(1 − +e2 sin2\e lat0), which ensures that (\e +lat0, \e lon0, \e h0) is the principal geodetic inverse of (\e x0, \e +y0, \e z0).] Because the forward calculation is numerically stable and +because long doubles (on Linux systems using g++) provide 11 bits +additional accuracy (about 3.3 decimal digits), we regard this set of +test data as exact. + +Apply the double version of WGS84.Reverse to (\e x0, \e y0, \e z0) to +compute the approximate geodetic coordinates (\e lat1, \e lon1, \e h1). +Convert (\e lat1 − \e lat0, \e lon1 − \e lon0) to a +distance, \e ds, on the surface of the ellipsoid and define \e err = +hypot(\e ds, \e h1 − \e h0). For |\e h0| < 5000 km, we have \e +err < 7 nm (7 nanometers). + +This methodology is not very useful very far from the globe, because the +absolute errors in the approximate geodetic height become large, or +within 50 km of the center of the earth, because of errors in computing +the approximate geodetic latitude. To illustrate the second issue, the +maximum value of \e err for \e h0 < 0 is about 80 mm. The error is +maximum close to the circle given by geocentric coordinates satisfying +hypot(\e x, \e y) = \e a e2 (= 42.7 km), \e z = 0. +(This is the center of meridional curvature for \e lat = 0.) The +geodetic latitude for these points is \e lat = 0. However, if we move 1 +nm towards the center of the earth, the geodetic latitude becomes 0.04", +a distance of 1.4 m from the equator. If, instead, we move 1 nm up, the +geodetic latitude becomes 7.45", a distance of 229 m from the equator. +In light of this, Reverse does quite well in this vicinity. + +To obtain a practical measure of the error for the general case we define +- errh = |\e h1 − \e h0| / max(1, \e h0 / \e a) +- for \e h0 > 0, errout = \e ds +- for \e h0 < 0, apply the long double version of WGS84.Forward to (\e + lat1, \e lon1, \e h1) to give (\e x1, \e y1, \e z1) and compute + errin = hypot(\e x1 − \e x0, \e y1 − \e + y0, \e z1 − \e z0). +. +We then find errh < 8 nm, errout < 4 nm, +and errin < 7 nm. (1 nm = 1 nanometer.) + +The testing has been confined to the WGS84 ellipsoid. The method will work +for all ellipsoids used in terrestrial geodesy. However, the central region, +which leads to multiple real roots for the cubic equation in Reverse, pokes +outside the ellipsoid (at the poles) for ellipsoids with \e e > 1/sqrt(2). +Reverse has not been analyzed for this case. Similarly ellipsoids which are +very nearly spherical near yield inaccurate results due to underflow; in the +other hand, the case of the sphere, \e f = 0, is treated specially and gives +accurate results. + +Other comparable methods are K. M. Borkowski, + Transformation +of geocentric to geodetic coordinates without approximations, +Astrophys. Space Sci. 139, 1--4 (1987) +( erratum) +and T. Fukushima, + Fast transform from +geocentric to geodetic coordinates, J. Geodesy 73, 603--610 (1999). +However the choice of independent variables in these methods leads +to a loss of accuracy for points near the equatorial plane. + +
+Back to \ref transversemercator. Forward to \ref old. Up to \ref contents. + +
+**********************************************************************/ +/** +\page old Old versions + +
+Back to \ref geocentric. Up to \ref contents. +
+ +List of versions in reverse chronological order together with a brief +list of changes. (Note: Old versions of the library use a year-month +style of numbering. Now, the library uses a major and minor version +number.) Recent versions of %GeographicLib are available at + +http://sourceforge.net/projects/geographiclib/files/distrib/. +Older versions are in + +http://sourceforge.net/projects/geographiclib/files/distrib/archive/. + +The corresponding documentation for these versions is obtained by +clicking on the “Version m.nn” links below. Some of +the links in the documentaion of older versions may be out of date (in +particular the links for the source code will not work if the code has +been migrated to the archive subdirectory). All the releases are +available as tags “rm.nn” in the the "release" branch +of the git repository for %GeographicLib. + + - Version 1.34 + (released 2013-12-11) + - Many changes in cmake support: + - minimum version of cmake needed increased to 2.8.4 (which was + released in 2011-02); + - allow building both shared and static librarys with -D + GEOGRAPHICLIB_LIB_TYPE=BOTH; + - both shared and static libraries (Release plus Debug) included in + binary installer; + - find_package uses COMPONENTS and GeographicLib_USE_STATIC_LIBS to + select the library to use; + - find_package version checking allows nmake and Visual Studio + generators to interoperate on Windows; + - find_package (%GeographicLib ...) requires that %GeographicLib be + capitalized correctly; + - on Unix/Linux, don't include the version number in directory for + the cmake configuration files; + - defaults for GEOGRAPHICLIB_DOCUMENTATION and + BUILD_NETGEOGRAPHICLIB are now OFF; + - the GEOGRAPHICLIB_EXAMPLES configuration parameter is no longer + used; cmake always configures to build the examples, but they are + not built by default (instead build targets: exampleprograms and + netexamples); + - matlab-all target renamed to matlabinterface; + - the configuration parameters PACKAGE_PATH and INSTALL_PATH are + now deprecated (use CMAKE_INSTALL_PREFIX instead); + - on Linux, the installed package is relocatable; + - on MacOSX, the installed utilities can find the shared library. + - Use a more precise value for GeographicLib::OSGB::CentralScale(). + - Add Arc routines to python interface. + - The Geod utility has been removed; the same functionality lives on + with GeodSolve (introduced in + version 1.30). + + - Version 1.33 + (released 2013-10-08) + - Add NETGeographic .NET wrapper library + (courtesy of Scott Heiman). + - Make inspector functions in GeographicLib::Ellipsoid const. + - Add Accumulator.cpp to instantiate GeographicLib::Accumulator. + - Defer some of the initialization of GeographicLib::OSGB to when it + is first called. + - Fix bug in autoconf builds under MacOS. + + - Version 1.32 + (released 2013-07-12) + - Generalize C interface for polygon areas to allow vertices to be + specified incrementally. + - Fix way flags for C++11 support are determined. + + - Version 1.31 + (released 2013-07-01) + - Changes breaking binary compatibility (source compatibility is + maintained): + - overloaded versions of GeographicLib::DMS::Encode, + GeographicLib::EllipticFunction::EllipticFunction, and + GeographicLib::GeoCoords::DMSRepresentation, have been eliminated + by the use of optional arguments; + - correct the declaration of first arg to + GeographicLib::UTMUPS::DecodeEPSG. + - FIX BUG in GeographicLib::GravityCircle constructor (found by + Mathieu Peyréga) which caused bogus results for the gravity + disturbance and gravity anomaly vectors. (This only affected + calculations using GravityCircle. GravityModel calculations did + not suffer from this bug.) + - Improvements to the build: + - add macros GEOGRAPHICLIB_VERSION_{MAJOR,MINOR,PATCH} to Config.h; + - fix documentation for new version of perlpod; + - improving setting of runtime path for Unix-like systems with cmake; + - install PDB files when compiling with Visual Studio to aid + debugging; + - Windows binary release now uses Matlab R2013a (64-bit) and + uses the -largeArrayDims option. + - fixes to the way the Matlab interface routines are built (thanks + to Phil Miller and Chris F.). + - Changes to the geodesic routines: + - add \ref java of the geodesic routines (thanks to Skip Breidbach + for the maven support); + - FIX BUG: avoid altering input args in Fortran implementation; + - more systematic treatment of very short geodesic; + - fixes to python port so that they work with version 3.x, in + addition to 2.x (courtesy of Amato); + - accumulate the perimeter and area of polygons via a double-wide + accumulator in Fortran, C, and Matlab implementations (this is + already included in the other implementations); + - port GeographicLib::PolygonArea::AddEdge and + GeographicLib::PolygonArea::TestEdge to JavaScript and python + interfaces; + - include documentation on \ref geodshort. + - Unix scripts for downloading datasets, + geographiclib-get-{geoids,gravity,magnetic}, skip already download + models by default, unless the -f flag is given. + - FIX BUGS: meridian convergence and scale returned by + GeographicLib::TransverseMercatorExact was wrong at a pole. + - Improve efficiency of GeographicLib::MGRS::Forward by avoiding the + calculation of the latitude if possible (adapting an idea of Craig + Rollins). + - Fixes to the way the Matlab interface routines are built (thanks to + Phil Miller and Chris F.). + + - Version 1.30 + (released 2013-02-27) + - Changes to geodesic routines: + - FIX BUG in fail-safe mechanisms in GeographicLib::Geodesic::Inverse; + - the command line utility Geod is now called + GeodSolve; + - allow addition of polygon edges in GeographicLib::PolygonArea; + - add full Maxima implementation of geodesic algorithms. + + - Version 1.29 + (released 2013-01-16) + - Changes to allow compilation with libc++ (courtesy of Kal Conley). + - Add description of \ref triaxial to documentation. + - Update journal reference for "Algorithms for geodesics". + + - Version 1.28 + (released 2012-12-11) + - Changes to geodesic routines: + - compute longitude difference exactly; + - hence FIX BUG in area calculations for polygons with vertices very + close to the prime meridian; + - FIX BUG is geoddistance.m where the value of m12 was wrong for + meridional geodesics; + - add Matlab implementations of the geodesic projections; + - remove unneeded special code for geodesics which start at a pole; + - include polygon area routine in C and Fortran implementations; + - add doxygen documentation for C and Fortran libraries. + + - Version 1.27 + (released 2012-11-29) + - Changes to geodesic routines: + - add native Matlab implementations: geoddistance.m, geodreckon.m, + geodarea.m; + - add C and Fortran implementations; + - improve the solution of the direct problem so that the series + solution is accurate to round off for |f| < 1/50; + - tighten up the convergence criteria for solution of the inverse + problem; + - no longer signal failures of convergence with NaNs (a slightly + less accurate answer is returned instead). + - Fix GeographicLib::DMS::Decode double rounding BUG. + - On MacOSX platforms with the cmake configuration, universal + binaries are built. + + - Version 1.26 + (released 2012-10-22) + - Replace the series used for geodesic areas by one with better + convergence (this only makes an appreciable difference if + |f| > 1/150). + + - Version 1.25 + (released 2012-10-16) + - Changes to geodesic calculations: + - restart Newton's method in Geodesic::Inverse when it goes awry; + - back up Newton's method with the bisection method; + - GeographicLib::Geodesic::Inverse now converges for any value of \e f; + - add GeographicLib::GeodesicExact and + GeographicLib::GeodesicLineExact which are formulated in terms + of elliptic integrals and thus yield accurate results even for + very eccentric ellipsoids. + - the -E option to Geod invokes these + exact classes. + - Add functionality to GeographicLib::EllipticFunction: + - add all the traditional elliptic integrals; + - remove restrictions on argument range for incomplete elliptic integrals; + - allow imaginary modulus for elliptic integrals and elliptic functions; + - make interface to the symmetric elliptic integrals public. + - Allow GeographicLib::Ellipsoid to be copied. + - Changes to the build tools: + - cmake uses folders in Visual Studio to reduce clutter; + - allow precision of reals to be set in cmake; + - fail gracefully in the absence of pod documentation tools; + - remove support for maintainer tasks in Makefile.mk. + + - Version 1.24 + (released 2012-09-22) + - Allow the specification of the hemisphere in UTM coordinates in + order to provide continuity across the equator: + - add GeographicLib::UTMUPS::Transfer; + - add GeographicLib::GeoCoords::UTMUPSRepresentation(bool, int) and + GeographicLib::GeoCoords::AltUTMUPSRepresentation(bool, int); + - use the hemisphere letter in, e.g., + GeoConvert -u -z 31N. + - Add GeographicLib::UTMUPS::DecodeEPSG and + GeographicLib::UTMUPS::EncodeEPSG. + - cmake changes: + - restore support for cmake 2.4.x; + - explicitly check version of doxygen. + - Fix building under cygwin. + - Document restrictions on \e f in \ref intro. + - Fix python interface to work with version 2.6.x. + + - Version 1.23 + (released 2012-07-17) + - Documentation changes: + - remove html documentation from distribution and use web links if + doxygen is not available; + - use doxygen tags to document exceptions; + - begin migrating the documentation to using Greek letters where + appropriate (requires doxygen 1.8.1.2 or later). + - Add GeographicLib::Math::AngNormalize and + GeographicLib::Math::AngNormalize2; the allowed range for longitudes + and azimuths widened to [−540°, 540°). + - GeographicLib::DMS::Decode understands more unicode symbols. + - GeographicLib::Geohash uses geohash code "nan" to stand for not a + number. + - Add GeographicLib::Ellipsoid::NormalCurvatureRadius. + - Various fixes in GeographicLib::LambertConformalConic, + GeographicLib::TransverseMercator, + GeographicLib::PolarStereographic, and GeographicLib::Ellipsoid to + handle reverse projections of points near infinity. + - Fix programming blunder in GeographicLib::LambertConformalConic::Forward + (incorrect results were returned if the tangent latitude was + negative). + + - Version 1.22 + (released 2012-05-27) + - Add GeographicLib::Geohash and GeographicLib::Ellipsoid classes. + - FIX BUG in GeographicLib::AlbersEqualArea for very prolate + ellipsoids (b2 > 2 a2). + - cmake changes: + - optionally use PACKAGE_PATH and INSTALL_PATH to determine + CMAKE_INSTALL_PREFIX; + - use COMMON_INSTALL_PATH to determine layout of installation + directories; + - as a consequence, the installation paths for the documentation, + and python and matlab interfaces are shortened for Windows; + - zip source distribution now uses DOS line endings; + - the tests work in debug mode for Windows; + - default setting of GEOGRAPHICLIB_DATA does not depend on + CMAKE_INSTALL_PREFIX; + - add a cmake configuration for build tree. + + - Version 1.21 + (released 2012-04-25) + - Support colon-separated DMS output: + - GeographicLib::DMS::Encode and + GeographicLib::GeoCoords::DMSRepresentation generalized; + - GeoConvert and + Geod now accept a -: option. + - GeoidEval does not print the gradient + of the geoid height by default (because it's subject to large + errors); give the -g option to get the gradient printed. + - Work around optimization BUG in GeographicLib::Geodesic::Inverse + with tdm mingw g++ version 4.6.1. + - autoconf fixed to ensure that that out-of-sources builds work; + document this as the preferred method of using autoconf. + - cmake tweaks: + - simplify the configuration of doxygen; + - allow the Matlab compiler to be specified with the + MATLAB_COMPILER option. + + - Version 1.20 + (released 2012-03-23) + - cmake tweaks: + - improve find_package's matching of compiler versions; + - CMAKE_INSTALL_PREFIX set from CMAKE_PREFIX_PATH if available; + - add "x64" to the package name for the 64-bit binary installer; + - fix cmake warning with Visual Studio Express. + - Fix GeographicLib::SphericalEngine to deal with aggessive iterator + checking by Visual Studio. + - Fix transcription BUG is Geodesic.js. + + - Version 1.19 + (released 2012-03-13) + - Slight improvement in GeographicLib::Geodesic::Inverse for very + short lines. + - Fix argument checking tests in GeographicLib::MGRS::Forward. + - Add --comment-delimiter and --line-separator options to the \ref + utilities. + - Add installer for 64-bit Windows; the compiled Matlab interface is + supplied with the Windows 64-bit installer only. + + - Version 1.18 + (released 2012-02-18) + - Improve documentation on configuration with cmake. + - cmake's find_package ensures that the compiler versions match on Windows. + - Improve documentation on compiling Matlab interface. + - Binary installer for Windows installs under C:/pkg-vc10 by default. + + - Version 1.17 + (released 2012-01-21) + - Work around optimization BUG in GeographicLib::Geodesic::Inverse + with g++ version 4.4.0 (mingw). + - Fix BUG in argument checking with GeographicLib::OSGB::GridReference. + - Fix missing include file in GeographicLib::SphericalHarmonic2. + - Add simple examples of usage for each class. + - Add internal documentation to the cmake configuration files. + + - Version 1.16 + (released 2011-12-07) + - Add calculation of the earth's gravitational field: + - add GeographicLib::NormalGravity GeographicLib::GravityModel and + GeographicLib::GravityCircle classes; + - add command line utility + Gravity; + - add \ref gravity; + - add GeographicLib::Constants::WGS84_GM(), + GeographicLib::Constants::WGS84_omega(), and similarly for GRS80. + - Build uses GEOGRAPHICLIB_DATA to specify a common parent directory + for geoid, gravity, and magnetic data (instead of + GEOGRAPHICLIB_GEOID_PATH, etc.); similarly, + GeoidEval, + Gravity, and + MagneticField, look at the + environment variable GEOGRAPHICLIB_DATA to locate the data. + - Spherical harmonic software changes: + - capitalize enums GeographicLib::SphericalHarmonic::FULL and + GeographicLib::SphericalHarmonic::SCHMIDT (the lower case names + are retained but deprecated); + - optimize the sum by using a static table of square roots which is + updated by GeographicLib::SphericalEngine::RootTable; + - avoid overflow for high degree models. + - Magnetic software fixes: + - fix documentation BUG in GeographicLib::MagneticModel::Circle; + - make GeographicLib::MagneticModel constructor explicit; + - provide default GeographicLib::MagneticCircle constructor; + - add additional inspector functions to + GeographicLib::MagneticCircle; + - add -c option to MagneticField; + - default height to zero in + MagneticField. + + - Version 1.15 + (released 2011-11-08) + - Add calculation of the earth's magnetic field: + - add GeographicLib::MagneticModel and GeographicLib::MagneticCircle + classes; + - add command line utility + MagneticField; + - add \ref magnetic; + - add \ref magneticinst; + - add \ref magneticformat; + - add classes GeographicLib::SphericalEngine, + GeographicLib::CircularEngine, GeographicLib::SphericalHarmonic, + GeographicLib::SphericalHarmonic1, and + GeographicLib::SphericalHarmonic2. which sum spherical harmonic + series. + - Add GeographicLib::Utility class to support I/O and date + manipulation. + - Cmake configuration includes a _d suffix on the library built in + debug mode. + - For the Python package, include manifest and readme files; don't + install setup.py for non-Windows systems. + - Include Doxygen tag file in distribution as doc/html/Geographic.tag. + + - Version 1.14 + (released 2011-09-30) + - Ensure that geographiclib-config.cmake is relocatable. + - Allow more unicode symbols to be used in GeographicLib::DMS::Decode. + - Modify GeoidEval so that it can be + used to convert the height datum for LIDAR data. + - Modest speed-up of Geodesic::Inverse. + - Changes in python interface: + - FIX BUG in transcription of Geodesic::Inverse; + - include setup.py for easy installation; + - python only distribution is available at + http://pypi.python.org/pypi/geographiclib + - Supply a minimal Qt qmake project file for library + src/Geographic.pro. + + - Version 1.13 + (released 2011-08-13) + - Changes to I/O: + - allow : (colon) to be used as a DMS separator in + GeographicLib::DMS::Decode(const std::string&, flag&); + - also accept Unicode symbols for degrees, minutes, and seconds + (coded as UTF-8); + - provide optional \e swaplatlong argument to various + GeographicLib::DMS and GeographicLib::GeoCoords functions to make + longitude precede latitude; + - GeoConvert now has a -w option to + make longitude precede latitude on input and output; + - include a JavaScript version of GeographicLib::DMS. + - Slight improvement in starting guess for solution of geographic + latitude in terms of conformal latitude in TransverseMercator, + TransverseMercatorExact, and LambertConformalConic. + - For most classes, get rid of const member variables so that the + default copy assignment works. + - Put GeographicLib::Math and GeographicLib::Accumulator in their own + header files. + - Remove unused "fast" GeographicLib::Accumulator method. + - Reorganize the \ref python. + - Withdraw some deprecated routines. + - cmake changes: + - include FindGeographic.cmake in distribution; + - building with cmake creates and installs + geographiclib-config.cmake; + - better support for building a shared library under Windows. + + - Version 1.12 + (released 2011-07-21) + - Change license to MIT/X11. + - Add GeographicLib::PolygonArea class and equivalent Matlab function. + - Provide JavaScript and Python implementations of geodesic routines. + - Fix Windows installer to include runtime dlls for Matlab. + - Fix (innocuous) unassigned variable in Geodesic::GenInverse. + - Geodesic routines in Matlab return a12 as first column of aux return + value (incompatible change). + - A couple of code changes to enable compilation with Visual + Studio 2003. + + - Version 1.11 + (released 2011-06-27) + - Changes to Planimeter: + - add -l flag to Planimeter for polyline + calculations; + - trim precision of area to 3 decimal places; + - FIX BUG with pole crossing edges (due to compiler optimization). + - Geod no longer reports the reduced + length by default; however the -f flag still reports this and in + addition gives the geodesic scales and the geodesic area. + - FIX BUGS (compiler-specific) in inverse geodesic calculations. + - FIX BUG: accommodate tellg() returning −1 at end of string. + - Change way flattening of the ellipsoid is specified: + - constructors take \e f argument which is taken to be the + flattening if \e f < 1 and the inverse flattening otherwise + (this is a compatible change for spheres and oblate ellipsoids, but it + is an INCOMPATIBLE change for prolate ellipsoids); + - the -e arguments to the \ref utilities are handled similarly; in + addition, simple fractions, e.g., 1/297, can be used for the + flattening; + - introduce GeographicLib::Constants::WGS84_f() for the WGS84 + flattening (and deprecate Constants::WGS84_r() for the inverse + flattening); + - most classes have a Flattening() member function; + - InverseFlattening() has been deprecated (and now returns inf for a + sphere, instead of 0). + + - Version 1.10 + (released 2011-06-11) + - Improvements to Matlab/Octave interface: + - add {geocentric,localcartesian}{forward,reverse}; + - make geographiclibinterface more general; + - install the source for the interface; + - cmake compiles the interface if ENABLE_MATLAB=ON; + - include compiled interface with Windows binary installer. + - Fix various configuration issues + - autoconf did not install Config.h; + - cmake installed in man/man1 instead of share/man/man1; + - cmake did not set the rpath on the tools. + + - Version 1.9 + (released 2011-05-28) + - FIX BUG in area returned by + Planimeter for pole encircling polygons. + - FIX BUG in error message reported when DMS::Decode reads the string + "5d.". + - FIX BUG in AlbersEqualArea::Reverse (lon0 not being used). + - Ensure that all exceptions thrown in the \ref utilities are caught. + - Avoid using catch within GeographicLib::DMS. + - Move GeographicLib::Accumulator class from Planimeter.cpp to + Constants.hpp. + - Add GeographicLib::Math::sq. + - Simplify \ref geoidinst + - add geographiclib-get-geoids for Unix-like systems; + - add installers for Windows. + - Provide cmake support: + - build binary installer for Windows; + - include regression tests; + - add --input-string, --input-file, --output-file options to the + \ref utilities to support tests. + - Rename utility EquidistantTest as + GeodesicProj and TransverseMercatorTest as + TransverseMercatorProj. + - Add ConicProj. + - Reverse the initial sense of the -s option for + Planimeter. + - Migrate source from subversion to + + git. + + - Version 1.8 + (released 2011-02-22) + - Optionally return rotation matrix from GeographicLib::Geocentric and + GeographicLib::LocalCartesian. + - For the \ref utilities, supply man pages, -h prints the synopsis, + --help prints the man page, --version prints the version. + - Use accurate summation in Planimeter. + - Add 64-bit targets for Visual Studio 2010. + - Use templates for defining math functions and some constants. + - GeographicLib::Geoid updates + - Add GeographicLib::Geoid::DefaultGeoidPath and + GeographicLib::Geoid::DefaultGeoidName; + - GeoidEval uses environment variable + GEOID_NAME as the default geoid; + - Add --msltohae and --haetomsl as + GeoidEval options (and don't + document the single hyphen versions). + - Remove documentation that duplicates papers on transverse Mercator + and geodesics. + + - Version 1.7 + (released 2010-12-21) + - FIX BUG in scale returned by GeographicLib::LambertConformalConic::Reverse. + - Add GeographicLib::AlbersEqualArea projection. + - Library created by Visual Studio is Geographic.lib instead of + GeographicLib.lib (compatible with makefiles). + - Make classes NaN aware. + - Use cell arrays for MGRS strings in Matlab. + - Add solution/project files for Visual Studio 2010 (32-bit only). + - Use C++11 static_assert and math functions, if available. + + - Version 1.6 + (released 2010-11-23) + - FIX BUG introduced in GeographicLib::Geoid in version 1.5 (found by + Dave Edwards). + + - Version 1.5 + (released 2010-11-19) + - Improve area calculations for small polygons. + - Add -s and -r flags to Planimeter. + - Improve the accuracy of GeographicLib::LambertConformalConic using + divided differences. + - FIX BUG in meridian convergence returned by + LambertConformalConic::Forward. + - Add optional threadsafe parameter to GeographicLib::Geoid + constructor. WARNING: This changes may break binary compatibility + with previous versions of %GeographicLib. However, the library is + source compatible. + - Add GeographicLib::OSGB. + - Matlab and Octave interfaces to GeographicLib::UTMUPS, + GeographicLib::MGRS, GeographicLib::Geoid, GeographicLib::Geodesic + provided. + - Minor changes + - explicitly turn on optimization in Visual Studio 2008 projects; + - add missing dependencies in some Makefiles; + - move pi() and degree() from GeographicLib::Constants to + GeographicLib::Math; + - introduce GeographicLib::Math::extended type to aid testing; + - add GeographicLib::Math::epi() and GeographicLib::Math::edegree(). + - fixes to compile under cygwin; + - tweak expression used to find latitude from conformal latitude. + + - Version 1.4 + (released 2010-09-12) + - Changes to GeographicLib::Geodesic and GeographicLib::GeodesicLine: + - FIX BUG in Geodesic::Inverse with prolate ellipsoids; + - add area computations to Geodesic::Direct and Geodesic::Inverse; + - add geodesic areas to geodesic test set; + - make GeodesicLine constructor public; + - change longitude series in Geodesic into Helmert-like form; + - ensure that equatorial geodesics have cos(alpha0) = 0 identically; + - generalize interface for Geodesic and GeodesicLine; + - split GeodesicLine and Geodesic into different files; + - signal convergence failure in Geodesic::Inverse with NaNs; + - deprecate one function in Geodesic and two functions in + GeodesicLine; + - deprecate -n option for Geod. + . + WARNING: These changes may break binary compatibility with previous + versions of %GeographicLib. However, the library is source + compatible (with the proviso that GeographicLib/GeodesicLine.hpp may + now need to be included). + - Add the Planimeter utility for + computing the areas of geodesic polygons. + - Improve iterative solution of GeographicLib::Gnomonic::Reverse. + - Add GeographicLib::Geoid::ConvertHeight. + - Add -msltohae, -haetomsl, and -z options to + GeoidEval. + - Constructors check that minor radius is positive. + - Add overloaded Forward and Reverse functions to the projection + classes which don't return the convergence (or azimuth) and scale. + - Document function parameters and return values consistently. + + - Version 1.3 + (released 2010-07-21) + - Add GeographicLib::Gnomonic, the ellipsoid generalization of the + gnomonic projection. + - Add -g and -e options to + EquidistantTest. + - Use fixed-point notation for output from + CartConvert, + EquidistantTest, + TransverseMercatorTest. + - PolarStereographic: + - Improved conversion to conformal coordinates; + - Fix bug with scale at opposite pole; + - Complain if latitude out of range in SetScale. + - Add GeographicLib::Math::NaN(). + - Add long double version of hypot for Windows. + - Add EllipticFunction::E(real). + - Update references to Geotrans in MGRS documentation. + - Speed up tmseries.mac. + + - Version 1.2 + (released 2010-05-21) + - FIX BUGS in GeographicLib::Geodesic, + - wrong azimuth returned by Direct if point 2 is on a pole; + - Inverse sometimes fails with very close points. + - Improve calculation of scale in GeographicLib::CassiniSoldner, + - add GeographicLib::GeodesicLine::Scale, + GeographicLib::GeodesicLine::EquatorialAzimuth, and + GeographicLib::GeodesicLine::EquatorialArc; + - break friend connection between CassiniSoldner and Geodesic. + - Add GeographicLib::DMS::DecodeAngle and + GeographicLib::DMS::DecodeAzimuth. Extend + GeographicLib::DMS::Decode and GeographicLib::DMS::Encode to deal + with distances. + - Code and documentation changes in GeographicLib::Geodesic and + GeographicLib::Geocentric for consistency with + the forthcoming paper on geodesics. + - Increase order of series using in GeographicLib::Geodesic to 6 (full + accuracy maintained for ellipsoid flattening < 0.01). + - Macro __NO_LONG_DOUBLE_MATH to disable use of long double. + - Correct declaration of GeographicLib::Math::isfinite to return a bool. + - Changes in the \ref utilities, + - improve error reporting when parsing command line arguments; + - accept latitudes and longitudes in decimal degrees or degrees, + minutes, and seconds, with optional hemisphere designators; + - GeoConvert -z accepts zone or + zone+hemisphere; + - GeoidEval accepts any of the input + formats used by GeoConvert; + - CartConvert allows the ellipsoid + to be specified with -e. + + - Version 1.1 + (released 2010-02-09) + - FIX BUG (introduced in 2009-03) in EllipticFunction::E(sn,cn,dn). + - Increase accuracy of scale calculation in TransverseMercator and + TransverseMercatorExact. + - Code and documentation changes for consistency with + arXiv:1002.1417 + + - Version 1.0 + (released 2010-01-07) + - Add autoconf configuration files. + - BUG FIX: Improve initial guess for Newton's method in + PolarStereographic::Reverse. (Previously this failed to converge + when the co-latitude exceeded about 130 deg.) + - Constructors for TransverseMercator, TransverseMercatorExact, + PolarStereographic, Geocentric, and Geodesic now check for obvious + problems with their arguments and throw an exception if necessary. + - Most classes now include inspector functions such as MajorRadius() + so that you can determine how instances were constructed. + - Add GeographicLib::LambertConformalConic class. + - Add GeographicLib::PolarStereographic::SetScale to allow the + latitude of true scale to be specified. + - Add solution and project files for Visual Studio 2008. + - Add GeographicLib::GeographicErr for exceptions. + - GeographicLib::Geoid changes: + - BUG FIX: fix typo in GeographicLib::Geoid::Cache which could cause + a segmentation fault in some cases when the cached area spanned + the prime meridian. + - Include sufficient edge data to allow heights to be returned for + cached area without disk reads; + - Add inspector functions to query the extent of the cache. + + - Version 2009-11 + (released 2009-11-03) + - Allow specification of "closest UTM zone" in GeographicLib::UTMUPS + and GeoConvert (via -t option). + - Utilities now complain is there are too many tokens on input lines. + - Include real-to-real versions of GeographicLib::DMS::Decode and + GeographicLib::DMS::Encode. + - More house-cleaning changes: + - Ensure that functions which return results through reference + arguments do not alter the arguments when an exception is thrown. + - Improve accuracy of GeographicLib::MGRS::Forward. + - Include more information in some error messages. + - Improve accuracy of inverse hyperbolic functions. + - Fix the way GeographicLib::Math functions handle different precisions. + + - Version 2009-10 + (released 2009-10-18) + - Change web site to http://geographiclib.sourceforge.net + - Several house-cleaning changes: + - Change from the a flat directory structure to a more easily + maintained one. + - Introduce Math class for common mathematical functions (in + Constants.hpp). + - Use Math::real as the type for all real quantities. By default this + is typedef'ed to double; and the library should be installed this + way. + - Eliminate const reference members of AzimuthalEquidistant, + CassiniSoldner and LocalCartesian so that they may be copied. + - Make several constructors explicit. Disallow some constructors. + Disallow copy constructor/assignment for Geoid. + - Document least squares formulas in Geoid.cpp. + - Use unsigned long long for files positions of geoid files in Geoid. + - Introduce optional mgrslimits argument in UTMUPS::Forward and + UTMUPS::Reverse to enforce stricter MGRS limits on eastings and + northings. + - Add 64-bit targets in Visual Studio project files. + + - Version 2009-09 + (released 2009-09-01) + - Add GeographicLib::Geoid and + GeoidEval utility. + + - Version 2009-08 + (released 2009-08-14) + - Add GeographicLib::CassiniSoldner class and + EquidistantTest utility. + - Fix bug in GeographicLib::Geodesic::Inverse where NaNs were + sometimes returned. + - INCOMPATIBLE CHANGE: AzimuthalEquidistant now returns the reciprocal + of the azimuthal scale instead of the reduced length. + - Add -n option to GeoConvert. + + - Version 2009-07 + (released 2009-07-16) + - Speed up the series inversion code in tmseries.mac and geod.mac. + - Reference Borkowski in section on \ref geocentric. + + - Version 2009-06 + (released 2009-06-01) + - Add routines to decode and encode zone+hemisphere to GeographicLib::UTMUPS. + - Clean up code in GeographicLib::Geodesic. + + - Version 2009-05 + (released 2009-05-01) + - Improvements to GeographicLib::Geodesic: + - more economical series expansions, + - return reduced length (as does the + Geod utility), + - improved calculation of starting point for inverse method, + - use reduced length to give derivative for Newton's method. + - Add GeographicLib::AzimuthalEquidistant class. + - Make GeographicLib::Geocentric, GeographicLib::TransverseMercator, + and GeographicLib::PolarStereographic classes work with prolate + ellipsoids. + - CartConvert checks its inputs more + carefully. + - Remove reference to defunct Constants.cpp from GeographicLib.vcproj. + + - Version 2009-04 + (released 2009-04-01) + - Use compile-time constants to select the order of series in + GeographicLib::TransverseMercator. + - 2x unroll of Clenshaw summation to avoid data shuffling. + - Simplification of GeographicLib::EllipticFunction::E. + - Use STATIC_ASSERT for compile-time checking of constants. + - Improvements to GeographicLib::Geodesic: + - compile-time option to change order of series used, + - post Maxima code for generating the series, + - tune the order of series for double, + - improvements in the selection of starting points for Newton's + method, + - accept and return spherical arc lengths, + - works with both oblate and prolate ellipsoids, + - add -a, -e, -b options to the Geod + utility. + + - Version 2009-03 + (released 2009-03-01) + - Add GeographicLib::Geodesic and the + Geod utility. + - Declare when no exceptions are thrown by functions. + - Minor changes to GeographicLib::DMS class. + - Use invf = 0 to mean a sphere in constructors to some classes. + - The makefile creates a library and includes an install target. + - Rename GeographicLib::ECEF to GeographicLib::Geocentric, ECEFConvert + to CartConvert. + - Use inline functions to define constant doubles in Constants.hpp. + + - Version 2009-02 + (released 2009-01-30) + - Fix documentation of constructors (flattening -> inverse + flattening). + - Use std versions of math functions. + - Add GeographicLib::ECEF and GeographicLib::LocalCartesian classes + and the ECEFConvert utility. + - Gather the documentation on the \ref utilities onto one page. + + - Version 2009-01 + (released 2009-01-12) + - First proper release of library. + - More robust GeographicLib::TransverseMercatorExact: + - Introduce \e extendp version of constructor, + - Test against extended test data, + - Optimize starting positions for Newton's method, + - Fix behavior near all singularities, + - Fix order dependence in C++ start-up code, + - Improved method of computing scale and convergence. + - Documentation on transverse Mercator projection. + - Add GeographicLib::MGRS, GeographicLib::UTMUPS, etc. + + - Version 2008-09 + - Ad hoc posting of information on the transverse Mercator projection. + +
+Back to \ref geocentric. Up to \ref contents. +
+**********************************************************************/ diff --git a/gtsam/3rdparty/GeographicLib/doc/Makefile.am b/gtsam/3rdparty/GeographicLib/doc/Makefile.am new file mode 100644 index 000000000..84c8ccc87 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/Makefile.am @@ -0,0 +1,160 @@ +EXTRAFILES = $(srcdir)/tmseries30.html $(srcdir)/geodseries30.html + +FIGURES = $(srcdir)/gauss-krueger-graticule.png \ + $(srcdir)/thompson-tm-graticule.png \ + $(srcdir)/gauss-krueger-convergence-scale.png \ + $(srcdir)/gauss-schreiber-graticule-a.png \ + $(srcdir)/gauss-krueger-graticule-a.png \ + $(srcdir)/thompson-tm-graticule-a.png \ + $(srcdir)/gauss-krueger-error.png \ + $(srcdir)/meridian-measures.png + +SCRIPTDRIVERS = \ + $(srcdir)/scripts/geod-calc.html \ + $(srcdir)/scripts/geod-google.html \ + $(srcdir)/scripts/geod-google-instructions.html + +JSSCRIPTS = \ + $(srcdir)/scripts/GeographicLib/Math.js \ + $(srcdir)/scripts/GeographicLib/Geodesic.js \ + $(srcdir)/scripts/GeographicLib/GeodesicLine.js \ + $(srcdir)/scripts/GeographicLib/PolygonArea.js \ + $(srcdir)/scripts/GeographicLib/DMS.js \ + $(srcdir)/scripts/GeographicLib/Interface.js + +HPPFILES = \ + $(top_srcdir)/include/GeographicLib/Accumulator.hpp \ + $(top_srcdir)/include/GeographicLib/AlbersEqualArea.hpp \ + $(top_srcdir)/include/GeographicLib/AzimuthalEquidistant.hpp \ + $(top_srcdir)/include/GeographicLib/CassiniSoldner.hpp \ + $(top_srcdir)/include/GeographicLib/Constants.hpp \ + $(top_srcdir)/include/GeographicLib/DMS.hpp \ + $(top_srcdir)/include/GeographicLib/Ellipsoid.hpp \ + $(top_srcdir)/include/GeographicLib/EllipticFunction.hpp \ + $(top_srcdir)/include/GeographicLib/Geocentric.hpp \ + $(top_srcdir)/include/GeographicLib/GeoCoords.hpp \ + $(top_srcdir)/include/GeographicLib/Geodesic.hpp \ + $(top_srcdir)/include/GeographicLib/GeodesicExact.hpp \ + $(top_srcdir)/include/GeographicLib/GeodesicLine.hpp \ + $(top_srcdir)/include/GeographicLib/GeodesicLineExact.hpp \ + $(top_srcdir)/include/GeographicLib/Geohash.hpp \ + $(top_srcdir)/include/GeographicLib/Geoid.hpp \ + $(top_srcdir)/include/GeographicLib/Gnomonic.hpp \ + $(top_srcdir)/include/GeographicLib/LambertConformalConic.hpp \ + $(top_srcdir)/include/GeographicLib/LocalCartesian.hpp \ + $(top_srcdir)/include/GeographicLib/Math.hpp \ + $(top_srcdir)/include/GeographicLib/MGRS.hpp \ + $(top_srcdir)/include/GeographicLib/OSGB.hpp \ + $(top_srcdir)/include/GeographicLib/PolarStereographic.hpp \ + $(top_srcdir)/include/GeographicLib/PolygonArea.hpp \ + $(top_srcdir)/include/GeographicLib/TransverseMercatorExact.hpp \ + $(top_srcdir)/include/GeographicLib/TransverseMercator.hpp \ + $(top_srcdir)/include/GeographicLib/UTMUPS.hpp + +ALLSOURCES = \ + $(top_srcdir)/src/AlbersEqualArea.cpp \ + $(top_srcdir)/src/AzimuthalEquidistant.cpp \ + $(top_srcdir)/src/CassiniSoldner.cpp \ + $(top_srcdir)/src/DMS.cpp \ + $(top_srcdir)/src/Ellipsoid.cpp \ + $(top_srcdir)/src/EllipticFunction.cpp \ + $(top_srcdir)/src/Geocentric.cpp \ + $(top_srcdir)/src/GeoCoords.cpp \ + $(top_srcdir)/src/Geodesic.cpp \ + $(top_srcdir)/src/GeodesicLine.cpp \ + $(top_srcdir)/src/Geohash.cpp \ + $(top_srcdir)/src/Geoid.cpp \ + $(top_srcdir)/src/Gnomonic.cpp \ + $(top_srcdir)/src/LambertConformalConic.cpp \ + $(top_srcdir)/src/LocalCartesian.cpp \ + $(top_srcdir)/src/MGRS.cpp \ + $(top_srcdir)/src/OSGB.cpp \ + $(top_srcdir)/src/PolarStereographic.cpp \ + $(top_srcdir)/src/PolygonArea.cpp \ + $(top_srcdir)/src/TransverseMercator.cpp \ + $(top_srcdir)/src/TransverseMercatorExact.cpp \ + $(top_srcdir)/src/UTMUPS.cpp \ + $(top_srcdir)/tools/CartConvert.cpp \ + $(top_srcdir)/tools/ConicProj.cpp \ + $(top_srcdir)/tools/GeodesicProj.cpp \ + $(top_srcdir)/tools/GeoConvert.cpp \ + $(top_srcdir)/tools/GeodSolve.cpp \ + $(top_srcdir)/tools/GeoidEval.cpp \ + $(top_srcdir)/tools/Gravity.cpp \ + $(top_srcdir)/tools/Planimeter.cpp \ + $(top_srcdir)/tools/TransverseMercatorProj.cpp + +MANPAGES = \ + ../man/CartConvert.1.html \ + ../man/ConicProj.1.html \ + ../man/GeodesicProj.1.html \ + ../man/GeoConvert.1.html \ + ../man/GeodSolve.1.html \ + ../man/GeoidEval.1.html \ + ../man/Gravity.1.html \ + ../man/MagneticField.1.html \ + ../man/Planimeter.1.html \ + ../man/TransverseMercatorProj.1.html + +LEGACYFILES = \ + $(top_srcdir)/legacy/C/geodesic.c \ + $(top_srcdir)/legacy/C/geodesic.h \ + $(top_srcdir)/legacy/C/direct.c \ + $(top_srcdir)/legacy/C/inverse.c \ + $(top_srcdir)/legacy/C/planimeter.c \ + $(top_srcdir)/legacy/Fortran/geodesic.for \ + $(top_srcdir)/legacy/Fortran/geodesic.inc \ + $(top_srcdir)/legacy/Fortran/geoddirect.for \ + $(top_srcdir)/legacy/Fortran/geodinverse.for \ + $(top_srcdir)/legacy/Fortran/planimeter.for + +doc: html/index.html + +if HAVE_DOXYGEN +manpages: $(MANPAGES) + if test -d html; then rm -rf html/*; else mkdir html; fi + cp $^ html/ + touch $@ + +html/index.html: manpages doxyfile.in GeographicLib.dox \ + $(HPPFILES) $(ALLSOURCES) $(EXTRAFILES) $(FIGURES) \ + doxyfile-c.in geodesic-c.dox doxyfile-for.in geodesic-for.dox \ + $(LEGACYFILES) + cp -p $(EXTRAFILES) $(top_srcdir)/maxima/*.mac \ + $(top_srcdir)/LICENSE.txt html/ + sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \ + -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ + $(srcdir)/doxyfile.in | $(DOXYGEN) - + sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \ + -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ + $(srcdir)/doxyfile-c.in | $(DOXYGEN) - + sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \ + -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ + $(srcdir)/doxyfile-for.in | $(DOXYGEN) - +else +html/index.html: index.html.in utilities.html.in + if test -d html; then rm -rf html/*; else mkdir html; fi + cp $(top_srcdir)/LICENSE.txt html/ + sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ + $(srcdir)/utilities.html.in > html/utilities.html + sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ + $(srcdir)/index.html.in > html/index.html +endif + +maintainer-clean-local: + rm -rf html manpages + +install-doc: html/index.html + $(INSTALL) -d $(DESTDIR)$(docdir)/html + $(INSTALL) -m 644 `dirname $<`/*.* $(DESTDIR)$(docdir)/html + -test -f `dirname $<`/C/index.html && \ + $(INSTALL) -d $(DESTDIR)$(docdir)/html/C && \ + $(INSTALL) -m 644 `dirname $<`/C/*.* $(DESTDIR)$(docdir)/html/C + -test -f `dirname $<`/Fortran/index.html && \ + $(INSTALL) -d $(DESTDIR)$(docdir)/html/Fortran && \ + $(INSTALL) -m 644 `dirname $<`/Fortran/*.* \ + $(DESTDIR)$(docdir)/html/Fortran + $(INSTALL) -d $(DESTDIR)$(docdir)/scripts + $(INSTALL) -m 644 $(SCRIPTDRIVERS) $(DESTDIR)$(docdir)/scripts + $(INSTALL) -d $(DESTDIR)$(docdir)/scripts/GeographicLib + $(INSTALL) -m 644 $(JSSCRIPTS) $(DESTDIR)$(docdir)/scripts/GeographicLib diff --git a/gtsam/3rdparty/GeographicLib/doc/Makefile.in b/gtsam/3rdparty/GeographicLib/doc/Makefile.in new file mode 100644 index 000000000..859662692 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/Makefile.in @@ -0,0 +1,561 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/GeographicLib/Config-ac.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COL = @COL@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GEOGRAPHICLIB_VERSION_MAJOR = @GEOGRAPHICLIB_VERSION_MAJOR@ +GEOGRAPHICLIB_VERSION_MINOR = @GEOGRAPHICLIB_VERSION_MINOR@ +GEOGRAPHICLIB_VERSION_PATCH = @GEOGRAPHICLIB_VERSION_PATCH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POD2HTML = @POD2HTML@ +POD2MAN = @POD2MAN@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRAFILES = $(srcdir)/tmseries30.html $(srcdir)/geodseries30.html +FIGURES = $(srcdir)/gauss-krueger-graticule.png \ + $(srcdir)/thompson-tm-graticule.png \ + $(srcdir)/gauss-krueger-convergence-scale.png \ + $(srcdir)/gauss-schreiber-graticule-a.png \ + $(srcdir)/gauss-krueger-graticule-a.png \ + $(srcdir)/thompson-tm-graticule-a.png \ + $(srcdir)/gauss-krueger-error.png \ + $(srcdir)/meridian-measures.png + +SCRIPTDRIVERS = \ + $(srcdir)/scripts/geod-calc.html \ + $(srcdir)/scripts/geod-google.html \ + $(srcdir)/scripts/geod-google-instructions.html + +JSSCRIPTS = \ + $(srcdir)/scripts/GeographicLib/Math.js \ + $(srcdir)/scripts/GeographicLib/Geodesic.js \ + $(srcdir)/scripts/GeographicLib/GeodesicLine.js \ + $(srcdir)/scripts/GeographicLib/PolygonArea.js \ + $(srcdir)/scripts/GeographicLib/DMS.js \ + $(srcdir)/scripts/GeographicLib/Interface.js + +HPPFILES = \ + $(top_srcdir)/include/GeographicLib/Accumulator.hpp \ + $(top_srcdir)/include/GeographicLib/AlbersEqualArea.hpp \ + $(top_srcdir)/include/GeographicLib/AzimuthalEquidistant.hpp \ + $(top_srcdir)/include/GeographicLib/CassiniSoldner.hpp \ + $(top_srcdir)/include/GeographicLib/Constants.hpp \ + $(top_srcdir)/include/GeographicLib/DMS.hpp \ + $(top_srcdir)/include/GeographicLib/Ellipsoid.hpp \ + $(top_srcdir)/include/GeographicLib/EllipticFunction.hpp \ + $(top_srcdir)/include/GeographicLib/Geocentric.hpp \ + $(top_srcdir)/include/GeographicLib/GeoCoords.hpp \ + $(top_srcdir)/include/GeographicLib/Geodesic.hpp \ + $(top_srcdir)/include/GeographicLib/GeodesicExact.hpp \ + $(top_srcdir)/include/GeographicLib/GeodesicLine.hpp \ + $(top_srcdir)/include/GeographicLib/GeodesicLineExact.hpp \ + $(top_srcdir)/include/GeographicLib/Geohash.hpp \ + $(top_srcdir)/include/GeographicLib/Geoid.hpp \ + $(top_srcdir)/include/GeographicLib/Gnomonic.hpp \ + $(top_srcdir)/include/GeographicLib/LambertConformalConic.hpp \ + $(top_srcdir)/include/GeographicLib/LocalCartesian.hpp \ + $(top_srcdir)/include/GeographicLib/Math.hpp \ + $(top_srcdir)/include/GeographicLib/MGRS.hpp \ + $(top_srcdir)/include/GeographicLib/OSGB.hpp \ + $(top_srcdir)/include/GeographicLib/PolarStereographic.hpp \ + $(top_srcdir)/include/GeographicLib/PolygonArea.hpp \ + $(top_srcdir)/include/GeographicLib/TransverseMercatorExact.hpp \ + $(top_srcdir)/include/GeographicLib/TransverseMercator.hpp \ + $(top_srcdir)/include/GeographicLib/UTMUPS.hpp + +ALLSOURCES = \ + $(top_srcdir)/src/AlbersEqualArea.cpp \ + $(top_srcdir)/src/AzimuthalEquidistant.cpp \ + $(top_srcdir)/src/CassiniSoldner.cpp \ + $(top_srcdir)/src/DMS.cpp \ + $(top_srcdir)/src/Ellipsoid.cpp \ + $(top_srcdir)/src/EllipticFunction.cpp \ + $(top_srcdir)/src/Geocentric.cpp \ + $(top_srcdir)/src/GeoCoords.cpp \ + $(top_srcdir)/src/Geodesic.cpp \ + $(top_srcdir)/src/GeodesicLine.cpp \ + $(top_srcdir)/src/Geohash.cpp \ + $(top_srcdir)/src/Geoid.cpp \ + $(top_srcdir)/src/Gnomonic.cpp \ + $(top_srcdir)/src/LambertConformalConic.cpp \ + $(top_srcdir)/src/LocalCartesian.cpp \ + $(top_srcdir)/src/MGRS.cpp \ + $(top_srcdir)/src/OSGB.cpp \ + $(top_srcdir)/src/PolarStereographic.cpp \ + $(top_srcdir)/src/PolygonArea.cpp \ + $(top_srcdir)/src/TransverseMercator.cpp \ + $(top_srcdir)/src/TransverseMercatorExact.cpp \ + $(top_srcdir)/src/UTMUPS.cpp \ + $(top_srcdir)/tools/CartConvert.cpp \ + $(top_srcdir)/tools/ConicProj.cpp \ + $(top_srcdir)/tools/GeodesicProj.cpp \ + $(top_srcdir)/tools/GeoConvert.cpp \ + $(top_srcdir)/tools/GeodSolve.cpp \ + $(top_srcdir)/tools/GeoidEval.cpp \ + $(top_srcdir)/tools/Gravity.cpp \ + $(top_srcdir)/tools/Planimeter.cpp \ + $(top_srcdir)/tools/TransverseMercatorProj.cpp + +MANPAGES = \ + ../man/CartConvert.1.html \ + ../man/ConicProj.1.html \ + ../man/GeodesicProj.1.html \ + ../man/GeoConvert.1.html \ + ../man/GeodSolve.1.html \ + ../man/GeoidEval.1.html \ + ../man/Gravity.1.html \ + ../man/MagneticField.1.html \ + ../man/Planimeter.1.html \ + ../man/TransverseMercatorProj.1.html + +LEGACYFILES = \ + $(top_srcdir)/legacy/C/geodesic.c \ + $(top_srcdir)/legacy/C/geodesic.h \ + $(top_srcdir)/legacy/C/direct.c \ + $(top_srcdir)/legacy/C/inverse.c \ + $(top_srcdir)/legacy/C/planimeter.c \ + $(top_srcdir)/legacy/Fortran/geodesic.for \ + $(top_srcdir)/legacy/Fortran/geodesic.inc \ + $(top_srcdir)/legacy/Fortran/geoddirect.for \ + $(top_srcdir)/legacy/Fortran/geodinverse.for \ + $(top_srcdir)/legacy/Fortran/planimeter.for + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic maintainer-clean-local mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am + + +doc: html/index.html + +@HAVE_DOXYGEN_TRUE@manpages: $(MANPAGES) +@HAVE_DOXYGEN_TRUE@ if test -d html; then rm -rf html/*; else mkdir html; fi +@HAVE_DOXYGEN_TRUE@ cp $^ html/ +@HAVE_DOXYGEN_TRUE@ touch $@ + +@HAVE_DOXYGEN_TRUE@html/index.html: manpages doxyfile.in GeographicLib.dox \ +@HAVE_DOXYGEN_TRUE@ $(HPPFILES) $(ALLSOURCES) $(EXTRAFILES) $(FIGURES) \ +@HAVE_DOXYGEN_TRUE@ doxyfile-c.in geodesic-c.dox doxyfile-for.in geodesic-for.dox \ +@HAVE_DOXYGEN_TRUE@ $(LEGACYFILES) +@HAVE_DOXYGEN_TRUE@ cp -p $(EXTRAFILES) $(top_srcdir)/maxima/*.mac \ +@HAVE_DOXYGEN_TRUE@ $(top_srcdir)/LICENSE.txt html/ +@HAVE_DOXYGEN_TRUE@ sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \ +@HAVE_DOXYGEN_TRUE@ -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ +@HAVE_DOXYGEN_TRUE@ $(srcdir)/doxyfile.in | $(DOXYGEN) - +@HAVE_DOXYGEN_TRUE@ sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \ +@HAVE_DOXYGEN_TRUE@ -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ +@HAVE_DOXYGEN_TRUE@ $(srcdir)/doxyfile-c.in | $(DOXYGEN) - +@HAVE_DOXYGEN_TRUE@ sed -e "s%@PROJECT_SOURCE_DIR@%$(top_srcdir)%g" \ +@HAVE_DOXYGEN_TRUE@ -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ +@HAVE_DOXYGEN_TRUE@ $(srcdir)/doxyfile-for.in | $(DOXYGEN) - +@HAVE_DOXYGEN_FALSE@html/index.html: index.html.in utilities.html.in +@HAVE_DOXYGEN_FALSE@ if test -d html; then rm -rf html/*; else mkdir html; fi +@HAVE_DOXYGEN_FALSE@ cp $(top_srcdir)/LICENSE.txt html/ +@HAVE_DOXYGEN_FALSE@ sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ +@HAVE_DOXYGEN_FALSE@ $(srcdir)/utilities.html.in > html/utilities.html +@HAVE_DOXYGEN_FALSE@ sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ +@HAVE_DOXYGEN_FALSE@ $(srcdir)/index.html.in > html/index.html + +maintainer-clean-local: + rm -rf html manpages + +install-doc: html/index.html + $(INSTALL) -d $(DESTDIR)$(docdir)/html + $(INSTALL) -m 644 `dirname $<`/*.* $(DESTDIR)$(docdir)/html + -test -f `dirname $<`/C/index.html && \ + $(INSTALL) -d $(DESTDIR)$(docdir)/html/C && \ + $(INSTALL) -m 644 `dirname $<`/C/*.* $(DESTDIR)$(docdir)/html/C + -test -f `dirname $<`/Fortran/index.html && \ + $(INSTALL) -d $(DESTDIR)$(docdir)/html/Fortran && \ + $(INSTALL) -m 644 `dirname $<`/Fortran/*.* \ + $(DESTDIR)$(docdir)/html/Fortran + $(INSTALL) -d $(DESTDIR)$(docdir)/scripts + $(INSTALL) -m 644 $(SCRIPTDRIVERS) $(DESTDIR)$(docdir)/scripts + $(INSTALL) -d $(DESTDIR)$(docdir)/scripts/GeographicLib + $(INSTALL) -m 644 $(JSSCRIPTS) $(DESTDIR)$(docdir)/scripts/GeographicLib + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gtsam/3rdparty/GeographicLib/doc/Makefile.mk b/gtsam/3rdparty/GeographicLib/doc/Makefile.mk new file mode 100644 index 000000000..ca852d9d0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/Makefile.mk @@ -0,0 +1,30 @@ +SCRIPTDRIVERS = $(wildcard scripts/[A-Za-z]*.html) +JSSCRIPTS = $(wildcard scripts/GeographicLib/[A-Za-z]*.js) + +VERSION:=$(shell grep '\bVERSION=' ../configure | cut -f2 -d\' | head -1) + +doc: html/index.html + +html/index.html: index.html.in utilities.html.in + if test -d html; then rm -rf html/*; else mkdir html; fi + cp ../LICENSE.txt html/ + sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ + utilities.html.in > html/utilities.html + sed -e "s%@PROJECT_VERSION@%$(VERSION)%g" \ + index.html.in > html/index.html + +PREFIX = /usr/local +DEST = $(PREFIX)/share/doc/GeographicLib +DOCDEST = $(DEST)/html +SCRIPTDEST = $(DEST)/scripts +INSTALL = install -b + +install: html/index.html + test -d $(DOCDEST) || mkdir -p $(DOCDEST) + $(INSTALL) -m 644 html/* $(DOCDEST)/ + test -d $(SCRIPTDEST)/GeographicLib || \ + mkdir -p $(SCRIPTDEST)/GeographicLib + $(INSTALL) -m 644 $(SCRIPTDRIVERS) $(SCRIPTDEST)/ + $(INSTALL) -m 644 $(JSSCRIPTS) $(SCRIPTDEST)/GeographicLib/ + +.PHONY: doc install clean diff --git a/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib.dox b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib.dox new file mode 100644 index 000000000..89b934a7d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib.dox @@ -0,0 +1,241 @@ +// -*- text -*- +/** + * \file NETGeographicLib.dox + * \brief Documentation for NETGeographicLib + * + * Written by Scott Heiman and licensed under the + * MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +/** +\mainpage NETGeographicLib library +\author Scott Heiman (mrmtdew2@outlook.com) +\version 1.34 +\date 2013-12-11 + +\section abstract Abstract + +%NETGeographicLib is a .NET wrapper for GeographicLib. It allows +.NET developers to access GeographicLib classes within C#, Visual +Basic, Managed C++, and other Microsoft .NET languages. + +NETGeographicLib is written in Managed C++. It IS NOT a reimplementation +of the GeographicLib software. It is a container that provides interfaces +to the GeographicLib classes. GeographicLib and NETGeographicLib is an +integrated product. + +The NETGeographic project in the GeographicLib-vc10.sln file located in +\/GeographicLib-1.34/windows will create the NETGeographicLib +DLL. The source code for NETGeographicLib is located in +\/GeographicLib-1.34/dotnet/NETGeographicLib. NETGeographicLib +is not available for older versions of Microsoft Visual Studio. + +NETGeographicLib has been tested with C#, Managed C++, and Visual Basic. +Sample code snippets can be found in +\/GeographicLib-1.34/dotnet/examples. + +\section differences Differences between NETGeographicLib and GeographicLib + +The NETGeographicLib class names are identical to the GeographicLib class names. +All NETGeographicLib classes are in the NETGeographicLib namespace. + +NETGeographicLib exposes most of the GeographicLib classes. The exceptions +are SphericalEngine, GeographicLib::Math, and GeographicLib::Utility. The +SphericalEngine class is a template class which (according to the comments in +the SphericalEngine.h file) is not usually accessible to developers. The +GeographicLib::Math class contains several specialized functions required by +GeographicLib classes. They have limited use outside GeographicLib. This class +may be exposed in a future release if there is demand for it. The functions +provided by GeographicLib::Utility duplicate functions provided by existing .NET +controls (DateTime). + +The SphericalCoefficients class replaces the SphericalEngine::coeff class. + +The NETGeographicLib class function interfaces are similar, and in many cases, +identical to the GeographicLib interfaces. There are differences because of +limitations in .NET and other differences that are discretionary. The comments +in the header files contain a section labeled "INTERFACE DIFFERENCES" that detail +the differences between the NETGeographicLib interfaces and the GeographicLib +interfaces. The differences are summarized in the text that follows. + +Default values for function parameters are not supported in .NET. + +Several GeographicLib class functions accept or return a "capabilities mask" as +an unsigned integer. The NETGeographicLib classes accept and return the capabilities +mask as an enumeration. + +The Geocentric and LocalCartesian classes have functions that return a rotation matrix. +The NETGeographicLib versions return a two-dimensional, 3 × 3 array rather than a vector. + +A lot of GeographicLib classes have inspector functions (MajorRadius, +Flattening, etc.). These inspector functions are implemented as +properties in NETGeographicLib. + +NETGeographicLib classes do not implement constructors that create "uninitialized" objects. + +Many NETGeographicLib classes implement a default constructor that assumes WGS84 parameters. + +Several GeographicLib classes implement the () operator. NETGeographicLib classes +replace the () operator with a specific function. Managed C++ allows developers to +overload the () operator; however, the () operator is not 'elegantly' supported in +other .NET languages. For example, if the () operator was implemented in the +NETGeographicLib::Geoid class, then C# code would look like +\code +Geoid geoid = new Geoid(); +double h = geoid.op_FuncCall(latitude,longitude); // if () operator was implemented. +h = geoid.Height(latitude,longitude); // with () operator replaced with Height +\endcode +The author felt that the op_FuncCall syntax did not appropriately define the purpose +of the function call. + +.NET does not allow developers to overload the assignment operators (=,+=,-=,*=). +These operators have been replaced with functions in the NETGeographicLib::Accumulator class. + +\section library Using NETGeographicLib in a .NET Application + +If you have access to the NETGeographicLib and GeographicLib projects then +-# Create a new solution. +-# Create a new project using any .NET language. For this example, call it MyApp. +-# Add the NETGeographic and Geographic projects to the solution. Verify that NETGeographicLib depends upon GeographicLib. +-# Right-Click MyApp in the Solution View and select "Add Reference..." (C#/VB) or "References..." (Managed C++) in the pop-up menu. +-# (Managed C++) Click the "Add New Reference..." button in the Properties dialog. +\image html NETGeographicLib3.png +-# Click the Projects Tab and select NETGeographic. + \image html NETGeographicLib1.png +-# Click OK. + +If you only have access to the NETGeographic.dll then +-# Create a new solution. +-# Create a new project using any .NET language. For this example, call it MyApp. +-# Right-Click MyApp in the Solution View and select "Add Reference..." in the popup menu. +-# Right-Click MyApp in the Solution View and select "Add Reference..." (C#/VB) or "References..." (Managed C++) in the pop-up menu. +-# (Managed C++) Click the "Add New Reference..." button in the Properties dialog. +\image html NETGeographicLib3.png +-# Click the Browse Tab and navigate to the folder containing NETGeographic.dll. +\image html NETGeographicLib2.png +-# Select NETGeographic.dll and click OK. + +The MyApp project will have access to all public NETGeographicLib classes after the +NETGeographic reference is added to MyApp. + +C# developers should add +\code using NETGeographicLib; \endcode +to any C# source file that uses NETGeographicLib. + +Managed C++ developers should add +\code using namespace NETGeographicLib; \endcode +to any C++ source that uses NETGeographicLib classes. + +Visual Basic developers should add +\code Imports NETGeographicLib \endcode +to any Visual Basic source that uses NETGeographicLib classes. + +\section sample C# Sample Application + +A C# sample application is provided that demonstrates NETGeographicLib classes. +The source code for the sample application is located in +\/GeographicLib-1.34/dotnet/Projections. The sample +application creates a tabbed dialog. Each tab provides data entry fields that +allow the user to exercise one or more NETGeographicLib classes. + +The following table lists the source code that demonstrates specific classes. +
+ + + + + + + + + + + + + + + + + + +
Source FileClasses
AccumPanel.csAccumulator
AlbersPanel.csAlbersEqualArea, LambertConformalConic, TransverseMercator, TransverseMercatorExact
EllipsoidPanel.csEllipsoid
EllipticPanel.csEllipticFunction
GeocentricPanel.csGeocentric
GeodesicPanel.csGeodesic, GeodesicLine, GeodesicExact, GeodesicLineExact
GeoidPanel.csGeoid
GravityPanel.csNormalGravity, GravityModel, GravityCircle
LocalCartesianPanel.csLocalCartesian
MagneticPanel.csMagneticModel, MagneticCircle
MiscPanel.csDMS, Geohash
PolarStereoPanel.csPolarStereographic
PolyPanel.csPolygonArea
ProjectionsPanel.csAzimuthalEquidistant, CassiniSoldner, Gnomonic
SphericalHarmonicsPanel.csSphericalHarmonic, SphericalHarmonic1, SphericalHarmonic2, CircularEngine, SphericalCoefficients
TypeIIIProjPanel.csUTMUPS, MGRS, OSGB
+
+ +\section netcmake Using cmake to build a Managed C++ Application + +The following assumes that you have installed %GeographicLib in one of +two ways: +- you have built and installed %GeographicLib using cmake with + -D BUILD_NETGEOGRAPHICLIB=ON (see + \ref cmake "Installation with cmake" in the %GeographicLib + documentation). You can use any version of Visual Studio to build + %GeographicLib and should use the same version to build your + application. You can build %GeographicLib as a shared library using + -D GEOGRAPHICLIB_LIB_TYPE=SHARED or BOTH. +- you have installed %GeographicLib using one of the binary installers (see + \ref windowsbin "Using a binary installer for Windows" in the + %GeographicLib documentation). In this case, you are restricted to using + Visual Studio 10. + +The minimum recommended version of cmake for use with NETGeographicLib +is 2.8.7. In order to build an application that uses NETGeographicLib +with cmake, ask for the NETGeographicLib "component" of %GeographicLib +using \verbatim +find_package(GeographicLib COMPONENTS NETGeographicLib) \endverbatim +If NETGeographicLib is found, then +GeographicLib_NETGeographicLib_FOUND will be set to true and +GeographicLib_NETGeographicLib_LIBRARIES will be set to the +NETGeographic shared library. This is the name of the cmake target from +which the pathname of the dll can be obtained. + +Here is a very simple test code, which uses the +NETGeographicLib::Geodesic class: +\include example-Geodesic-small.cpp +This example is +dotnet/examples/ManagedCPP/example-Geodesic-small.cpp. + +Here is a complete CMakeList.txt files you can use to build this test +code using the installed library: \verbatim +project (geodesictest) +cmake_minimum_required (VERSION 2.8.7) # required for VS_DOTNET_REFERENCES + +find_package (GeographicLib 1.34 REQUIRED COMPONENTS NETGeographicLib) + +add_executable (${PROJECT_NAME} example-Geodesic-small.cpp) +set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/clr") +string (REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") +string (REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +# This is set up for Release builds only. Change RELEASE to DEBUG for +# Debug builds. +get_target_property (_LOC "${GeographicLib_NETGeographicLib_LIBRARIES}" + IMPORTED_LOCATION_RELEASE) +set_target_properties (${PROJECT_NAME} PROPERTIES VS_DOTNET_REFERENCES ${_LOC}) + +get_target_property (_LIB "${GeographicLib_NETGeographicLib_LIBRARIES}" + IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) +get_target_property (_LIBTYPE ${_LIB} TYPE) +if (_LIBTYPE STREQUAL "SHARED_LIBRARY") + # On Windows systems, copy the shared library to build directory + add_custom_command (TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + copy $ ${CMAKE_CFG_INTDIR} + COMMENT "Copying shared library for GeographicLib") +endif () \endverbatim +The typical invocation of cmake is \verbatim +mkdir BUILD +cd BUILD +cmake -G "Visual Studio 10" -D CMAKE_PREFIX_PATH=C:/pkg-vc10 .. +cmake --build . --config Release \endverbatim +The version of Visual Studio should match that used to build +NETGeographicLib. NOTE: With Visual Studio 10, this results in +warnings such as \verbatim +warning C4945: 'ExtensionAttribute' : cannot import symbol from ... \endverbatim +which can be safely(?) ignored. + +Running the example with \verbatim +Release\geodesictest.exe \endverbatim +should give \verbatim + 5551.75940031868 km \endverbatim +**********************************************************************/ diff --git a/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib1.png b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib1.png new file mode 100644 index 000000000..22049cdbf Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib1.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib2.png b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib2.png new file mode 100644 index 000000000..57e34a69c Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib2.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib3.png b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib3.png new file mode 100644 index 000000000..6d4870b80 Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib3.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/doxyfile-c.in b/gtsam/3rdparty/GeographicLib/doc/doxyfile-c.in new file mode 100644 index 000000000..f77a0b334 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/doxyfile-c.in @@ -0,0 +1,1810 @@ +# Doxyfile 1.8.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = "C library for Geodesics" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @PROJECT_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. Note that you specify absolute paths here, but also +# relative paths, which will be relative from the directory where doxygen is +# started. + +STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/legacy/C/ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = @PROJECT_SOURCE_DIR@/legacy/C/ + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, +# and language is one of the parsers supported by doxygen: IDL, Java, +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, +# C++. For instance to make doxygen treat .inc files as Fortran files (default +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note +# that for custom extensions you also need to set FILE_PATTERNS otherwise the +# files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented classes, +# or namespaces to their corresponding documentation. Such a link can be +# prevented in individual cases by by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 0 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @PROJECT_SOURCE_DIR@/legacy/C \ + @PROJECT_SOURCE_DIR@/doc/geodesic-c.dox + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.c \ + *.h + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/legacy/C + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C, C++ and Fortran comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html/C + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If left blank doxygen will +# generate a default style sheet. Note that it is recommended to use +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this +# tag will in the future become obsolete. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional +# user-defined cascading style sheet that is included after the standard +# style sheets created by doxygen. Using this option one can overrule +# certain style aspects. This is preferred over using HTML_STYLESHEET +# since it does not replace the standard style sheet and is therefor more +# robust against future updates. Doxygen will copy the style sheet file to +# the output directory. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of +# entries shown in the various tree structured indices initially; the user +# can expand and collapse entries dynamically later on. Doxygen will expand +# the tree to such a level that at most the specified number of entries are +# visible (unless a fully collapsed tree already exceeds this amount). +# So setting the number of entries 1 will produce a full collapsed tree by +# default. 0 is a special value representing an infinite number of entries +# and will result in a full expanded tree by default. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely +# identify the documentation publisher. This should be a reverse domain-name +# style string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. +# However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = DOXYGEN + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = html/GeographicLib.tag=.. + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = html/C/GeographicLib-C.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/gtsam/3rdparty/GeographicLib/doc/doxyfile-for.in b/gtsam/3rdparty/GeographicLib/doc/doxyfile-for.in new file mode 100644 index 000000000..47ef530d7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/doxyfile-for.in @@ -0,0 +1,1810 @@ +# Doxyfile 1.8.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = "Fortran library for Geodesics" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @PROJECT_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. Note that you specify absolute paths here, but also +# relative paths, which will be relative from the directory where doxygen is +# started. + +STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/legacy/Fortran/ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = @PROJECT_SOURCE_DIR@/legacy/Fortran/ + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = YES + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, +# and language is one of the parsers supported by doxygen: IDL, Java, +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, +# C++. For instance to make doxygen treat .inc files as Fortran files (default +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note +# that for custom extensions you also need to set FILE_PATTERNS otherwise the +# files are not read by doxygen. + +EXTENSION_MAPPING = inc=Fortran + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented classes, +# or namespaces to their corresponding documentation. Such a link can be +# prevented in individual cases by by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @PROJECT_SOURCE_DIR@/legacy/Fortran \ + @PROJECT_SOURCE_DIR@/doc/geodesic-for.dox + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.for \ + *.inc + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/legacy/Fortran + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = "sed -e /@cond/,/@endcond/g" + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C, C++ and Fortran comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html/Fortran + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If left blank doxygen will +# generate a default style sheet. Note that it is recommended to use +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this +# tag will in the future become obsolete. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional +# user-defined cascading style sheet that is included after the standard +# style sheets created by doxygen. Using this option one can overrule +# certain style aspects. This is preferred over using HTML_STYLESHEET +# since it does not replace the standard style sheet and is therefor more +# robust against future updates. Doxygen will copy the style sheet file to +# the output directory. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of +# entries shown in the various tree structured indices initially; the user +# can expand and collapse entries dynamically later on. Doxygen will expand +# the tree to such a level that at most the specified number of entries are +# visible (unless a fully collapsed tree already exceeds this amount). +# So setting the number of entries 1 will produce a full collapsed tree by +# default. 0 is a special value representing an infinite number of entries +# and will result in a full expanded tree by default. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely +# identify the documentation publisher. This should be a reverse domain-name +# style string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. +# However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = DOXYGEN + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = html/GeographicLib.tag=.. + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = html/Fortran/GeographicLib-for.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/gtsam/3rdparty/GeographicLib/doc/doxyfile-net.in b/gtsam/3rdparty/GeographicLib/doc/doxyfile-net.in new file mode 100644 index 000000000..b9fedb587 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/doxyfile-net.in @@ -0,0 +1,1811 @@ +# Doxyfile 1.8.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = NETGeographicLib + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @PROJECT_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. Note that you specify absolute paths here, but also +# relative paths, which will be relative from the directory where doxygen is +# started. + +STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/dotnet/ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = @PROJECT_SOURCE_DIR@/dotnet/ + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, +# and language is one of the parsers supported by doxygen: IDL, Java, +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, +# C++. For instance to make doxygen treat .inc files as Fortran files (default +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note +# that for custom extensions you also need to set FILE_PATTERNS otherwise the +# files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented classes, +# or namespaces to their corresponding documentation. Such a link can be +# prevented in individual cases by by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = YES + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @PROJECT_SOURCE_DIR@/dotnet/NETGeographicLib \ + @PROJECT_SOURCE_DIR@/doc/NETGeographicLib.dox + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = [A-Za-z]*.h + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/dotnet/examples/CS \ + @PROJECT_SOURCE_DIR@/dotnet/examples/ManagedCPP \ + @PROJECT_SOURCE_DIR@/dotnet/examples/VB + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = @PROJECT_SOURCE_DIR@/doc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C, C++ and Fortran comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html/NET + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If left blank doxygen will +# generate a default style sheet. Note that it is recommended to use +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this +# tag will in the future become obsolete. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional +# user-defined cascading style sheet that is included after the standard +# style sheets created by doxygen. Using this option one can overrule +# certain style aspects. This is preferred over using HTML_STYLESHEET +# since it does not replace the standard style sheet and is therefor more +# robust against future updates. Doxygen will copy the style sheet file to +# the output directory. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of +# entries shown in the various tree structured indices initially; the user +# can expand and collapse entries dynamically later on. Doxygen will expand +# the tree to such a level that at most the specified number of entries are +# visible (unless a fully collapsed tree already exceeds this amount). +# So setting the number of entries 1 will produce a full collapsed tree by +# default. 0 is a special value representing an infinite number of entries +# and will result in a full expanded tree by default. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely +# identify the documentation publisher. This should be a reverse domain-name +# style string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = YES + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. +# However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = DOXYGEN + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = html/GeographicLib.tag=.. + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = html/NET/NETGeographicLib.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/gtsam/3rdparty/GeographicLib/doc/doxyfile.in b/gtsam/3rdparty/GeographicLib/doc/doxyfile.in new file mode 100644 index 000000000..448affa1a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/doxyfile.in @@ -0,0 +1,1812 @@ +# Doxyfile 1.8.2 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or sequence of words) that should +# identify the project. Note that if you do not use Doxywizard you need +# to put quotes around the project name if it contains spaces. + +PROJECT_NAME = GeographicLib + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = @PROJECT_VERSION@ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. Note that you specify absolute paths here, but also +# relative paths, which will be relative from the directory where doxygen is +# started. + +STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = @PROJECT_SOURCE_DIR@/include/ + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding +# "class=itcl::class" will allow you to use the command class in the +# itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, +# and language is one of the parsers supported by doxygen: IDL, Java, +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, +# C++. For instance to make doxygen treat .inc files as Fortran files (default +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note +# that for custom extensions you also need to set FILE_PATTERNS otherwise the +# files are not read by doxygen. + +EXTENSION_MAPPING = + +# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all +# comments according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you +# can mix doxygen, HTML, and XML commands with Markdown formatting. +# Disable only in case of backward compatibilities issues. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented classes, +# or namespaces to their corresponding documentation. Such a link can be +# prevented in individual cases by by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter and setter methods for a property. Setting this option to YES (the default) will make doxygen replace the get and set methods by a property in the documentation. This will only work if the methods are indeed getting or setting a simple type. If this is not the case, or you want to show the methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and +# unions with only public data fields will be shown inline in the documentation +# of the scope in which they are defined (i.e. file, namespace, or group +# documentation), provided this scope is documented. If set to NO (the default), +# structs, classes, and unions are shown on a separate page (for HTML and Man +# pages) or section (for LaTeX and RTF). + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +SYMBOL_CACHE_SIZE = 0 + +# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be +# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given +# their name and scope. Since this can be an expensive process and often the +# same symbol appear multiple times in the code, doxygen keeps a cache of +# pre-resolved symbols. If the cache is too small doxygen will become slower. +# If the cache is too large, memory is wasted. The cache size is given by this +# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files +# containing the references data. This must be a list of .bib files. The +# .bib extension is automatically appended if omitted. Using this command +# requires the bibtex tool to be installed. See also +# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style +# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this +# feature you need bibtex and perl available in the search path. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @PROJECT_SOURCE_DIR@/src \ + @PROJECT_SOURCE_DIR@/include/GeographicLib \ + @PROJECT_SOURCE_DIR@/tools \ + @PROJECT_SOURCE_DIR@/doc/GeographicLib.dox + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = [A-Za-z]*.cpp \ + [A-Za-z]*.hpp + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/examples + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = @PROJECT_SOURCE_DIR@/doc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C, C++ and Fortran comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is advised to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when +# changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If left blank doxygen will +# generate a default style sheet. Note that it is recommended to use +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this +# tag will in the future become obsolete. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional +# user-defined cascading style sheet that is included after the standard +# style sheets created by doxygen. Using this option one can overrule +# certain style aspects. This is preferred over using HTML_STYLESHEET +# since it does not replace the standard style sheet and is therefor more +# robust against future updates. Doxygen will copy the style sheet file to +# the output directory. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the style sheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of +# entries shown in the various tree structured indices initially; the user +# can expand and collapse entries dynamically later on. Doxygen will expand +# the tree to such a level that at most the specified number of entries are +# visible (unless a fully collapsed tree already exceeds this amount). +# So setting the number of entries 1 will produce a full collapsed tree by +# default. 0 is a special value representing an infinite number of entries +# and will result in a full expanded tree by default. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely +# identify the documentation publisher. This should be a reverse domain-name +# style string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) +# at top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. Since the tabs have the same information as the +# navigation tree you can set this option to NO if you already set +# GENERATE_TREEVIEW to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. +# Since the tree basically has the same information as the tab index you +# could consider to set DISABLE_INDEX to NO when enabling this option. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you may also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = YES + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to +# the MathJax Content Delivery Network so you can quickly see the result without +# installing MathJax. +# However, it is strongly recommended to install a local +# copy of MathJax from http://www.mathjax.org before deployment. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension +# names that should be enabled during MathJax rendering. + +MATHJAX_EXTENSIONS = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See +# http://en.wikipedia.org/wiki/BibTeX for more info. + +LATEX_BIB_STYLE = plain + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load style sheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = DOXYGEN + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. For each +# tag file the location of the external documentation should be added. The +# format of a tag file without this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths +# or URLs. Note that each tag file must have a unique name (where the name does +# NOT include the path). If a tag file is not located in the directory in which +# doxygen is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = html/GeographicLib.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will use the Helvetica font for all dot files that +# doxygen generates. When you want a differently looking font you can specify +# the font name using DOT_FONTNAME. You need to make sure dot is able to find +# the font, which can be done by putting it in a standard location or by setting +# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the +# directory containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the Helvetica font. +# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to +# set the path where dot can find it. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside +# the class node. If there are many fields or methods and many nodes the +# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS +# threshold limits the number of items for each type to make the size more +# managable. Set this to 0 for no limit. Note that the threshold may be +# exceeded by 50% before the limit is enforced. + +UML_LIMIT_NUM_FIELDS = 10 + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. If you choose svg you need to set +# HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible in IE 9+ (other browsers do not have this requirement). + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# Note that this requires a modern browser other than Internet Explorer. +# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you +# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files +# visible. Older versions of IE do not have SVG support. + +INTERACTIVE_SVG = NO + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-convergence-scale.png b/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-convergence-scale.png new file mode 100644 index 000000000..1a3172b85 Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-convergence-scale.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-error.png b/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-error.png new file mode 100644 index 000000000..cd397e669 Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-error.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-graticule-a.png b/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-graticule-a.png new file mode 100644 index 000000000..bffd83207 Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-graticule-a.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-graticule.png b/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-graticule.png new file mode 100644 index 000000000..af793eab6 Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/gauss-krueger-graticule.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/gauss-schreiber-graticule-a.png b/gtsam/3rdparty/GeographicLib/doc/gauss-schreiber-graticule-a.png new file mode 100644 index 000000000..51a5e9db2 Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/gauss-schreiber-graticule-a.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/geodesic-c.dox b/gtsam/3rdparty/GeographicLib/doc/geodesic-c.dox new file mode 100644 index 000000000..d07fb61ba --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/geodesic-c.dox @@ -0,0 +1,118 @@ +// -*- text -*- +/** + * \file geodesic-c.dox + * \brief Documentation for geodesic routines implemented in C + * + * Written by Charles Karney and licensed under the + * MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +/** +\mainpage Geodesic routines implemented in C +\author Charles F. F. Karney (charles@karney.com) +\version 1.32 + +\section abstract Abstract + +This is a C implementation of the geodesic algorithms from GeographicLib. This is a +self-contained library (requiring only the standard C math library) +which makes it easy to do geodesic computations for an ellipsoid of +revolution in a C program. It uses ANSI C as described in +B. W. Kernigan and D. M. Ritchie, The C Programming Language, 2nd +Ed. (Prentice Hall, 1988), and so should compile correctly with just +about any C compiler. + +\section download Downloading the source + +The C library is part of %GeographicLib which available for download at +- + GeographicLib-1.32.tar.gz +- + GeographicLib-1.32.zip +. +as either a compressed tar file (tar.gz) or a zip file. After unpacking +the source, the C library can be found in GeographicLib-1.32/legacy/C. +The library consists of two files geodesic.c and geodesic.h. + +The library is also included as part of +proj.4 starting with version +4.9.0, where is used as the computational backend for +geod(1). +Instructions for how to use the library via proj.4 are given below. + +\section doc Library documentation + +The interface to the library is documented via doxygen in the header +file. To access this, see geodesic.h. + +\section samples Sample programs + +Also included are 3 small test programs: + - direct.c is a simple command line utility for solving the + direct geodesic problem; + - inverse.c is a simple command line utility for solving the + inverse geodesic problem; + - planimeter.c is a simple command line utility for computing the + area of a geodesic polygon given its vertices. + . +Here, for example, is inverse.c +\include inverse.c +To compile, link, and run this, you would typically use \verbatim +cc -o inverse inverse.c geodesic.c -lm +echo 30 0 29.5 179.5 | ./inverse \endverbatim +These sample programs can also be built with the supplied cmake file, +CMakeLists.txt, as follows \verbatim +mkdir BUILD +cd BUILD +cmake .. +make +echo 30 0 29.5 179.5 | ./inverse \endverbatim + +Alternatively, if you have proj.4 installed, you can compile and link +with \verbatim +cc -c inverse.c +cc -o inverse inverse.o -lproj +echo 30 0 29.5 179.5 | ./inverse \endverbatim +If proj.4 is installed, e.g., in /usr/local, you might have to use +\verbatim +cc -c -I/usr/local/include inverse.c +cc -o inverse inverse.o -lproj -L/usr/local/lib -Wl,-rpath=/usr/local/lib +echo 30 0 29.5 179.5 | ./inverse \endverbatim + +\section library Using the library + +- Put @verbatim + #include "geodesic.h" @endverbatim + in your source code. If you are using the library via proj.4, change + this to @verbatim + #include @endverbatim +- make calls to the geodesic routines from your code. The interface to + the library is documented in geodesic.h. +- Compile and link as described above. + +\section external External links + +- These algorithms are derived in C. F. F. Karney, + + Algorithms for geodesics, + J. Geodesy 87, 43--55 (2013) + ( addenda). +- A longer paper on geodesics: C. F. F. Karney, + Geodesics + on an ellipsoid of revolution, + Feb. 2011 + ( + errata). +- The GeographicLib web site. +- The C++ library. +- The Java library. +- The Fortran library. +- Documentation on the C++ classes: GeographicLib::Geodesic, + GeographicLib::GeodesicLine, GeographicLib::PolygonArea. +- The section in the %GeographicLib documentation on geodesics: \ref + geodesic. +- + An online geodesic bibliography. +**********************************************************************/ diff --git a/gtsam/3rdparty/GeographicLib/doc/geodesic-for.dox b/gtsam/3rdparty/GeographicLib/doc/geodesic-for.dox new file mode 100644 index 000000000..1ebc59860 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/geodesic-for.dox @@ -0,0 +1,100 @@ +// -*- text -*- +/** + * \file geodesic-for.dox + * \brief Documentation for geodesic routines implemented in Fortran + * + * Written by Charles Karney and licensed under the + * MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +/** +\mainpage Geodesic routines implemented in Fortran +\author Charles F. F. Karney (charles@karney.com) +\version 1.31 + +\section abstract Abstract + +This is a Fortran implementation of the geodesic algorithms from GeographicLib. This is a +self-contained library which makes it easy to do geodesic computations +for an ellipsoid of revolution in a Fortran program. It is written in +Fortran 77 (avoiding features which are now deprecated) and should +compile correctly with just about any Fortran compiler. + +\section download Downloading the source + +The Fortran library is part of %GeographicLib which available for download at +- + GeographicLib-1.31.tar.gz +- + GeographicLib-1.31.zip +. +as either a compressed tar file (tar.gz) or a zip file. After unpacking +the source, the Fortran library can be found in +GeographicLib-1.31/legacy/Fortran. The library consists of the file +geodesic.for. + +\section doc Library documentation + +The interface to the library is documented via doxygen in the source +file. To access this, see geodesic.for. + +\section samples Sample programs + +Also included are 3 small test programs: + - geoddirect.for is a simple command line utility for solving the + direct geodesic problem; + - geodinverse.for is a simple command line utility for solving the + inverse geodesic problem; + - planimeter.for is a simple command line utility for computing the + area of a geodesic polygon given its vertices. + . +Here, for example, is geodinverse.for +\include geodinverse.for +To compile, link, and run this, you would typically use \verbatim +f95 -o geodinverse geodinverse.for geodesic.for +echo 30 0 29.5 179.5 | ./geodinverse \endverbatim +These sample programs can also be built with the supplied cmake file, +CMakeLists.txt, as follows \verbatim +mkdir BUILD +cd BUILD +cmake .. +make +echo 30 0 29.5 179.5 | ./geodinverse \endverbatim + +\section library Using the library + +- Optionall put @verbatim + include "geodesic.inc" @endverbatim + in declaration section of your subroutines. +- make calls to the geodesic routines from your code. The interface to + the library is documented in geodesic.for. +- Compile and link as described above. + +\section external External links + +- These algorithms are derived in C. F. F. Karney, + + Algorithms for geodesics, + J. Geodesy 87, 43--55 (2013) + ( addenda). +- A longer paper on geodesics: C. F. F. Karney, + Geodesics + on an ellipsoid of revolution, + Feb. 2011 + ( + errata). +- The GeographicLib web site. +- The C++ library. +- The C library. +- The Java library. +- Documentation on the C++ classes: GeographicLib::Geodesic, + GeographicLib::GeodesicLine, GeographicLib::PolygonArea. +- The section in the %GeographicLib documentation on geodesics: \ref + geodesic. +- + An online geodesic bibliography. +**********************************************************************/ + +**********************************************************************/ diff --git a/gtsam/3rdparty/GeographicLib/doc/geodseries30.html b/gtsam/3rdparty/GeographicLib/doc/geodseries30.html new file mode 100644 index 000000000..9305117b3 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/geodseries30.html @@ -0,0 +1,1717 @@ + + + + Series for geodesic calculations + + +

+ Series for geodesic calculations +

+This extends the series given +here to 30th order in the +flattening. See +
+ Charles F. F. Karney,
+ + Algorithms for geodesics,
+ J. Geodesy 87(1), 43–55 (Jan. 2013);
+ DOI: + + 10.1007/s00190-012-0578-z + (pdf); + addenda: + geod-addenda.html. +
+ +
+// Generated by Maxima on 2012-10-19 10:41:58-04:00
+
+A1 = (1 + 1/4 * eps^2
+        + 1/64 * eps^4
+        + 1/256 * eps^6
+        + 25/16384 * eps^8
+        + 49/65536 * eps^10
+        + 441/1048576 * eps^12
+        + 1089/4194304 * eps^14
+        + 184041/1073741824 * eps^16
+        + 511225/4294967296 * eps^18
+        + 5909761/68719476736 * eps^20
+        + 17631601/274877906944 * eps^22
+        + 863948449/17592186044416 * eps^24
+        + 2704312009/70368744177664 * eps^26
+        + 34493775625/1125899906842624 * eps^28
+        + 111759833025/4503599627370496 * eps^30) / (1 - eps);
+
+C1[1] = - 1/2 * eps
+        + 3/16 * eps^3
+        - 1/32 * eps^5
+        + 19/2048 * eps^7
+        - 3/4096 * eps^9
+        + 53/65536 * eps^11
+        + 29/131072 * eps^13
+        + 13827/67108864 * eps^15
+        + 17321/134217728 * eps^17
+        + 205579/2147483648 * eps^19
+        + 302847/4294967296 * eps^21
+        + 29656189/549755813888 * eps^23
+        + 46250107/1099511627776 * eps^25
+        + 588536103/17592186044416 * eps^27
+        + 951224759/35184372088832 * eps^29;
+C1[2] = - 1/16 * eps^2
+        + 1/32 * eps^4
+        - 9/2048 * eps^6
+        + 7/4096 * eps^8
+        + 1/65536 * eps^10
+        + 27/131072 * eps^12
+        + 5735/67108864 * eps^14
+        + 8995/134217728 * eps^16
+        + 96543/2147483648 * eps^18
+        + 142801/4294967296 * eps^20
+        + 13684121/549755813888 * eps^22
+        + 21112497/1099511627776 * eps^24
+        + 265707563/17592186044416 * eps^26
+        + 425659393/35184372088832 * eps^28
+        + 1417935787335/144115188075855872 * eps^30;
+C1[3] = - 1/48 * eps^3
+        + 3/256 * eps^5
+        - 3/2048 * eps^7
+        + 17/24576 * eps^9
+        + 3/65536 * eps^11
+        + 843/8388608 * eps^13
+        + 9719/201326592 * eps^15
+        + 9801/268435456 * eps^17
+        + 54189/2147483648 * eps^19
+        + 3873871/206158430208 * eps^21
+        + 7822227/549755813888 * eps^23
+        + 24333681/2199023255552 * eps^25
+        + 462823139/52776558133248 * eps^27
+        + 127352837355/18014398509481984 * eps^29;
+C1[4] = - 5/512 * eps^4
+        + 3/512 * eps^6
+        - 11/16384 * eps^8
+        + 3/8192 * eps^10
+        + 651/16777216 * eps^12
+        + 1009/16777216 * eps^14
+        + 16763/536870912 * eps^16
+        + 1569/67108864 * eps^18
+        + 2263733/137438953472 * eps^20
+        + 1698897/137438953472 * eps^22
+        + 41547591/4398046511104 * eps^24
+        + 16273415/2199023255552 * eps^26
+        + 212683932395/36028797018963968 * eps^28
+        + 172435304205/36028797018963968 * eps^30;
+C1[5] = - 7/1280 * eps^5
+        + 7/2048 * eps^7
+        - 3/8192 * eps^9
+        + 117/524288 * eps^11
+        + 253/8388608 * eps^13
+        + 13419/335544320 * eps^15
+        + 5855/268435456 * eps^17
+        + 70025/4294967296 * eps^19
+        + 800595/68719476736 * eps^21
+        + 4842105/549755813888 * eps^23
+        + 74591411/10995116277760 * eps^25
+        + 6021893805/1125899906842624 * eps^27
+        + 77302095005/18014398509481984 * eps^29;
+C1[6] = - 7/2048 * eps^6
+        + 9/4096 * eps^8
+        - 117/524288 * eps^10
+        + 467/3145728 * eps^12
+        + 1569/67108864 * eps^14
+        + 3813/134217728 * eps^16
+        + 206677/12884901888 * eps^18
+        + 103137/8589934592 * eps^20
+        + 4770087/549755813888 * eps^22
+        + 21782093/3298534883328 * eps^24
+        + 5765474835/1125899906842624 * eps^26
+        + 9142699905/2251799813685248 * eps^28
+        + 1415580640915/432345564227567616 * eps^30;
+C1[7] = - 33/14336 * eps^7
+        + 99/65536 * eps^9
+        - 77/524288 * eps^11
+        + 55/524288 * eps^13
+        + 1233/67108864 * eps^15
+        + 11345/536870912 * eps^17
+        + 52591/4294967296 * eps^19
+        + 552591/60129542144 * eps^21
+        + 3685111/549755813888 * eps^23
+        + 722278195/140737488355328 * eps^25
+        + 4507296795/1125899906842624 * eps^27
+        + 1795935355/562949953421312 * eps^29;
+C1[8] = - 429/262144 * eps^8
+        + 143/131072 * eps^10
+        - 429/4194304 * eps^12
+        + 325/4194304 * eps^14
+        + 31525/2147483648 * eps^16
+        + 8733/536870912 * eps^18
+        + 165251/17179869184 * eps^20
+        + 124411/17179869184 * eps^22
+        + 2996969235/562949953421312 * eps^24
+        + 1153418845/281474976710656 * eps^26
+        + 28941724625/9007199254740992 * eps^28
+        + 23168297355/9007199254740992 * eps^30;
+C1[9] = - 715/589824 * eps^9
+        + 429/524288 * eps^11
+        - 39/524288 * eps^13
+        + 11921/201326592 * eps^15
+        + 6399/536870912 * eps^17
+        + 55233/4294967296 * eps^19
+        + 199205/25769803776 * eps^21
+        + 25677825/4398046511104 * eps^23
+        + 608155005/140737488355328 * eps^25
+        + 33866001805/10133099161583616 * eps^27
+        + 1482164085/562949953421312 * eps^29;
+C1[10] = - 2431/2621440 * eps^10
+        + 663/1048576 * eps^12
+        - 3757/67108864 * eps^14
+        + 6239/134217728 * eps^16
+        + 42177/4294967296 * eps^18
+        + 446131/42949672960 * eps^20
+        + 27835817/4398046511104 * eps^22
+        + 42180321/8796093022208 * eps^24
+        + 4019599397/1125899906842624 * eps^26
+        + 6244603111/2251799813685248 * eps^28
+        + 316153750539/144115188075855872 * eps^30;
+C1[11] = - 4199/5767168 * eps^11
+        + 4199/8388608 * eps^13
+        - 2907/67108864 * eps^15
+        + 10013/268435456 * eps^17
+        + 35207/4294967296 * eps^19
+        + 4694805/549755813888 * eps^21
+        + 23148175/4398046511104 * eps^23
+        + 70365265/17592186044416 * eps^25
+        + 3370190355/1125899906842624 * eps^27
+        + 42049539055/18014398509481984 * eps^29;
+C1[12] = - 29393/50331648 * eps^12
+        + 6783/16777216 * eps^14
+        - 18411/536870912 * eps^16
+        + 6137/201326592 * eps^18
+        + 7611495/1099511627776 * eps^20
+        + 7835163/1099511627776 * eps^22
+        + 468146111/105553116266496 * eps^24
+        + 59462469/17592186044416 * eps^26
+        + 91557125181/36028797018963968 * eps^28
+        + 214950398465/108086391056891904 * eps^30;
+C1[13] = - 52003/109051904 * eps^13
+        + 22287/67108864 * eps^15
+        - 7429/268435456 * eps^17
+        + 869193/34359738368 * eps^19
+        + 3247347/549755813888 * eps^21
+        + 26486133/4398046511104 * eps^23
+        + 66500935/17592186044416 * eps^25
+        + 12703797/4398046511104 * eps^27
+        + 39283195529/18014398509481984 * eps^29;
+C1[14] = - 185725/469762048 * eps^14
+        + 37145/134217728 * eps^16
+        - 780045/34359738368 * eps^18
+        + 1461765/68719476736 * eps^20
+        + 22372215/4398046511104 * eps^22
+        + 45260895/8796093022208 * eps^24
+        + 57244355/17592186044416 * eps^26
+        + 306953515/123145302310912 * eps^28
+        + 272204273085/144115188075855872 * eps^30;
+C1[15] = - 22287/67108864 * eps^15
+        + 1002915/4294967296 * eps^17
+        - 648945/34359738368 * eps^19
+        + 1243265/68719476736 * eps^21
+        + 19425915/4398046511104 * eps^23
+        + 78089301/17592186044416 * eps^25
+        + 12427015/4398046511104 * eps^27
+        + 610648965/281474976710656 * eps^29;
+C1[16] = - 9694845/34359738368 * eps^16
+        + 1710855/8589934592 * eps^18
+        - 4372185/274877906944 * eps^20
+        + 4272135/274877906944 * eps^22
+        + 543781755/140737488355328 * eps^24
+        + 271745805/70368744177664 * eps^26
+        + 5567912565/2251799813685248 * eps^28
+        + 4284219735/2251799813685248 * eps^30;
+C1[17] = - 17678835/73014444032 * eps^17
+        + 5892945/34359738368 * eps^19
+        - 930465/68719476736 * eps^21
+        + 59239605/4398046511104 * eps^23
+        + 59859915/17592186044416 * eps^25
+        + 930465/274877906944 * eps^27
+        + 613284315/281474976710656 * eps^29;
+C1[18] = - 21607465/103079215104 * eps^18
+        + 10235115/68719476736 * eps^20
+        - 51175575/4398046511104 * eps^22
+        + 103488385/8796093022208 * eps^24
+        + 53036505/17592186044416 * eps^26
+        + 52551045/17592186044416 * eps^28
+        + 278415054335/144115188075855872 * eps^30;
+C1[19] = - 119409675/652835028992 * eps^19
+        + 71645805/549755813888 * eps^21
+        - 44352165/4398046511104 * eps^23
+        + 182060985/17592186044416 * eps^25
+        + 2953215/1099511627776 * eps^27
+        + 47776802115/18014398509481984 * eps^29;
+C1[20] = - 176726319/1099511627776 * eps^20
+        + 126233085/1099511627776 * eps^22
+        - 309844845/35184372088832 * eps^24
+        + 161159235/17592186044416 * eps^26
+        + 86652277095/36028797018963968 * eps^28
+        + 426519840213/180143985094819840 * eps^30;
+C1[21] = - 547010035/3848290697216 * eps^21
+        + 447553665/4398046511104 * eps^23
+        - 136211985/17592186044416 * eps^25
+        + 9182417465/1125899906842624 * eps^27
+        + 38976086565/18014398509481984 * eps^29;
+C1[22] = - 6116566755/48378511622144 * eps^22
+        + 797813055/8796093022208 * eps^24
+        - 7712192865/1125899906842624 * eps^26
+        + 16434948933/2251799813685248 * eps^28
+        + 281701652697/144115188075855872 * eps^30;
+C1[23] = - 11435320455/101155069755392 * eps^23
+        + 11435320455/140737488355328 * eps^25
+        - 6861192273/1125899906842624 * eps^27
+        + 3694488147/562949953421312 * eps^29;
+C1[24] = - 57176602275/562949953421312 * eps^24
+        + 20583576819/281474976710656 * eps^26
+        - 49083913953/9007199254740992 * eps^28
+        + 160153129039/27021597764222976 * eps^30;
+C1[25] = - 322476036831/3518437208883200 * eps^25
+        + 74417546961/1125899906842624 * eps^27
+        - 2756205443/562949953421312 * eps^29;
+C1[26] = - 1215486600363/14636698788954112 * eps^26
+        + 135054066707/2251799813685248 * eps^28
+        - 636683457333/144115188075855872 * eps^30;
+C1[27] = - 2295919134019/30399297484750848 * eps^27
+        + 983965343151/18014398509481984 * eps^29;
+C1[28] = - 2483341104143/36028797018963968 * eps^28
+        + 1798281489207/36028797018963968 * eps^30;
+C1[29] = - 32968493968795/522417556774977536 * eps^29;
+C1[30] = - 125280277081421/2161727821137838080 * eps^30;
+
+C1'[1] = + 1/2 * eps
+         - 9/32 * eps^3
+         + 205/1536 * eps^5
+         - 4879/73728 * eps^7
+         + 9039/327680 * eps^9
+         - 1050467/88473600 * eps^11
+         + 512031157/118908518400 * eps^13
+         - 1086005273/591900180480 * eps^15
+         + 4075676109451/7671026339020800 * eps^17
+         - 794840669327713/2761569482047488000 * eps^19
+         + 2239087029841367/77148607752437760000 * eps^21
+         - 40730402540905726093/641567822069272412160000 * eps^23
+         - 97668067278655185143/4927240873492012125388800 * eps^25
+         - 741941887011669089199917/28784819522671853552271360000 * eps^27
+         - 68324470839108426239947872773/3917038240645185831393086668800000 * eps^29;
+C1'[2] = + 5/16 * eps^2
+         - 37/96 * eps^4
+         + 1335/4096 * eps^6
+         - 86171/368640 * eps^8
+         + 4119073/28311552 * eps^10
+         - 18357853/220200960 * eps^12
+         + 167645485631/3805072588800 * eps^14
+         - 2133468723257/95887829237760 * eps^16
+         + 59947666093201/5682241732608000 * eps^18
+         - 29889474712770151/6075452860504473600 * eps^20
+         + 3112904386445139443/1458108686521073664000 * eps^22
+         - 4531132450329984761/4728107532256542720000 * eps^24
+         + 1671560053825711640749861/4483789194877731034103808000 * eps^26
+         - 1539092646053487110737563637/8743388930011575516502425600000 * eps^28
+         + 3620358411657954539738131669/69636235389247748113654874112000 * eps^30;
+C1'[3] = + 29/96 * eps^3
+         - 75/128 * eps^5
+         + 2901/4096 * eps^7
+         - 443327/655360 * eps^9
+         + 1152507/2097152 * eps^11
+         - 1170339447/2936012800 * eps^13
+         + 14896648073/56371445760 * eps^15
+         - 1719099273321/10522669875200 * eps^17
+         + 440255022166233/4629974745088000 * eps^19
+         - 4689329894241941/88895515105689600 * eps^21
+         + 4309464445273351209/154085559516528640000 * eps^23
+         - 77740899024366984327/5423811694981808128000 * eps^25
+         + 4025440507207669842667/569500227973089853440000 * eps^27
+         - 10783702637849849812840017/3158827931157405053747200000 * eps^29;
+C1'[4] = + 539/1536 * eps^4
+         - 2391/2560 * eps^6
+         + 1082857/737280 * eps^8
+         - 2722891/1548288 * eps^10
+         + 6190623251/3523215360 * eps^12
+         - 2198240553463/1426902220800 * eps^14
+         + 835898387989583/684913065984000 * eps^16
+         - 62186045114429/69759664128000 * eps^18
+         + 39435262997832698047/64804830512047718400 * eps^20
+         - 14876456230497799912553/37910825849547915264000 * eps^22
+         + 1136134446936925800945877/4717791661277073899520000 * eps^24
+         - 45093458223482404762480843/318450937136202488217600000 * eps^26
+         + 3448586228525796468187820868401/43044376270826217927396556800000 * eps^28
+         - 9267292123878690223760617403717/211395714574502092487880867840000 * eps^30;
+C1'[5] = + 3467/7680 * eps^5
+         - 28223/18432 * eps^7
+         + 1361343/458752 * eps^9
+         - 211942939/49545216 * eps^11
+         + 289319933243/57076088832 * eps^13
+         - 2641923029237/507343011840 * eps^15
+         + 164922300524827/34441342746624 * eps^17
+         - 326226244879987219/81006038140059648 * eps^19
+         + 905728657830831557/288021468942434304 * eps^21
+         - 78322584746542259177147/33968099961194932076544 * eps^23
+         + 13053248693785337495272007/8152343990686783698370560 * eps^25
+         - 1878086576945897568602243/1771373509087498680139776 * eps^27
+         + 39401408426156638969274880529/58540351728323656381259317248 * eps^29;
+C1'[6] = + 38081/61440 * eps^6
+         - 733437/286720 * eps^8
+         + 10820079/1835008 * eps^10
+         - 547525831/55050240 * eps^12
+         + 45741465549/3355443200 * eps^14
+         - 41464506827097/2583691264000 * eps^16
+         + 33307900611667019/1984274890752000 * eps^18
+         - 29549592050928009/1851989898035200 * eps^20
+         + 1510642276897435153959/107859891661570048000 * eps^22
+         - 3379725045215031439859/294163340895191040000 * eps^24
+         + 3068085809843886425921127/345151653317024153600000 * eps^26
+         - 120481724276440955567319861/18440959762938147635200000 * eps^28
+         + 5351579260607165516870592929/1166336466888888019845120000 * eps^30;
+C1'[7] = + 459485/516096 * eps^7
+         - 709743/163840 * eps^9
+         + 983638957/84934656 * eps^11
+         - 570327360331/25480396800 * eps^13
+         + 2524677004673/72477573120 * eps^15
+         - 3979901788209089/86103356866560 * eps^17
+         + 145501072048061969477/2686424734236672000 * eps^19
+         - 767257565495432565461/13372425343755878400 * eps^21
+         + 576429350583276368332877/10315870979468820480000 * eps^23
+         - 15049813241233902040230469/297097084208702029824000 * eps^25
+         + 1656087831553847819569877/38371513250126757888000 * eps^27
+         - 222870544090985685701249717628901/6400184226857542607280537600000 * eps^29;
+C1'[8] = + 109167851/82575360 * eps^8
+         - 550835669/74317824 * eps^10
+         + 29797006823/1321205760 * eps^12
+         - 13775344174277/280284364800 * eps^14
+         + 51602655250575029/602723498065920 * eps^16
+         - 229269121915303969/1813751267328000 * eps^18
+         + 83019178881141641377/506287738375372800 * eps^20
+         - 132324024533588768532907/691082762882383872000 * eps^22
+         + 396326201752354956063673999/1935504271293158522880000 * eps^24
+         - 703889408095319694872984797279/3464746196041883071807488000 * eps^26
+         + 673066976958864232412288090929279/3563738944500222588144844800000 * eps^28
+         - 3842435239091994304467908471778509/23172222559128113984248479744000 * eps^30;
+C1'[9] = + 83141299/41287680 * eps^9
+         - 1172993649/91750400 * eps^11
+         + 1409193884757/32296140800 * eps^13
+         - 8205463797521/77510737920 * eps^15
+         + 6267340235329209/30709016166400 * eps^17
+         - 9985904736500570067/30094835843072000 * eps^19
+         + 6818098564242858298663/14445521204674560000 * eps^21
+         - 81179814711559538793297/134824864576962560000 * eps^23
+         + 8228623619106009640781583/11735156212778821222400 * eps^25
+         - 10637423815896802535794719059/14082187455334585466880000 * eps^27
+         + 2713138463299280056775410984179/3567487488684761651609600000 * eps^29;
+C1'[10] = + 9303339907/2972712960 * eps^10
+         - 32258337779/1453326336 * eps^12
+         + 105458791111591/1255673954304 * eps^14
+         - 21991423000897853/97942568435712 * eps^16
+         + 440758100714976799/928640648871936 * eps^18
+         - 4436414286264685342183/5265392479103877120 * eps^20
+         + 11983230751430888047165/9190503236254040064 * eps^22
+         - 438407397616490706337835/243037752247606837248 * eps^24
+         + 503750725100748248754169576435/221743756546680516595679232 * eps^26
+         - 200204949675864221817037957885535/75836364738964736675722297344 * eps^28
+         + 15426622123776978643737455613179549/5392808159215270163606918922240 * eps^30;
+C1'[11] = + 230944143253/46714060800 * eps^11
+         - 13820996202863/356725555200 * eps^13
+         + 530891275077073/3297729576960 * eps^15
+         - 5861919724284516433/12465417800908800 * eps^17
+         + 25885301781901909490837/23933602177744896000 * eps^19
+         - 110706057667150724184229/53185782617210880000 * eps^21
+         + 2719521302806552306469953613/781192775081593405440000 * eps^23
+         - 233567275961905041708130573/44996703844699780153344 * eps^25
+         + 798884301221118236917664805229/113666887205034582343680000 * eps^27
+         - 9934805882969858378831722690837171/1133916936886434459864268800000 * eps^29;
+C1'[12] = + 306777964441/38755368960 * eps^12
+         - 57044595387963/839699660800 * eps^14
+         + 11568981229047951/37618544803840 * eps^16
+         - 687397289384966383/705347715072000 * eps^18
+         + 233327560280127272763/96303474697830400 * eps^20
+         - 3739229605202668172763/744163213574144000 * eps^22
+         + 65835782650063594518691/7289762092154880000 * eps^24
+         - 14792936433071373028889379/1024668970784915456000 * eps^26
+         + 74599042152248060866262559758871/3567487488684761651609600000 * eps^28
+         - 16680060316657855648846944446971/599337898099039957470412800 * eps^30;
+C1'[13] = + 2615671472444983/204047017574400 * eps^13
+         - 1167820427927323/9766352977920 * eps^15
+         + 24715664579918728243/42190644864614400 * eps^17
+         - 5067175041833532570683/2531438691876864000 * eps^19
+         + 93543614041472271515281/17487017757219225600 * eps^21
+         - 11792083140833533278156043493/991513906834330091520000 * eps^23
+         + 8268814159710166088320187726251/361704273213163617386496000 * eps^25
+         - 24380431693719066689532645995167/625167879627690202890240000 * eps^27
+         + 40946727771183021563590563999653687303/680582760477888662474430873600000 * eps^29;
+C1'[14] = + 34216519493594561/1632376140595200 * eps^14
+         - 1477329715340046517/6995897745408000 * eps^16
+         + 9229913663063228233/8291434364928000 * eps^18
+         - 18633370679636805385039/4566922048202342400 * eps^20
+         + 613651924549596407462456317/52610941995290984448000 * eps^22
+         - 30737516008559329681484121827/1110675442122809671680000 * eps^24
+         + 271813271604582464710892651024459/4798117909970537781657600000 * eps^26
+         - 20699812425639174189936631117519897/201520952218762586829619200000 * eps^28
+         + 1211662551734777607545609062337329843/7206133351721085009678827520000 * eps^30;
+C1'[15] = + 177298287500753/5129801564160 * eps^15
+         - 5627790514610829/15047417921536 * eps^17
+         + 17279798906736629091/8185795349315584 * eps^19
+         - 115931060832532759571/14032792027398144 * eps^21
+         + 2003356613292569725398363/79631417158142001152 * eps^23
+         - 101051987173195622011224471/1592628343162840023040 * eps^25
+         + 756303360522076489366917931/5488442290284248694784 * eps^27
+         - 5815559636408944974046175630559/21975722930298131773915136 * eps^29;
+C1'[16] = + 1259425185539653127243/21939135329599488000 * eps^16
+         - 2293308899647899314723/3453382412992512000 * eps^18
+         + 21460336637287899464532611/5370700328685954662400 * eps^20
+         - 25456489696915892609916529129/1530649593675497078784000 * eps^22
+         + 2553846684009183021840672953/47515526935735173120000 * eps^24
+         - 29538537350054556934382434071434011/205719305389986807388569600000 * eps^26
+         + 3770295466320560881269963263089000511/11433662446938214136964710400000 * eps^28
+         - 519676261197496743489350631148600190213/777234965004088823221667758080000 * eps^30;
+C1'[17] = + 1789450487559418666447/18648265030159564800 * eps^17
+         - 233343808292218091539949/197452217966395392000 * eps^19
+         + 20146628393835035886855197/2667798856079297740800 * eps^21
+         - 239929099187527215432793286501/7203056911414103900160000 * eps^23
+         + 62988069927933679012075753421807/553194770796603179532288000 * eps^25
+         - 3378232317776013495553552510617097/10517530210207023413329920000 * eps^27
+         + 7314657081705017862640836634319879174339/9405196215175528617136147660800000 * eps^29;
+C1'[18] = + 212221079284639273481/1315574252568576000 * eps^18
+         - 1260552943986821598063/598192737065369600 * eps^20
+         + 3546697789798651658576181/248848178619193753600 * eps^22
+         - 78517248057208956823851421/1182310350905671680000 * eps^24
+         + 1067601202019151639052958889147/4459359360855952064512000 * eps^26
+         - 40116098461444544658667493570308857/56410895914827793616076800000 * eps^28
+         + 392210563613343460551402383435826349/216617840312938727485734912000 * eps^30;
+C1'[19] = + 69532546869173713149501223/255108265612582846464000 * eps^19
+         - 112316728120020126447652781/29837224048255303680000 * eps^21
+         + 4848022300045341835150543297447/180455531043848076656640000 * eps^23
+         - 125642956497967669586988251237879/952805203911517844747059200 * eps^25
+         + 33298130071722823747096176158055463/66596830966654998455255040000 * eps^27
+         - 6563632449843987460043036353052098320209/4207587780473262802403013427200000 * eps^29;
+C1'[20] = + 5810177473683430838091097/12559176153234847825920 * eps^20
+         - 4618600293785993240609142923/685731017966622691295232 * eps^22
+         + 1356670146516048832626691899799/26819702036027909703991296 * eps^24
+         - 2172503519024023685991761815076867/8327517482186665963089297408 * eps^26
+         + 3793117143067735304052463936462682647/3654590529325348262658617376768 * eps^28
+         - 48227737126007159325773215007655970673/14212296502931909910339067576320 * eps^30;
+C1'[21] = + 80853671585727628548617/102547326354063360000 * eps^21
+         - 33710670766735229663452761/2793193841644011520000 * eps^23
+         + 7824467166805891507557010233/82231626697999699148800 * eps^25
+         - 12690496274820158383049352282653/24669488009399909744640000 * eps^27
+         + 56382836432185917384773311978295199/26314120543359903727616000000 * eps^29;
+C1'[22] = + 924898009889615635728755915083/685731017966622691295232000 * eps^22
+         - 34498885534979583771510062454227/1593112465983062818160640000 * eps^24
+         + 579153806014612787074377437506223/3238703930845567705625395200 * eps^26
+         - 1569950058036065954085485531335819511/1552386282642142415290368000000 * eps^28
+         + 13441093380769154612428393473490856259941/3053881893191980641891039313920000 * eps^30;
+C1'[23] = + 4016551943902862119978017069801911/1734899475455555408976936960000 * eps^23
+         - 7042743315770579684284446742015447/181032988743188390501941248000 * eps^25
+         + 600397969311873169056555916083822001/1787980135735193980266086400000 * eps^27
+         - 223977408534083722217209433995298286356287/112964584975749555673211338752000000 * eps^29;
+C1'[24] = + 33730424938117851020161782371647/8461634387224169042411520000 * eps^24
+         - 2466848731962947446637554898208789/35256809946767371010048000000 * eps^26
+         + 9241553981242966860439405699656735351/14666832937855226340179968000000 * eps^28
+         - 34121931746328650162120952716097657509/8800099762713135804107980800000 * eps^30;
+C1'[25] = + 251959060076566669691445659637541/36604472449172158079513395200 * eps^25
+         - 10775075917257378388661547627353189/85536969693571680015929573376 * eps^27
+         + 7072923673224417550895367212096744699801/5986219287034920454234815263145984 * eps^29;
+C1'[26] = + 18043464502912016496703680586663352917/1514094087670302902379872256000000 * eps^26
+         - 15705330809648579467084357186039173723679/69182452928935378770280316928000000 * eps^28
+         + 762509129435444486126998095414252687404107/344374876801811663212062022041600000 * eps^30;
+C1'[27] = + 819021838914972651233426418104059459/39600448932209111118485913600000 * eps^27
+         - 4425211305648392775905209005851207973/10807140059472272040132608000000 * eps^29;
+C1'[28] = + 137344334847260471742767128830849077140799/3817741892241658452955877081088000000 * eps^28
+         - 3056545074816755404384556140143837530441/4134995887021777596105338388480000 * eps^30;
+C1'[29] = + 2381352350093111938327626556685002210278872879/37975078602127776631552109325582336000000 * eps^29;
+C1'[30] = + 20034557328168749612075941075238883149/182929433787470496587153418485760 * eps^30;
+
+A2 = (1 + 1/4 * eps^2
+        + 9/64 * eps^4
+        + 25/256 * eps^6
+        + 1225/16384 * eps^8
+        + 3969/65536 * eps^10
+        + 53361/1048576 * eps^12
+        + 184041/4194304 * eps^14
+        + 41409225/1073741824 * eps^16
+        + 147744025/4294967296 * eps^18
+        + 2133423721/68719476736 * eps^20
+        + 7775536041/274877906944 * eps^22
+        + 457028729521/17592186044416 * eps^24
+        + 1690195005625/70368744177664 * eps^26
+        + 25145962430625/1125899906842624 * eps^28
+        + 93990019574025/4503599627370496 * eps^30) * (1 - eps);
+
+C2[1] = + 1/2 * eps
+        + 1/16 * eps^3
+        + 1/32 * eps^5
+        + 41/2048 * eps^7
+        + 59/4096 * eps^9
+        + 727/65536 * eps^11
+        + 1171/131072 * eps^13
+        + 498409/67108864 * eps^15
+        + 848479/134217728 * eps^17
+        + 11768921/2147483648 * eps^19
+        + 20705249/4294967296 * eps^21
+        + 2359256231/549755813888 * eps^23
+        + 4242171053/1099511627776 * eps^25
+        + 61534748221/17592186044416 * eps^27
+        + 112374407161/35184372088832 * eps^29;
+C2[2] = + 3/16 * eps^2
+        + 1/32 * eps^4
+        + 35/2048 * eps^6
+        + 47/4096 * eps^8
+        + 557/65536 * eps^10
+        + 875/131072 * eps^12
+        + 365987/67108864 * eps^14
+        + 615099/134217728 * eps^16
+        + 8448195/2147483648 * eps^18
+        + 14747697/4294967296 * eps^20
+        + 1669842701/549755813888 * eps^22
+        + 2986894505/1099511627776 * eps^24
+        + 43136495023/17592186044416 * eps^26
+        + 78481301201/35184372088832 * eps^28
+        + 294392827406755/144115188075855872 * eps^30;
+C2[3] = + 5/48 * eps^3
+        + 5/256 * eps^5
+        + 23/2048 * eps^7
+        + 191/24576 * eps^9
+        + 385/65536 * eps^11
+        + 39277/8388608 * eps^13
+        + 778613/201326592 * eps^15
+        + 879927/268435456 * eps^17
+        + 6084639/2147483648 * eps^19
+        + 512739193/206158430208 * eps^21
+        + 1215236729/549755813888 * eps^23
+        + 4364918719/2199023255552 * eps^25
+        + 94882584065/52776558133248 * eps^27
+        + 29549676515117/18014398509481984 * eps^29;
+C2[4] = + 35/512 * eps^4
+        + 7/512 * eps^6
+        + 133/16384 * eps^8
+        + 47/8192 * eps^10
+        + 73859/16777216 * eps^12
+        + 59533/16777216 * eps^14
+        + 1587387/536870912 * eps^16
+        + 169365/67108864 * eps^18
+        + 301539693/137438953472 * eps^20
+        + 265958173/137438953472 * eps^22
+        + 7594835095/4398046511104 * eps^24
+        + 3421780579/2199023255552 * eps^26
+        + 50930607972739/36028797018963968 * eps^28
+        + 46591933629593/36028797018963968 * eps^30;
+C2[5] = + 63/1280 * eps^5
+        + 21/2048 * eps^7
+        + 51/8192 * eps^9
+        + 2343/524288 * eps^11
+        + 29099/8388608 * eps^13
+        + 946609/335544320 * eps^15
+        + 635521/268435456 * eps^17
+        + 8729875/4294967296 * eps^19
+        + 122017589/68719476736 * eps^21
+        + 864489227/549755813888 * eps^23
+        + 15483449661/10995116277760 * eps^25
+        + 1433014740399/1125899906842624 * eps^27
+        + 20884832418219/18014398509481984 * eps^29;
+C2[6] = + 77/2048 * eps^6
+        + 33/4096 * eps^8
+        + 2607/524288 * eps^10
+        + 11363/3145728 * eps^12
+        + 189893/67108864 * eps^14
+        + 311117/134217728 * eps^16
+        + 25213345/12884901888 * eps^18
+        + 14502017/8589934592 * eps^20
+        + 814144243/549755813888 * eps^22
+        + 4341484325/3298534883328 * eps^24
+        + 1331147570487/1125899906842624 * eps^26
+        + 2412694071441/2251799813685248 * eps^28
+        + 422949801695839/432345564227567616 * eps^30;
+C2[7] = + 429/14336 * eps^7
+        + 429/65536 * eps^9
+        + 2145/524288 * eps^11
+        + 1573/524288 * eps^13
+        + 158899/67108864 * eps^15
+        + 1047631/536870912 * eps^17
+        + 7110437/4294967296 * eps^19
+        + 86245121/60129542144 * eps^21
+        + 694168021/549755813888 * eps^23
+        + 158428784829/140737488355328 * eps^25
+        + 1141580229945/1125899906842624 * eps^27
+        + 518508038199/562949953421312 * eps^29;
+C2[8] = + 6435/262144 * eps^8
+        + 715/131072 * eps^10
+        + 14443/4194304 * eps^12
+        + 10673/4194304 * eps^14
+        + 4339205/2147483648 * eps^16
+        + 898561/536870912 * eps^18
+        + 24498667/17179869184 * eps^20
+        + 21302303/17179869184 * eps^22
+        + 616428279683/562949953421312 * eps^24
+        + 275528165297/281474976710656 * eps^26
+        + 7960491282361/9007199254740992 * eps^28
+        + 7246735300607/9007199254740992 * eps^30;
+C2[9] = + 12155/589824 * eps^9
+        + 2431/524288 * eps^11
+        + 1547/524288 * eps^13
+        + 441779/201326592 * eps^15
+        + 940321/536870912 * eps^17
+        + 6258091/4294967296 * eps^19
+        + 32109515/25769803776 * eps^21
+        + 4780137299/4398046511104 * eps^23
+        + 135454151123/140737488355328 * eps^25
+        + 8739550412095/10133099161583616 * eps^27
+        + 439310252633/562949953421312 * eps^29;
+C2[10] = + 46189/2621440 * eps^10
+        + 4199/1048576 * eps^12
+        + 172159/67108864 * eps^14
+        + 257431/134217728 * eps^16
+        + 6604381/4294967296 * eps^18
+        + 55148051/42949672960 * eps^20
+        + 4844658589/4398046511104 * eps^22
+        + 8475408793/8796093022208 * eps^24
+        + 963016659745/1125899906842624 * eps^26
+        + 1729685026007/2251799813685248 * eps^28
+        + 100354915132471/144115188075855872 * eps^30;
+C2[11] = + 88179/5767168 * eps^11
+        + 29393/8388608 * eps^13
+        + 151487/67108864 * eps^15
+        + 455107/268435456 * eps^17
+        + 5860189/4294967296 * eps^19
+        + 628398115/549755813888 * eps^21
+        + 4324974541/4398046511104 * eps^23
+        + 15169948479/17592186044416 * eps^25
+        + 863724574545/1125899906842624 * eps^27
+        + 12434905703529/18014398509481984 * eps^29;
+C2[12] = + 676039/50331648 * eps^12
+        + 52003/16777216 * eps^14
+        + 1077205/536870912 * eps^16
+        + 304589/201326592 * eps^18
+        + 1343185487/1099511627776 * eps^20
+        + 1128482143/1099511627776 * eps^22
+        + 93435460751/105553116266496 * eps^24
+        + 13685462553/17592186044416 * eps^26
+        + 24983462965221/36028797018963968 * eps^28
+        + 67559103579581/108086391056891904 * eps^30;
+C2[13] = + 1300075/109051904 * eps^13
+        + 185725/67108864 * eps^15
+        + 482885/268435456 * eps^17
+        + 46765555/34359738368 * eps^19
+        + 605955125/549755813888 * eps^21
+        + 4083133535/4398046511104 * eps^23
+        + 14117902665/17592186044416 * eps^25
+        + 776981055/1099511627776 * eps^27
+        + 11367459987135/18014398509481984 * eps^29;
+C2[14] = + 5014575/469762048 * eps^14
+        + 334305/134217728 * eps^16
+        + 55828935/34359738368 * eps^18
+        + 84736485/68719476736 * eps^20
+        + 4403236035/4398046511104 * eps^22
+        + 7434490215/8796093022208 * eps^24
+        + 12878639895/17592186044416 * eps^26
+        + 79525490115/123145302310912 * eps^28
+        + 83239672976625/144115188075855872 * eps^30;
+C2[15] = + 646323/67108864 * eps^15
+        + 9694845/4294967296 * eps^17
+        + 50755365/34359738368 * eps^19
+        + 77241935/68719476736 * eps^21
+        + 4023100545/4398046511104 * eps^23
+        + 13613065131/17592186044416 * eps^25
+        + 738265615/1099511627776 * eps^27
+        + 166992644595/281474976710656 * eps^29;
+C2[16] = + 300540195/34359738368 * eps^16
+        + 17678835/8589934592 * eps^18
+        + 371255535/274877906944 * eps^20
+        + 283171515/274877906944 * eps^22
+        + 118236358635/140737488355328 * eps^24
+        + 50102128545/70368744177664 * eps^26
+        + 1393471517565/2251799813685248 * eps^28
+        + 1233068062875/2251799813685248 * eps^30;
+C2[17] = + 583401555/73014444032 * eps^17
+        + 64822395/34359738368 * eps^19
+        + 85292625/68719476736 * eps^21
+        + 4172515215/4398046511104 * eps^23
+        + 13636584885/17592186044416 * eps^25
+        + 2894056305/4398046511104 * eps^27
+        + 161224515885/281474976710656 * eps^29;
+C2[18] = + 756261275/103079215104 * eps^18
+        + 119409675/68719476736 * eps^20
+        + 5039088285/4398046511104 * eps^22
+        + 7718413945/8796093022208 * eps^24
+        + 12634163925/17592186044416 * eps^26
+        + 10741625085/17592186044416 * eps^28
+        + 76701028811195/144115188075855872 * eps^30;
+C2[19] = + 4418157975/652835028992 * eps^19
+        + 883631595/549755813888 * eps^21
+        + 4670624145/4398046511104 * eps^23
+        + 14333193015/17592186044416 * eps^25
+        + 2937289215/4398046511104 * eps^27
+        + 10243215614805/18014398509481984 * eps^29;
+C2[20] = + 6892326441/1099511627776 * eps^20
+        + 1641030105/1099511627776 * eps^22
+        + 34760001315/35184372088832 * eps^24
+        + 13355260815/17592186044416 * eps^26
+        + 22452476602335/36028797018963968 * eps^28
+        + 95701981543233/180143985094819840 * eps^30;
+C2[21] = + 22427411435/3848290697216 * eps^21
+        + 6116566755/4398046511104 * eps^23
+        + 16222198785/17592186044416 * eps^25
+        + 798965451635/1125899906842624 * eps^27
+        + 10507463872035/18014398509481984 * eps^29;
+C2[22] = + 263012370465/48378511622144 * eps^22
+        + 11435320455/8796093022208 * eps^24
+        + 972002238675/1125899906842624 * eps^26
+        + 1498026979605/2251799813685248 * eps^28
+        + 78899312939325/144115188075855872 * eps^30;
+C2[23] = + 514589420475/101155069755392 * eps^23
+        + 171529806825/140737488355328 * eps^25
+        + 912538572309/1125899906842624 * eps^27
+        + 352031942007/562949953421312 * eps^29;
+C2[24] = + 2687300306925/562949953421312 * eps^24
+        + 322476036831/281474976710656 * eps^26
+        + 6871220169399/9007199254740992 * eps^28
+        + 15922598844211/27021597764222976 * eps^30;
+C2[25] = + 15801325804719/3518437208883200 * eps^25
+        + 1215486600363/1125899906842624 * eps^27
+        + 405162200121/562949953421312 * eps^29;
+C2[26] = + 61989816618513/14636698788954112 * eps^26
+        + 2295919134019/2251799813685248 * eps^28
+        + 98068545867383/144115188075855872 * eps^30;
+C2[27] = + 121683714103007/30399297484750848 * eps^27
+        + 17383387729001/18014398509481984 * eps^29;
+C2[28] = + 136583760727865/36028797018963968 * eps^28
+        + 32968493968795/36028797018963968 * eps^30;
+C2[29] = + 1879204156221315/522417556774977536 * eps^29;
+C2[30] = + 7391536347803839/2161727821137838080 * eps^30;
+
+A3 = 1 - (1/2 - 1/2*n) * eps
+       - (1/4 + 1/8*n - 3/8*n^2) * eps^2
+       - (1/16 + 3/16*n + 1/16*n^2 - 5/16*n^3) * eps^3
+       - (3/64 + 1/32*n + 5/32*n^2 + 5/128*n^3 - 35/128*n^4) * eps^4
+       - (3/128 + 5/128*n + 5/256*n^2 + 35/256*n^3 + 7/256*n^4 - 63/256*n^5) * eps^5
+       - (5/256 + 15/1024*n + 35/1024*n^2 + 7/512*n^3 + 63/512*n^4 + 21/1024*n^5 - 231/1024*n^6) * eps^6
+       - (25/2048 + 35/2048*n + 21/2048*n^2 + 63/2048*n^3 + 21/2048*n^4 + 231/2048*n^5 + 33/2048*n^6 - 429/2048*n^7) * eps^7
+       - (175/16384 + 35/4096*n + 63/4096*n^2 + 63/8192*n^3 + 231/8192*n^4 + 33/4096*n^5 + 429/4096*n^6 + 429/32768*n^7 - 6435/32768*n^8) * eps^8
+       - (245/32768 + 315/32768*n + 105/16384*n^2 + 231/16384*n^3 + 99/16384*n^4 + 429/16384*n^5 + 429/65536*n^6 + 6435/65536*n^7 + 715/65536*n^8 - 12155/65536*n^9) * eps^9
+       - (441/65536 + 735/131072*n + 1155/131072*n^2 + 165/32768*n^3 + 429/32768*n^4 + 1287/262144*n^5 + 6435/262144*n^6 + 715/131072*n^7 + 12155/131072*n^8 + 2431/262144*n^9 - 46189/262144*n^10) * eps^10
+       - (1323/262144 + 1617/262144*n + 1155/262144*n^2 + 2145/262144*n^3 + 2145/524288*n^4 + 6435/524288*n^5 + 2145/524288*n^6 + 12155/524288*n^7 + 2431/524288*n^8 + 46189/524288*n^9 + 4199/524288*n^10 - 88179/524288*n^11) * eps^11
+       - (4851/1048576 + 2079/524288*n + 3003/524288*n^2 + 15015/4194304*n^3 + 32175/4194304*n^4 + 3575/1048576*n^5 + 12155/1048576*n^6 + 7293/2097152*n^7 + 46189/2097152*n^8 + 4199/1048576*n^9 + 88179/1048576*n^10 + 29393/4194304*n^11 - 676039/4194304*n^12) * eps^12
+       - (7623/2097152 + 9009/2097152*n + 27027/8388608*n^2 + 45045/8388608*n^3 + 25025/8388608*n^4 + 60775/8388608*n^5 + 12155/4194304*n^6 + 46189/4194304*n^7 + 12597/4194304*n^8 + 88179/4194304*n^9 + 29393/8388608*n^10 + 676039/8388608*n^11 + 52003/8388608*n^12 - 1300075/8388608*n^13) * eps^13
+       - (14157/4194304 + 99099/33554432*n + 135135/33554432*n^2 + 45045/16777216*n^3 + 85085/16777216*n^4 + 85085/33554432*n^5 + 230945/33554432*n^6 + 20995/8388608*n^7 + 88179/8388608*n^8 + 88179/33554432*n^9 + 676039/33554432*n^10 + 52003/16777216*n^11 + 1300075/16777216*n^12 + 185725/33554432*n^13 - 5014575/33554432*n^14) * eps^14
+       - (184041/67108864 + 212355/67108864*n + 165165/67108864*n^2 + 255255/67108864*n^3 + 153153/67108864*n^4 + 323323/67108864*n^5 + 146965/67108864*n^6 + 440895/67108864*n^7 + 146965/67108864*n^8 + 676039/67108864*n^9 + 156009/67108864*n^10 + 1300075/67108864*n^11 + 185725/67108864*n^12 + 5014575/67108864*n^13 + 334305/67108864*n^14) * eps^15
+       - (2760615/1073741824 + 306735/134217728*n + 401115/134217728*n^2 + 561561/268435456*n^3 + 969969/268435456*n^4 + 264537/134217728*n^5 + 617253/134217728*n^6 + 1028755/536870912*n^7 + 3380195/536870912*n^8 + 260015/134217728*n^9 + 1300075/134217728*n^10 + 557175/268435456*n^11 + 5014575/268435456*n^12 + 334305/134217728*n^13) * eps^16
+       - (4601025/2147483648 + 5214495/2147483648*n + 1042899/536870912*n^2 + 1524237/536870912*n^3 + 969969/536870912*n^4 + 1851759/536870912*n^5 + 1851759/1073741824*n^6 + 4732273/1073741824*n^7 + 1820105/1073741824*n^8 + 6500375/1073741824*n^9 + 928625/536870912*n^10 + 5014575/536870912*n^11 + 1002915/536870912*n^12) * eps^17
+       - (8690825/4294967296 + 15643485/8589934592*n + 19815081/8589934592*n^2 + 1801371/1073741824*n^3 + 2909907/1073741824*n^4 + 6789783/4294967296*n^5 + 14196819/4294967296*n^6 + 3276189/2147483648*n^7 + 9100525/2147483648*n^8 + 6500375/4294967296*n^9 + 25072875/4294967296*n^10 + 1671525/1073741824*n^11) * eps^18
+       - (29548805/17179869184 + 33025135/17179869184*n + 27020565/17179869184*n^2 + 37828791/17179869184*n^3 + 12609597/8589934592*n^4 + 22309287/8589934592*n^5 + 12012693/8589934592*n^6 + 27301575/8589934592*n^7 + 11700675/8589934592*n^8 + 35102025/8589934592*n^9 + 11700675/8589934592*n^10) * eps^19
+       - (112285459/68719476736 + 51038845/34359738368*n + 63047985/34359738368*n^2 + 189143955/137438953472*n^3 + 290020731/137438953472*n^4 + 22309287/17179869184*n^5 + 42902475/17179869184*n^6 + 42902475/34359738368*n^7 + 105306075/34359738368*n^8 + 21061215/17179869184*n^9) * eps^20
+       - (193947611/137438953472 + 214363149/137438953472*n + 357271915/274877906944*n^2 + 483367885/274877906944*n^3 + 334639305/274877906944*n^4 + 557732175/274877906944*n^5 + 79676025/68719476736*n^6 + 165480975/68719476736*n^7 + 77224455/68719476736*n^8) * eps^21
+       - (370263621/274877906944 + 1357633277/1099511627776*n + 1643450809/1099511627776*n^2 + 632096465/549755813888*n^3 + 929553625/549755813888*n^4 + 1195140375/1099511627776*n^5 + 2151252675/1099511627776*n^6 + 143416845/137438953472*n^7) * eps^22
+       - (2591845347/2199023255552 + 2838687761/2199023255552*n + 2401966567/2199023255552*n^2 + 3160482325/2199023255552*n^3 + 2257487375/2199023255552*n^4 + 3585421125/2199023255552*n^5 + 2151252675/2199023255552*n^6) * eps^23
+       - (19870814327/17592186044416 + 4585572537/4398046511104*n + 5459014925/4398046511104*n^2 + 8578452025/8796093022208*n^3 + 12190431825/8796093022208*n^4 + 4063477275/4398046511104*n^5) * eps^24
+       - (35156056117/35184372088832 + 38213104475/35184372088832*n + 16377044775/17592186044416*n^2 + 21056200425/17592186044416*n^3 + 15441213645/17592186044416*n^4) * eps^25
+       - (67607800225/70368744177664 + 125557343275/140737488355328*n + 147393402975/140737488355328*n^2 + 29478680595/35184372088832*n^3) * eps^26
+       - (241456429375/281474976710656 + 260772943725/281474976710656*n + 226003217895/281474976710656*n^2) * eps^27
+       - (931331941875/1125899906842624 + 434621572875/562949953421312*n) * eps^28
+       - 1676397495375/2251799813685248 * eps^29;
+
+C3[1] = + (1/4 - 1/4*n) * eps
+        + (1/8 - 1/8*n^2) * eps^2
+        + (3/64 + 3/64*n - 1/64*n^2 - 5/64*n^3) * eps^3
+        + (5/128 + 1/64*n + 1/64*n^2 - 1/64*n^3 - 7/128*n^4) * eps^4
+        + (3/128 + 11/512*n + 3/512*n^2 + 1/256*n^3 - 7/512*n^4 - 21/512*n^5) * eps^5
+        + (21/1024 + 5/512*n + 13/1024*n^2 + 1/512*n^3 - 1/1024*n^4 - 3/256*n^5 - 33/1024*n^6) * eps^6
+        + (243/16384 + 189/16384*n + 83/16384*n^2 + 127/16384*n^3 + 3/16384*n^4 - 51/16384*n^5 - 165/16384*n^6 - 429/16384*n^7) * eps^7
+        + (435/32768 + 109/16384*n + 1/128*n^2 + 45/16384*n^3 + 39/8192*n^4 - 11/16384*n^5 - 33/8192*n^6 - 143/16384*n^7 - 715/32768*n^8) * eps^8
+        + (345/32768 + 953/131072*n + 259/65536*n^2 + 365/65536*n^3 + 95/65536*n^4 + 47/16384*n^5 - 143/131072*n^6 - 143/32768*n^7 - 1001/131072*n^8 - 2431/131072*n^9) * eps^9
+        + (2511/262144 + 317/65536*n + 1355/262144*n^2 + 165/65536*n^3 + 531/131072*n^4 + 89/131072*n^5 + 107/65536*n^6 - 169/131072*n^7 - 1157/262144*n^8 - 221/32768*n^9 - 4199/262144*n^10) * eps^10
+        + (8401/1048576 + 5327/1048576*n + 807/262144*n^2 + 8243/2097152*n^3 + 3415/2097152*n^4 + 6235/2097152*n^5 + 429/2097152*n^6 + 845/1048576*n^7 - 2873/2097152*n^8 - 9061/2097152*n^9 - 12597/2097152*n^10 - 29393/2097152*n^11) * eps^11
+        + (15477/2097152 + 969/262144*n + 15445/4194304*n^2 + 2237/1048576*n^3 + 6429/2097152*n^4 + 2183/2097152*n^5 + 9169/4194304*n^6 - 197/2097152*n^7 + 1019/4194304*n^8 - 2907/2097152*n^9 - 8721/2097152*n^10 - 11305/2097152*n^11 - 52003/4194304*n^12) * eps^12
+        + (26789/4194304 + 63733/16777216*n + 40995/16777216*n^2 + 1517/524288*n^3 + 25475/16777216*n^4 + 40625/16777216*n^5 + 5365/8388608*n^6 + 839/524288*n^7 - 595/2097152*n^8 - 2431/16777216*n^9 - 22933/16777216*n^10 - 33269/8388608*n^11 - 81719/16777216*n^12 - 185725/16777216*n^13) * eps^13
+        + (199327/33554432 + 49237/16777216*n + 93101/33554432*n^2 + 29853/16777216*n^3 + 78579/33554432*n^4 + 285/262144*n^5 + 64637/33554432*n^6 + 3015/8388608*n^7 + 38843/33554432*n^8 - 6783/16777216*n^9 - 13889/33554432*n^10 - 22287/16777216*n^11 - 126293/33554432*n^12 - 37145/8388608*n^13 - 334305/33554432*n^14) * eps^14
+        + (5651931/1073741824 + 3197305/1073741824*n + 2129255/1073741824*n^2 + 2385073/1073741824*n^3 + 1438067/1073741824*n^4 + 2065081/1073741824*n^5 + 830627/1073741824*n^6 + 1651687/1073741824*n^7 + 172907/1073741824*n^8 + 879393/1073741824*n^9 - 515185/1073741824*n^10 - 645031/1073741824*n^11 - 1374365/1073741824*n^12 - 3825935/1073741824*n^13 - 4345965/1073741824*n^14) * eps^15
+        + (10594535/2147483648 + 2577049/1073741824*n + 2340339/1073741824*n^2 + 1599809/1073741824*n^3 + 1974139/1073741824*n^4 + 1095805/1073741824*n^5 + 855347/536870912*n^6 + 580477/1073741824*n^7 + 330109/268435456*n^8 + 20577/1073741824*n^9 + 598443/1073741824*n^10 - 564167/1073741824*n^11 - 783541/1073741824*n^12 - 1317555/1073741824*n^13) * eps^16
+        + (9550675/2147483648 + 20752127/8589934592*n + 7056899/4294967296*n^2 + 7580255/4294967296*n^3 + 4992507/4294967296*n^4 + 3321125/2147483648*n^5 + 3349163/4294967296*n^6 + 5700229/4294967296*n^7 + 1567945/4294967296*n^8 + 263547/268435456*n^9 - 355965/4294967296*n^10 + 1518119/4294967296*n^11 - 2366355/4294967296*n^12) * eps^17
+        + (72058593/17179869184 + 8629549/4294967296*n + 30360645/17179869184*n^2 + 5413229/4294967296*n^3 + 12734831/8589934592*n^4 + 3957093/4294967296*n^5 + 11280727/8589934592*n^6 + 2549757/4294967296*n^7 + 9531415/8589934592*n^8 + 993989/4294967296*n^9 + 6705875/8589934592*n^10 - 671807/4294967296*n^11) * eps^18
+        + (263253385/68719476736 + 138258975/68719476736*n + 23816915/17179869184*n^2 + 198093717/137438953472*n^3 + 69240987/68719476736*n^4 + 87088843/68719476736*n^5 + 50514007/68719476736*n^6 + 77115649/68719476736*n^7 + 30761115/68719476736*n^8 + 63886991/68719476736*n^9 + 8860067/68719476736*n^10) * eps^19
+        + (499116509/137438953472 + 29445517/17179869184*n + 403691887/274877906944*n^2 + 37063307/34359738368*n^3 + 336216217/274877906944*n^4 + 56373745/68719476736*n^5 + 9400419/8589934592*n^6 + 40361177/68719476736*n^7 + 4136725/4294967296*n^8 + 22806365/68719476736*n^9) * eps^20
+        + (921106197/274877906944 + 1880398291/1099511627776*n + 326574877/274877906944*n^2 + 661516723/549755813888*n^3 + 482354011/549755813888*n^4 + 1162954687/1099511627776*n^5 + 185209863/274877906944*n^6 + 261495221/274877906944*n^7 + 64353371/137438953472*n^8) * eps^21
+        + (7015755337/2199023255552 + 408123935/274877906944*n + 2737209361/2199023255552*n^2 + 128335869/137438953472*n^3 + 2262026963/2199023255552*n^4 + 100083329/137438953472*n^5 + 2032983351/2199023255552*n^6 + 152722157/274877906944*n^7) * eps^22
+        + (52217815849/17592186044416 + 25998927035/17592186044416*n + 18152051013/17592186044416*n^2 + 17993187773/17592186044416*n^3 + 13531950573/17592186044416*n^4 + 15783055573/17592186044416*n^5 + 1342789487/2199023255552*n^6) * eps^23
+        + (99797592861/35184372088832 + 22918110427/17592186044416*n + 9429859753/8796093022208*n^2 + 14370219019/17592186044416*n^3 + 15464224607/17592186044416*n^4 + 5696035625/8796093022208*n^5) * eps^24
+        + (93477766213/35184372088832 + 182178015931/140737488355328*n + 63784112813/70368744177664*n^2 + 15523581719/17592186044416*n^3 + 47802611279/70368744177664*n^4) * eps^25
+        + (716876091533/281474976710656 + 81306684531/70368744177664*n + 263375014467/281474976710656*n^2 + 50762313771/70368744177664*n^3) * eps^26
+        + (2701098070323/1125899906842624 + 1291014428313/1125899906842624*n + 905405918351/1125899906842624*n^2) * eps^27
+        + (5192918413211/2251799813685248 + 1164465998161/1125899906842624*n) * eps^28
+        + 4914956648311/2251799813685248 * eps^29;
+C3[2] = + (1/16 - 3/32*n + 1/32*n^2) * eps^2
+        + (3/64 - 1/32*n - 3/64*n^2 + 1/32*n^3) * eps^3
+        + (3/128 + 1/128*n - 9/256*n^2 - 3/128*n^3 + 7/256*n^4) * eps^4
+        + (5/256 + 1/256*n - 1/128*n^2 - 7/256*n^3 - 3/256*n^4 + 3/128*n^5) * eps^5
+        + (27/2048 + 69/8192*n - 39/8192*n^2 - 47/4096*n^3 - 41/2048*n^4 - 45/8192*n^5 + 165/8192*n^6) * eps^6
+        + (187/16384 + 39/8192*n + 31/16384*n^2 - 63/8192*n^3 - 185/16384*n^4 - 119/8192*n^5 - 33/16384*n^6 + 143/8192*n^7) * eps^7
+        + (287/32768 + 47/8192*n + 31/65536*n^2 - 3/2048*n^3 - 537/65536*n^4 - 41/4096*n^5 - 693/65536*n^6 + 1001/65536*n^8) * eps^8
+        + (255/32768 + 249/65536*n + 43/16384*n^2 - 119/65536*n^3 - 25/8192*n^4 - 507/65536*n^5 - 35/4096*n^6 - 507/65536*n^7 + 39/32768*n^8 + 221/16384*n^9) * eps^9
+        + (1675/262144 + 2127/524288*n + 753/524288*n^2 + 357/524288*n^3 - 3109/1048576*n^4 - 3873/1048576*n^5 - 1821/262144*n^6 - 1885/262144*n^7 - 2977/524288*n^8 + 1989/1048576*n^9 + 12597/1048576*n^10) * eps^10
+        + (6065/1048576 + 1551/524288*n + 75/32768*n^2 - 5/262144*n^3 - 1085/2097152*n^4 - 1815/524288*n^5 - 8057/2097152*n^6 - 1597/262144*n^7 - 12633/2097152*n^8 - 4369/1048576*n^9 + 4845/2097152*n^10 + 11305/1048576*n^11) * eps^11
+        + (10377/2097152 + 1585/524288*n + 12521/8388608*n^2 + 73/65536*n^3 - 7799/8388608*n^4 - 645/524288*n^5 - 1883/524288*n^6 - 7843/2097152*n^7 - 2769/524288*n^8 - 21165/4194304*n^9 - 25517/8388608*n^10 + 10659/4194304*n^11 + 81719/8388608*n^12) * eps^12
+        + (2381/524288 + 19679/8388608*n + 3951/2097152*n^2 + 4591/8388608*n^3 + 1267/4194304*n^4 - 6211/4194304*n^5 - 6839/4194304*n^6 - 3691/1048576*n^7 - 29513/8388608*n^8 - 38199/8388608*n^9 - 17765/4194304*n^10 - 18411/8388608*n^11 + 22287/8388608*n^12 + 37145/4194304*n^13) * eps^13
+        + (267955/67108864 + 1262293/536870912*n + 723929/536870912*n^2 + 300995/268435456*n^3 - 28407/268435456*n^4 - 136037/536870912*n^5 - 962677/536870912*n^6 - 122923/67108864*n^7 - 897497/268435456*n^8 - 1743367/536870912*n^9 - 2103053/536870912*n^10 - 957049/268435456*n^11 - 52003/33554432*n^12 + 1448655/536870912*n^13 + 4345965/536870912*n^14) * eps^14
+        + (3976491/1073741824 + 1022503/536870912*n + 1663043/1073741824*n^2 + 377461/536870912*n^3 + 604683/1073741824*n^4 - 298493/536870912*n^5 - 671633/1073741824*n^6 - 1045847/536870912*n^7 - 2047913/1073741824*n^8 - 1673607/536870912*n^9 - 3182937/1073741824*n^10 - 1808097/536870912*n^11 - 3232489/1073741824*n^12 - 565915/536870912*n^13 + 2890755/1073741824*n^14) * eps^15
+        + (7129743/2147483648 + 1015025/536870912*n + 5052845/4294967296*n^2 + 1096857/1073741824*n^3 + 1006901/4294967296*n^4 + 10157/67108864*n^5 - 3691453/4294967296*n^6 - 232785/268435456*n^7 - 8591613/4294967296*n^8 - 2045245/1073741824*n^9 - 12341583/4294967296*n^10 - 1443525/536870912*n^11 - 12440079/4294967296*n^12 - 2737805/1073741824*n^13) * eps^16
+        + (6667727/2147483648 + 6786587/4294967296*n + 2765703/2147483648*n^2 + 3065499/4294967296*n^3 + 1341327/2147483648*n^4 - 481047/4294967296*n^5 - 80463/536870912*n^6 - 4538443/4294967296*n^7 - 2183311/2147483648*n^8 - 8533921/4294967296*n^9 - 3983383/2147483648*n^10 - 11294905/4294967296*n^11 - 5218401/2147483648*n^12) * eps^17
+        + (48519273/17179869184 + 53624999/34359738368*n + 35043145/34359738368*n^2 + 31055675/34359738368*n^3 + 25399201/68719476736*n^4 + 10932099/34359738368*n^5 - 25183979/68719476736*n^6 - 12612269/34359738368*n^7 - 80897803/68719476736*n^8 - 37844017/34359738368*n^9 - 132790935/68719476736*n^10 - 61071857/34359738368*n^11) * eps^18
+        + (182709161/68719476736 + 45893303/34359738368*n + 37309115/34359738368*n^2 + 2893075/4294967296*n^3 + 21013705/34359738368*n^4 + 7175491/68719476736*n^5 + 2804597/34359738368*n^6 - 37828469/68719476736*n^7 - 17888297/34359738368*n^8 - 85404217/68719476736*n^9 - 39202063/34359738368*n^10) * eps^19
+        + (336130837/137438953472 + 180823959/137438953472*n + 487608355/549755813888*n^2 + 218243165/274877906944*n^3 + 227499107/549755813888*n^4 + 104333133/274877906944*n^5 - 13837431/137438953472*n^6 - 27388031/274877906944*n^7 - 93516413/137438953472*n^8 - 172126779/274877906944*n^9) * eps^20
+        + (636339537/274877906944 + 630601557/549755813888*n + 510119863/549755813888*n^2 + 339882125/549755813888*n^3 + 157181907/274877906944*n^4 + 57322697/274877906944*n^5 + 53319741/274877906944*n^6 - 35494201/137438953472*n^7 - 65167699/274877906944*n^8) * eps^21
+        + (4724647749/2199023255552 + 9924101863/8796093022208*n + 6828890391/8796093022208*n^2 + 3070661829/4398046511104*n^3 + 229152657/549755813888*n^4 + 3452592737/8796093022208*n^5 + 390195853/8796093022208*n^6 + 403726013/8796093022208*n^7) * eps^22
+        + (35940468233/17592186044416 + 8781999081/8796093022208*n + 14121810537/17592186044416*n^2 + 4938417863/8796093022208*n^3 + 9227803497/17592186044416*n^4 + 2245716697/8796093022208*n^5 + 2160045085/8796093022208*n^6) * eps^23
+        + (67197451821/35184372088832 + 8631642763/8796093022208*n + 48175476253/70368744177664*n^2 + 5424112681/8796093022208*n^3 + 28247205103/70368744177664*n^4 + 421237869/1099511627776*n^5) * eps^24
+        + (64142976365/35184372088832 + 61855152171/70368744177664*n + 385976459/549755813888*n^2 + 35768834103/70368744177664*n^3 + 16801928753/35184372088832*n^4) * eps^25
+        + (482598495517/281474976710656 + 486224128685/562949953421312*n + 342398306855/562949953421312*n^2 + 2408805385/4398046511104*n^3) * eps^26
+        + (1848743160243/1125899906842624 + 439979250473/562949953421312*n + 698099481901/1125899906842624*n^2) * eps^27
+        + (3494999262339/2251799813685248 + 1729207092437/2251799813685248*n) * eps^28
+        + 6713540223121/4503599627370496 * eps^29;
+C3[3] = + (5/192 - 3/64*n + 5/192*n^2 - 1/192*n^3) * eps^3
+        + (3/128 - 5/192*n - 1/64*n^2 + 5/192*n^3 - 1/128*n^4) * eps^4
+        + (7/512 - 1/384*n - 77/3072*n^2 + 5/3072*n^3 + 65/3072*n^4 - 9/1024*n^5) * eps^5
+        + (3/256 - 1/1024*n - 71/6144*n^2 - 47/3072*n^3 + 9/1024*n^4 + 25/1536*n^5 - 55/6144*n^6) * eps^6
+        + (139/16384 + 143/49152*n - 383/49152*n^2 - 179/16384*n^3 - 121/16384*n^4 + 547/49152*n^5 + 605/49152*n^6 - 143/16384*n^7) * eps^7
+        + (243/32768 + 95/49152*n - 41/16384*n^2 - 147/16384*n^3 - 389/49152*n^4 - 109/49152*n^5 + 557/49152*n^6 + 455/49152*n^7 - 273/32768*n^8) * eps^8
+        + (581/98304 + 377/131072*n - 33/16384*n^2 - 907/196608*n^3 - 515/65536*n^4 - 1937/393216*n^5 + 89/98304*n^6 + 2093/196608*n^7 + 455/65536*n^8 - 1547/196608*n^9) * eps^9
+        + (1383/262144 + 103/49152*n - 17/262144*n^2 - 127/32768*n^3 - 3853/786432*n^4 - 25/4096*n^5 - 2011/786432*n^6 + 265/98304*n^7 + 1895/196608*n^8 + 85/16384*n^9 - 969/131072*n^10) * eps^10
+        + (4649/1048576 + 7447/3145728*n - 77/393216*n^2 - 3663/2097152*n^3 - 9285/2097152*n^4 - 27433/6291456*n^5 - 27545/6291456*n^6 - 2627/3145728*n^7 + 22993/6291456*n^8 + 17969/2097152*n^9 + 8075/2097152*n^10 - 14535/2097152*n^11) * eps^11
+        + (8439/2097152 + 241/131072*n + 7829/12582912*n^2 - 1667/1048576*n^3 - 5295/2097152*n^4 - 26867/6291456*n^5 - 14817/4194304*n^6 - 18287/6291456*n^7 + 1505/4194304*n^8 + 25823/6291456*n^9 + 15827/2097152*n^10 + 17765/6291456*n^11 - 81719/12582912*n^12) * eps^12
+        + (58663/16777216 + 48239/25165824*n + 81155/201326592*n^2 - 108067/201326592*n^3 - 467735/201326592*n^4 - 550477/201326592*n^5 - 380633/100663296*n^6 - 269125/100663296*n^7 - 174181/100663296*n^8 + 9707/8388608*n^9 + 854981/201326592*n^10 + 444125/67108864*n^11 + 408595/201326592*n^12 - 408595/67108864*n^13) * eps^13
+        + (53929/16777216 + 313117/201326592*n + 317377/402653184*n^2 - 114511/201326592*n^3 - 62369/50331648*n^4 - 21877/8388608*n^5 - 1055003/402653184*n^6 - 106461/33554432*n^7 - 381119/201326592*n^8 - 55243/67108864*n^9 + 672619/402653184*n^10 + 846887/201326592*n^11 + 1166353/201326592*n^12 + 142025/100663296*n^13 - 766935/134217728*n^14) * eps^14
+        + (9205697/3221225472 + 1685361/1073741824*n + 631247/1073741824*n^2 - 12349/1073741824*n^3 - 1279425/1073741824*n^4 - 1722535/1073741824*n^5 - 8411347/3221225472*n^6 - 7543081/3221225472*n^7 - 2745069/1073741824*n^8 - 1319223/1073741824*n^9 - 150233/1073741824*n^10 + 6386185/3221225472*n^11 + 4360823/1073741824*n^12 + 16332875/3221225472*n^13 + 994175/1073741824*n^14) * eps^15
+        + (5698375/2147483648 + 1411153/1073741824*n + 633185/805306368*n^2 - 312125/3221225472*n^3 - 906475/1610612736*n^4 - 4985293/3221225472*n^5 - 1865903/1073741824*n^6 - 2632335/1073741824*n^7 - 2142387/1073741824*n^8 - 2132439/1073741824*n^9 - 137693/201326592*n^10 + 1176251/3221225472*n^11 + 3469849/1610612736*n^12 + 12431155/3221225472*n^13) * eps^16
+        + (5151335/2147483648 + 11221815/8589934592*n + 4004635/6442450944*n^2 + 352181/1610612736*n^3 - 7504877/12884901888*n^4 - 23563667/25769803776*n^5 - 7348445/4294967296*n^6 - 924507/536870912*n^7 - 4740015/2147483648*n^8 - 14053273/8589934592*n^9 - 2388169/1610612736*n^10 - 1600145/6442450944*n^11 + 9427907/12884901888*n^12) * eps^17
+        + (38568657/17179869184 + 2405303/2147483648*n + 12559943/17179869184*n^2 + 101021/805306368*n^3 - 3473571/17179869184*n^4 - 11685365/12884901888*n^5 - 57369983/51539607552*n^6 - 22445501/12884901888*n^7 - 27767351/17179869184*n^8 - 776185/402653184*n^9 - 22223933/17179869184*n^10 - 6776669/6442450944*n^11) * eps^18
+        + (141238745/68719476736 + 227781229/206158430208*n + 15439981/25769803776*n^2 + 129846877/412316860416*n^3 - 17007629/68719476736*n^4 - 34417161/68719476736*n^5 - 227700493/206158430208*n^6 - 82496459/68719476736*n^7 - 347760895/206158430208*n^8 - 100402157/68719476736*n^9 - 338650721/206158430208*n^10) * eps^19
+        + (266070741/137438953472 + 24865997/25769803776*n + 546610979/824633720832*n^2 + 23564155/103079215104*n^3 - 1988681/274877906944*n^4 - 35689789/68719476736*n^5 - 18022529/25769803776*n^6 - 82884377/68719476736*n^7 - 62369083/51539607552*n^8 - 108501709/68719476736*n^9) * eps^20
+        + (1476084109/824633720832 + 1042422451/1099511627776*n + 1838348957/3298534883328*n^2 + 1148287217/3298534883328*n^3 - 65602265/1099511627776*n^4 - 25911799/103079215104*n^5 - 1166561623/1649267441664*n^6 - 450241025/549755813888*n^7 - 4082983123/3298534883328*n^8) * eps^21
+        + (3727307793/2199023255552 + 2771727475/3298534883328*n + 1965618587/3298534883328*n^2 + 299691921/1099511627776*n^3 + 648655007/6597069766656*n^4 - 232283647/824633720832*n^5 - 1414792807/3298534883328*n^6 - 1364945647/1649267441664*n^7) * eps^22
+        + (27791243081/17592186044416 + 43484270377/52776558133248*n + 8988365213/17592186044416*n^2 + 6177195751/17592186044416*n^3 + 821647265/17592186044416*n^4 - 5244741905/52776558133248*n^5 - 5898760729/13194139533312*n^6) * eps^23
+        + (52866931869/35184372088832 + 13002628835/17592186044416*n + 28235801693/52776558133248*n^2 + 15115493921/52776558133248*n^3 + 1357399595/8796093022208*n^4 - 1176448685/8796093022208*n^5) * eps^24
+        + (49596004877/35184372088832 + 101897209187/140737488355328*n + 16392942713/35184372088832*n^2 + 35874509113/105553116266496*n^3 + 11256301655/105553116266496*n^4) * eps^25
+        + (378812456237/281474976710656 + 23082024431/35184372088832*n + 406385867693/844424930131968*n^2 + 30062357575/105553116266496*n^3) * eps^26
+        + (4287844495145/3377699720527872 + 723291681375/1125899906842624*n + 477936436199/1125899906842624*n^2) * eps^27
+        + (2738088177221/2251799813685248 + 1982787518731/3377699720527872*n) * eps^28
+        + 41515375436483/36028797018963968 * eps^29;
+C3[4] = + (7/512 - 7/256*n + 5/256*n^2 - 7/1024*n^3 + 1/1024*n^4) * eps^4
+        + (7/512 - 5/256*n - 7/2048*n^2 + 9/512*n^3 - 21/2048*n^4 + 1/512*n^5) * eps^5
+        + (9/1024 - 43/8192*n - 129/8192*n^2 + 39/4096*n^3 + 91/8192*n^4 - 91/8192*n^5 + 11/4096*n^6) * eps^6
+        + (127/16384 - 23/8192*n - 165/16384*n^2 - 47/8192*n^3 + 213/16384*n^4 + 11/2048*n^5 - 175/16384*n^6 + 13/4096*n^7) * eps^7
+        + (193/32768 + 3/8192*n - 505/65536*n^2 - 227/32768*n^3 + 75/65536*n^4 + 801/65536*n^5 + 165/131072*n^6 - 637/65536*n^7 + 455/131072*n^8) * eps^8
+        + (171/32768 + 25/65536*n - 259/65536*n^2 - 471/65536*n^3 - 351/131072*n^4 + 605/131072*n^5 + 41/4096*n^6 - 189/131072*n^7 - 1127/131072*n^8 + 119/32768*n^9) * eps^9
+        + (1121/262144 + 339/262144*n - 801/262144*n^2 - 2525/524288*n^3 - 2519/524288*n^4 + 73/131072*n^5 + 1539/262144*n^6 + 1989/262144*n^7 - 1633/524288*n^8 - 3927/524288*n^9 + 969/262144*n^10) * eps^10
+        + (2017/524288 + 273/262144*n - 1467/1048576*n^2 - 277/65536*n^3 - 4123/1048576*n^4 - 153/65536*n^5 + 1331/524288*n^6 + 1549/262144*n^7 + 5677/1048576*n^8 - 1071/262144*n^9 - 6783/1048576*n^10 + 969/262144*n^11) * eps^11
+        + (55215/16777216 + 11307/8388608*n - 2363/2097152*n^2 - 177843/67108864*n^3 - 268499/67108864*n^4 - 41907/16777216*n^5 - 6403/16777216*n^6 + 118801/33554432*n^7 + 179785/33554432*n^8 + 30345/8388608*n^9 - 154071/33554432*n^10 - 373065/67108864*n^11 + 245157/67108864*n^12) * eps^12
+        + (50365/16777216 + 2327/2097152*n - 47759/134217728*n^2 - 76829/33554432*n^3 - 383837/134217728*n^4 - 105473/33554432*n^5 - 74037/67108864*n^6 + 16197/16777216*n^7 + 260819/67108864*n^8 + 153431/33554432*n^9 + 294443/134217728*n^10 - 80465/16777216*n^11 - 639331/134217728*n^12 + 120175/33554432*n^13) * eps^13
+        + (2769/1048576 + 654529/536870912*n - 163129/536870912*n^2 - 372645/268435456*n^3 - 1430285/536870912*n^4 - 1335009/536870912*n^5 - 284489/134217728*n^6 + 987/33554432*n^7 + 482449/268435456*n^8 + 2057345/536870912*n^9 + 2007901/536870912*n^10 + 293645/268435456*n^11 - 2581359/536870912*n^12 - 2187185/536870912*n^13 + 937365/268435456*n^14) * eps^14
+        + (2615571/1073741824 + 552353/536870912*n + 90895/1073741824*n^2 - 652503/536870912*n^3 - 1983405/1073741824*n^4 - 680875/268435456*n^5 - 2001037/1073741824*n^6 - 156103/134217728*n^7 + 920027/1073741824*n^8 + 1204095/536870912*n^9 + 3815723/1073741824*n^10 + 1584867/536870912*n^11 + 278231/1073741824*n^12 - 315445/67108864*n^13 - 3736005/1073741824*n^14) * eps^15
+        + (4692619/2147483648 + 572057/536870912*n + 260179/4294967296*n^2 - 2984769/4294967296*n^3 - 3625809/2147483648*n^4 - 8162427/4294967296*n^5 - 18409849/8589934592*n^6 - 639067/536870912*n^7 - 3156661/8589934592*n^8 + 3027631/2147483648*n^9 + 162319/67108864*n^10 + 13593091/4294967296*n^11 + 9656343/4294967296*n^12 - 1568255/4294967296*n^13) * eps^16
+        + (4367867/2147483648 + 3942989/4294967296*n + 2323595/8589934592*n^2 - 2679169/4294967296*n^3 - 2473899/2147483648*n^4 - 15712829/8589934592*n^5 - 14665951/8589934592*n^6 - 14129447/8589934592*n^7 - 2450171/4294967296*n^8 + 529403/2147483648*n^9 + 14965037/8589934592*n^10 + 5189391/2147483648*n^11 + 5874821/2147483648*n^12) * eps^17
+        + (31803789/17179869184 + 31805471/34359738368*n + 7655783/34359738368*n^2 - 10716843/34359738368*n^3 - 18130187/17179869184*n^4 - 23156361/17179869184*n^5 - 60088211/34359738368*n^6 - 11928127/8589934592*n^7 - 9775259/8589934592*n^8 - 1657343/34359738368*n^9 + 23786693/34359738368*n^10 + 65561705/34359738368*n^11) * eps^18
+        + (119278493/68719476736 + 27869745/34359738368*n + 2944971/8589934592*n^2 - 10021441/34359738368*n^3 - 48412679/68719476736*n^4 - 43782451/34359738368*n^5 - 46594423/34359738368*n^6 - 52867989/34359738368*n^7 - 70453029/68719476736*n^8 - 23159185/34359738368*n^9 + 12551255/34359738368*n^10) * eps^19
+        + (109782837/68719476736 + 110884309/137438953472*n + 159981789/549755813888*n^2 - 106745493/1099511627776*n^3 - 717924527/1099511627776*n^4 - 15979315/17179869184*n^5 - 732221291/549755813888*n^6 - 21353761/17179869184*n^7 - 347832177/274877906944*n^8 - 732828227/1099511627776*n^9) * eps^20
+        + (414212295/274877906944 + 394066451/549755813888*n + 797767751/2199023255552*n^2 - 13938969/137438953472*n^3 - 922185663/2199023255552*n^4 - 241117663/274877906944*n^5 - 70260475/68719476736*n^6 - 702480169/549755813888*n^7 - 2332298309/2199023255552*n^8) * eps^21
+        + (3077054969/2199023255552 + 6225526419/8796093022208*n + 2760680993/8796093022208*n^2 + 107993597/4398046511104*n^3 - 3483012103/8796093022208*n^4 - 5569520181/8796093022208*n^5 - 4345994585/4398046511104*n^6 - 8944055483/8796093022208*n^7) * eps^22
+        + (23336011385/17592186044416 + 5594946455/8796093022208*n + 6303559381/17592186044416*n^2 + 78999975/8796093022208*n^3 - 4164504717/17592186044416*n^4 - 330002595/549755813888*n^5 - 3315820133/4398046511104*n^6) * eps^23
+        + (43652141925/35184372088832 + 5501899769/8796093022208*n + 22131275675/70368744177664*n^2 + 820267293/8796093022208*n^3 - 16179701905/70368744177664*n^4 - 1872775091/4398046511104*n^5) * eps^24
+        + (41556934973/35184372088832 + 39939504101/70368744177664*n + 753834291/2199023255552*n^2 + 5148539461/70368744177664*n^3 - 4176807933/35184372088832*n^4) * eps^25
+        + (312802619769/281474976710656 + 78374027619/140737488355328*n + 42845064993/140737488355328*n^2 + 18460662479/140737488355328*n^3) * eps^26
+        + (298867963845/281474976710656 + 71700391575/140737488355328*n + 45431388475/140737488355328*n^2) * eps^27
+        + (36174484487935/36028797018963968 + 8994085968251/18014398509481984*n) * eps^28
+        + 34671257326469/36028797018963968 * eps^29;
+C3[5] = + (21/2560 - 9/512*n + 15/1024*n^2 - 7/1024*n^3 + 9/5120*n^4 - 1/5120*n^5) * eps^5
+        + (9/1024 - 15/1024*n + 3/2048*n^2 + 57/5120*n^3 - 5/512*n^4 + 9/2560*n^5 - 1/2048*n^6) * eps^6
+        + (99/16384 - 91/16384*n - 781/81920*n^2 + 883/81920*n^3 + 319/81920*n^4 - 783/81920*n^5 + 387/81920*n^6 - 13/16384*n^7) * eps^7
+        + (179/32768 - 55/16384*n - 79/10240*n^2 - 27/81920*n^3 + 461/40960*n^4 - 139/81920*n^5 - 65/8192*n^6 + 441/81920*n^7 - 35/32768*n^8) * eps^8
+        + (141/32768 - 109/131072*n - 217/32768*n^2 - 219/65536*n^3 + 1559/327680*n^4 + 5431/655360*n^5 - 203/40960*n^6 - 1943/327680*n^7 + 369/65536*n^8 - 85/65536*n^9) * eps^9
+        + (1013/262144 - 15/32768*n - 5399/1310720*n^2 - 199/40960*n^3 + 1267/1310720*n^4 + 1007/163840*n^5 + 6277/1310720*n^6 - 527/81920*n^7 - 659/163840*n^8 + 459/81920*n^9 - 969/655360*n^10) * eps^10
+        + (6787/2097152 + 797/2097152*n - 34683/10485760*n^2 - 257/65536*n^3 - 7753/4194304*n^4 + 72641/20971520*n^5 + 115867/20971520*n^6 + 38817/20971520*n^7 - 142119/20971520*n^8 - 50133/20971520*n^9 + 113373/20971520*n^10 - 6783/4194304*n^11) * eps^11
+        + (12315/4194304 + 799/2097152*n - 41519/20971520*n^2 - 19671/5242880*n^3 - 93317/41943040*n^4 + 12949/20971520*n^5 + 18211/4194304*n^6 + 86317/20971520*n^7 - 2971/10485760*n^8 - 135789/20971520*n^9 - 11229/10485760*n^10 + 107217/20971520*n^11 - 14421/8388608*n^12) * eps^12
+        + (42753/16777216 + 11749/16777216*n - 534457/335544320*n^2 - 914519/335544320*n^3 - 953267/335544320*n^4 - 128591/335544320*n^5 + 354589/167772160*n^6 + 703457/167772160*n^7 + 433157/167772160*n^8 - 17697/10485760*n^9 - 1961579/335544320*n^10 - 2717/67108864*n^11 + 1600731/335544320*n^12 - 120175/67108864*n^13) * eps^13
+        + (78439/33554432 + 41589/67108864*n - 606887/671088640*n^2 - 813811/335544320*n^3 - 795669/335544320*n^4 - 126481/83886080*n^5 + 693943/671088640*n^6 + 92775/33554432*n^7 + 1181311/335544320*n^8 + 409551/335544320*n^9 - 1692661/671088640*n^10 - 1705561/335544320*n^11 + 124729/167772160*n^12 + 148005/33554432*n^13 - 246675/134217728*n^14) * eps^14
+        + (11153319/5368709120 + 806753/1073741824*n - 3945181/5368709120*n^2 - 9244317/5368709120*n^3 - 12780537/5368709120*n^4 - 8161927/5368709120*n^5 - 291353/1073741824*n^6 + 10250183/5368709120*n^7 + 15202259/5368709120*n^8 + 14255529/5368709120*n^9 + 710823/5368709120*n^10 - 3162357/1073741824*n^11 - 23067781/5368709120*n^12 + 1424137/1073741824*n^13 + 4351347/1073741824*n^14) * eps^15
+        + (4132007/2147483648 + 710105/1073741824*n - 969349/2684354560*n^2 - 1619999/1073741824*n^3 - 5011741/2684354560*n^4 - 9930299/5368709120*n^5 - 1564801/2684354560*n^6 + 3561709/5368709120*n^7 + 1553999/671088640*n^8 + 13695849/5368709120*n^9 + 4792721/2684354560*n^10 - 3635919/5368709120*n^11 - 8283611/2684354560*n^12 - 3808363/1073741824*n^13) * eps^16
+        + (3734859/2147483648 + 6155471/8589934592*n - 789297/2684354560*n^2 - 11355613/10737418240*n^3 - 37704683/21474836480*n^4 - 67981809/42949672960*n^5 - 4910633/4294967296*n^6 + 122353/536870912*n^7 + 13584809/10737418240*n^8 + 102204983/42949672960*n^9 + 22521571/10737418240*n^10 + 5393991/5368709120*n^11 - 26677631/21474836480*n^12) * eps^17
+        + (27894537/17179869184 + 341135/536870912*n - 6919577/85899345920*n^2 - 9962193/10737418240*n^3 - 116140263/85899345920*n^4 - 35024383/21474836480*n^5 - 93895333/85899345920*n^6 - 9724319/21474836480*n^7 + 71547201/85899345920*n^8 + 16957261/10737418240*n^9 + 38167643/17179869184*n^10 + 4254817/2684354560*n^11) * eps^18
+        + (102149077/68719476736 + 45149747/68719476736*n - 5268353/85899345920*n^2 - 438238873/687194767360*n^3 - 21374577/17179869184*n^4 - 229885771/171798691840*n^5 - 111314271/85899345920*n^6 - 190649511/343597383680*n^7 + 21780193/171798691840*n^8 + 42150359/34359738368*n^9 + 575291951/343597383680*n^10) * eps^19
+        + (191992897/137438953472 + 10102641/17179869184*n + 91038377/1374389534720*n^2 - 48406631/85899345920*n^3 - 1306192047/1374389534720*n^4 - 111829633/85899345920*n^5 - 775578061/687194767360*n^6 - 75280887/85899345920*n^7 - 41514599/687194767360*n^8 + 38659177/68719476736*n^9) * eps^20
+        + (355055163/274877906944 + 653193131/1099511627776*n + 347941049/5497558138880*n^2 - 2051760759/5497558138880*n^3 - 4780409067/5497558138880*n^4 - 2891926301/2748779069440*n^5 - 3246633917/2748779069440*n^6 - 2255299589/2748779069440*n^7 - 500938259/1099511627776*n^8) * eps^21
+        + (2684106857/2199023255552 + 589926107/1099511627776*n + 391603487/2748779069440*n^2 - 1831096049/5497558138880*n^3 - 7250179399/10995116277760*n^4 - 687030501/687194767360*n^5 - 2742957537/2748779069440*n^6 - 2629744457/2748779069440*n^7) * eps^22
+        + (20014266089/17592186044416 + 9415408371/17592186044416*n + 2280678869/17592186044416*n^2 - 18044662719/87960930222080*n^3 - 10627395203/17592186044416*n^4 - 70583370027/87960930222080*n^5 - 10917838539/10995116277760*n^6) * eps^23
+        + (38001723933/35184372088832 + 8573148395/17592186044416*n + 7931117147/43980465111040*n^2 - 16302072297/87960930222080*n^3 - 39871150043/87960930222080*n^4 - 33222569643/43980465111040*n^5) * eps^24
+        + (178265154501/175921860444160 + 67917412749/140737488355328*n + 7195977601/43980465111040*n^2 - 17107988587/175921860444160*n^3 - 73408496063/175921860444160*n^4) * eps^25
+        + (271858418651/281474976710656 + 3893205391/8796093022208*n + 277112865109/1407374883553280*n^2 - 1966777807/21990232555520*n^3) * eps^26
+        + (4103246283741/4503599627370496 + 1965390008631/4503599627370496*n + 4035517048233/22517998136852480*n^2) * eps^27
+        + (7848710341433/9007199254740992 + 1814136297259/4503599627370496*n) * eps^28
+        + 29752988542989/36028797018963968 * eps^29;
+C3[6] = + (11/2048 - 99/8192*n + 275/24576*n^2 - 77/12288*n^3 + 9/4096*n^4 - 11/24576*n^5 + 1/24576*n^6) * eps^6
+        + (99/16384 - 275/24576*n + 55/16384*n^2 + 167/24576*n^3 - 407/49152*n^4 + 35/8192*n^5 - 55/49152*n^6 + 1/8192*n^7) * eps^7
+        + (143/32768 - 253/49152*n - 1105/196608*n^2 + 481/49152*n^3 - 73/196608*n^4 - 169/24576*n^5 + 1067/196608*n^6 - 11/6144*n^7 + 15/65536*n^8) * eps^8
+        + (33/8192 - 221/65536*n - 23/4096*n^2 + 457/196608*n^3 + 267/32768*n^4 - 329/65536*n^5 - 69/16384*n^6 + 375/65536*n^7 - 77/32768*n^8 + 17/49152*n^9) * eps^9
+        + (1711/524288 - 4333/3145728*n - 16885/3145728*n^2 - 1343/1572864*n^3 + 17381/3145728*n^4 + 8519/2097152*n^5 - 42985/6291456*n^6 - 4885/3145728*n^7 + 8549/1572864*n^8 - 5797/2097152*n^9 + 969/2097152*n^10) * eps^10
+        + (6223/2097152 - 2827/3145728*n - 23731/6291456*n^2 - 8959/3145728*n^3 + 11937/4194304*n^4 + 32207/6291456*n^5 + 5071/12582912*n^6 - 42571/6291456*n^7 + 7489/12582912*n^8 + 10115/2097152*n^9 - 12749/4194304*n^10 + 1197/2097152*n^11) * eps^11
+        + (31829/12582912 - 647/4194304*n - 13305/4194304*n^2 - 23369/8388608*n^3 + 981/4194304*n^4 + 53003/12582912*n^5 + 161989/50331648*n^6 - 25313/12582912*n^7 - 288887/50331648*n^8 + 8937/4194304*n^9 + 204725/50331648*n^10 - 80465/25165824*n^11 + 33649/50331648*n^12) * eps^12
+        + (19409/8388608 - 143/4194304*n - 108221/50331648*n^2 - 37559/12582912*n^3 - 11319/16777216*n^4 + 110569/50331648*n^5 + 49103/12582912*n^6 + 19233/16777216*n^7 - 6811/2097152*n^8 - 73151/16777216*n^9 + 156973/50331648*n^10 + 165187/50331648*n^11 - 164197/50331648*n^12 + 6325/8388608*n^13) * eps^13
+        + (136403/67108864 + 149829/536870912*n - 951655/536870912*n^2 - 1940579/805306368*n^3 - 1290821/805306368*n^4 + 1817813/1610612736*n^5 + 4654573/1610612736*n^6 + 374953/134217728*n^7 - 210217/402653184*n^8 - 1945219/536870912*n^9 - 1593647/536870912*n^10 + 2958659/805306368*n^11 + 2038421/805306368*n^12 - 5245955/1610612736*n^13 + 444015/536870912*n^14) * eps^14
+        + (2013531/1073741824 + 153447/536870912*n - 3812959/3221225472*n^2 - 3623809/1610612736*n^3 - 1720969/1073741824*n^4 - 155419/1610612736*n^5 + 2321319/1073741824*n^6 + 1446653/536870912*n^7 + 4820965/3221225472*n^8 - 881605/536870912*n^9 - 11135251/3221225472*n^10 - 927839/536870912*n^11 + 12596617/3221225472*n^12 + 2976545/1610612736*n^13 - 3437005/1073741824*n^14) * eps^15
+        + (3610319/2147483648 + 689891/1610612736*n - 4192091/4294967296*n^2 - 5626007/3221225472*n^3 - 23482225/12884901888*n^4 - 63477/134217728*n^5 + 13148195/12884901888*n^6 + 2657655/1073741824*n^7 + 8738873/4294967296*n^8 + 89999/268435456*n^9 - 9718455/4294967296*n^10 - 9643399/3221225472*n^11 - 9027109/12884901888*n^12 + 1580215/402653184*n^13) * eps^16
+        + (3357815/2147483648 + 5140585/12884901888*n - 1357887/2147483648*n^2 - 20205383/12884901888*n^3 - 10165433/6442450944*n^4 - 12859795/12884901888*n^5 + 3376837/6442450944*n^6 + 20985541/12884901888*n^7 + 14739271/6442450944*n^8 + 5247007/4294967296*n^9 - 3621415/6442450944*n^10 - 32175059/12884901888*n^11 - 15465929/6442450944*n^12) * eps^17
+        + (73325191/51539607552 + 16029851/34359738368*n - 17954851/34359738368*n^2 - 124000031/103079215104*n^3 - 107691583/68719476736*n^4 - 26099447/25769803776*n^5 - 10228585/68719476736*n^6 + 124145675/103079215104*n^7 + 371070857/206158430208*n^8 + 11745371/6442450944*n^9 + 91139599/206158430208*n^10 - 30320905/25769803776*n^11) * eps^18
+        + (91563605/68719476736 + 44091817/103079215104*n - 10830499/34359738368*n^2 - 27517235/25769803776*n^3 - 268855985/206158430208*n^4 - 82123075/68719476736*n^5 - 69647705/206158430208*n^6 + 109205227/206158430208*n^7 + 319534237/206158430208*n^8 + 114455667/68719476736*n^9 + 64469791/51539607552*n^10) * eps^19
+        + (168518401/137438953472 + 189582913/412316860416*n - 142520949/549755813888*n^2 - 671006539/824633720832*n^3 - 2036680639/1649267441664*n^4 - 888938183/824633720832*n^5 - 275851423/412316860416*n^6 + 73762303/274877906944*n^7 + 200547467/206158430208*n^8 + 445330347/274877906944*n^9) * eps^20
+        + (317520693/274877906944 + 231509165/549755813888*n - 214107557/1649267441664*n^2 - 396525643/549755813888*n^3 - 278406799/274877906944*n^4 - 920067617/824633720832*n^5 - 564306103/824633720832*n^6 - 58960025/412316860416*n^7 + 595823299/824633720832*n^8) * eps^21
+        + (2358489413/2199023255552 + 11489787637/26388279066624*n - 908814505/8796093022208*n^2 - 2396614237/4398046511104*n^3 - 12411634453/13194139533312*n^4 - 8522185111/8796093022208*n^5 - 21849837611/26388279066624*n^6 - 2193761283/8796093022208*n^7) * eps^22
+        + (17864718441/17592186044416 + 10555835899/26388279066624*n - 1055263841/52776558133248*n^2 - 4259460285/8796093022208*n^3 - 40456260929/52776558133248*n^4 - 25125823283/26388279066624*n^5 - 20228133965/26388279066624*n^6) * eps^23
+        + (100244499991/105553116266496 + 7127188931/17592186044416*n - 2047769071/211106232532992*n^2 - 19029851431/52776558133248*n^3 - 49723762631/70368744177664*n^4 - 21473509045/26388279066624*n^5) * eps^24
+        + (7943510175/8796093022208 + 78919576567/211106232532992*n + 2396202703/52776558133248*n^2 - 67906408573/211106232532992*n^3 - 30263574227/52776558133248*n^4) * eps^25
+        + (956603287889/1125899906842624 + 2527332335909/6755399441055744*n + 105375782699/2251799813685248*n^2 - 394588464167/1688849860263936*n^3) * eps^26
+        + (3651975781065/4503599627370496 + 780981164949/2251799813685248*n + 378631414483/4503599627370496*n^2) * eps^27
+        + (6906351178529/9007199254740992 + 9311073056275/27021597764222976*n) * eps^28
+        + 13225333818489/18014398509481984 * eps^29;
+C3[7] = + (429/114688 - 143/16384*n + 143/16384*n^2 - 91/16384*n^3 + 39/16384*n^4 - 11/16384*n^5 + 13/114688*n^6 - 1/114688*n^7) * eps^7
+        + (143/32768 - 143/16384*n + 65/16384*n^2 + 65/16384*n^3 - 109/16384*n^4 + 507/114688*n^5 - 27/16384*n^6 + 39/114688*n^7 - 1/32768*n^8) * eps^8
+        + (429/131072 - 299/65536*n - 13/4096*n^2 + 269/32768*n^3 - 601/229376*n^4 - 989/229376*n^5 + 9475/1835008*n^6 - 4667/1835008*n^7 + 1157/1835008*n^8 - 17/262144*n^9) * eps^9
+        + (403/131072 - 13/4096*n - 521/131072*n^2 + 393/114688*n^3 + 1209/229376*n^4 - 11001/1835008*n^5 - 3979/3670016*n^6 + 8821/1835008*n^7 - 833/262144*n^8 + 429/458752*n^9 - 57/524288*n^10) * eps^10
+        + (5343/2097152 - 3345/2097152*n - 8863/2097152*n^2 + 2511/3670016*n^3 + 146613/29360128*n^4 + 27159/29360128*n^5 - 185267/29360128*n^6 + 47549/29360128*n^7 + 112179/29360128*n^8 - 103371/29360128*n^9 + 35815/29360128*n^10 - 665/4194304*n^11) * eps^11
+        + (9825/4194304 - 2337/2097152*n - 13661/4194304*n^2 - 1405/1048576*n^3 + 205965/58720256*n^4 + 98019/29360128*n^5 - 15733/7340032*n^6 - 145237/29360128*n^7 + 99087/29360128*n^8 + 76233/29360128*n^9 - 106087/29360128*n^10 + 6149/4194304*n^11 - 1771/8388608*n^12) * eps^12
+        + (2125/1048576 - 3903/8388608*n - 96259/33554432*n^2 - 410489/234881024*n^3 + 341577/234881024*n^4 + 441667/117440512*n^5 + 102545/117440512*n^6 - 411905/117440512*n^7 - 44531/14680064*n^8 + 996015/234881024*n^9 + 324603/234881024*n^10 - 118019/33554432*n^11 + 55913/33554432*n^12 - 8855/33554432*n^13) * eps^13
+        + (31337/16777216 - 9845/33554432*n - 141287/67108864*n^2 - 514903/234881024*n^3 + 213351/469762048*n^4 + 158209/58720256*n^5 + 299101/117440512*n^6 - 132045/117440512*n^7 - 1686973/469762048*n^8 - 284559/234881024*n^9 + 1041819/234881024*n^10 + 72061/234881024*n^11 - 773421/234881024*n^12 + 213785/117440512*n^13 - 148005/469762048*n^14) * eps^14
+        + (1780203/1073741824 + 2521/1073741824*n - 1916449/1073741824*n^2 - 14648021/7516192768*n^3 - 606289/1073741824*n^4 + 2068453/1073741824*n^5 + 19266365/7516192768*n^6 + 1015577/1073741824*n^7 - 17180199/7516192768*n^8 - 22143117/7516192768*n^9 + 1831549/7516192768*n^10 + 4498521/1073741824*n^11 - 4339571/7516192768*n^12 - 22471345/7516192768*n^13 + 14517945/7516192768*n^14) * eps^15
+        + (3302903/2147483648 + 61025/1073741824*n - 1392303/1073741824*n^2 - 14509913/7516192768*n^3 - 6298927/7516192768*n^4 + 6457051/7516192768*n^5 + 17971091/7516192768*n^6 + 12735795/7516192768*n^7 - 3219137/7516192768*n^8 - 20216205/7516192768*n^9 - 15046077/7516192768*n^10 + 9532867/7516192768*n^11 + 3961599/1073741824*n^12 - 9497345/7516192768*n^13) * eps^16
+        + (2983837/2147483648 + 1733855/8589934592*n - 4685403/4294967296*n^2 - 48201865/30064771072*n^3 - 36259515/30064771072*n^4 + 5527869/15032385536*n^5 + 1536743/939524096*n^6 + 63232859/30064771072*n^7 + 73671/117440512*n^8 - 1449355/1073741824*n^9 - 76937885/30064771072*n^10 - 30946235/30064771072*n^11 + 3570999/1879048192*n^12) * eps^17
+        + (22292529/17179869184 + 899355/4294967296*n - 13492583/17179869184*n^2 - 44700791/30064771072*n^3 - 70120189/60129542144*n^4 - 3471339/15032385536*n^5 + 72969301/60129542144*n^6 + 478067/268435456*n^7 + 85725937/60129542144*n^8 - 9546319/30064771072*n^9 - 109115611/60129542144*n^10 - 63656897/30064771072*n^11) * eps^18
+        + (81611253/68719476736 + 19508379/68719476736*n - 2837849/4294967296*n^2 - 1163707393/962072674304*n^3 - 75492929/60129542144*n^4 - 25075777/60129542144*n^5 + 141589169/240518168576*n^6 + 109200085/68719476736*n^7 + 51248003/34359738368*n^8 + 19485265/30064771072*n^9 - 68932559/68719476736*n^10) * eps^19
+        + (153351409/137438953472 + 1171063/4294967296*n - 128254133/274877906944*n^2 - 32936875/30064771072*n^3 - 2152615067/1924145348608*n^4 - 167428859/240518168576*n^5 + 297094515/962072674304*n^6 + 261663431/240518168576*n^7 + 1509210613/962072674304*n^8 + 472288869/481036337152*n^9) * eps^20
+        + (1984807995/1924145348608 + 342786907/1099511627776*n - 215809073/549755813888*n^2 - 3403522219/3848290697216*n^3 - 2125818367/1924145348608*n^4 - 5503162739/7696581394432*n^5 - 36779903/481036337152*n^6 + 1607563715/1924145348608*n^7 + 4856829545/3848290697216*n^8) * eps^21
+        + (2142375089/2199023255552 + 161430897/549755813888*n - 585488823/2199023255552*n^2 - 3056980555/3848290697216*n^3 - 14718114487/15393162788864*n^4 - 793901309/962072674304*n^5 - 3165663579/15393162788864*n^6 + 420223757/962072674304*n^7) * eps^22
+        + (15972732585/17592186044416 + 5524675807/17592186044416*n - 3921720195/17592186044416*n^2 - 78636170271/123145302310912*n^3 - 112176079097/123145302310912*n^4 - 94959230613/123145302310912*n^5 - 12796244065/30786325577728*n^6) * eps^23
+        + (30308424633/35184372088832 + 5175108963/17592186044416*n - 2441010467/17592186044416*n^2 - 70491037987/123145302310912*n^3 - 47936493201/61572651155456*n^4 - 49286431235/61572651155456*n^5) * eps^24
+        + (227458182793/281474976710656 + 85653158665/281474976710656*n - 16050121299/140737488355328*n^2 - 451259285829/985162418487296*n^3 - 718664673347/985162418487296*n^4) * eps^25
+        + (433302064951/562949953421312 + 40095993459/140737488355328*n - 31913675941/562949953421312*n^2 - 57834268753/140737488355328*n^3) * eps^26
+        + (3269693185065/4503599627370496 + 1302630681669/4503599627370496*n - 195127280595/4503599627370496*n^2) * eps^27
+        + (6249998138435/9007199254740992 + 1221397131411/4503599627370496*n) * eps^28
+        + 5922672166091/9007199254740992 * eps^29;
+C3[8] = + (715/262144 - 429/65536*n + 455/65536*n^2 - 637/131072*n^3 + 315/131072*n^4 - 55/65536*n^5 + 13/65536*n^6 - 15/524288*n^7 + 1/524288*n^8) * eps^8
+        + (429/131072 - 455/65536*n + 1053/262144*n^2 + 35/16384*n^3 - 1361/262144*n^4 + 69/16384*n^5 - 2095/1048576*n^6 + 77/131072*n^7 - 105/1048576*n^8 + 1/131072*n^9) * eps^9
+        + (663/262144 - 4173/1048576*n - 1717/1048576*n^2 + 3485/524288*n^3 - 3825/1048576*n^4 - 9469/4194304*n^5 + 18469/4194304*n^6 - 6137/2097152*n^7 + 4455/4194304*n^8 - 885/4194304*n^9 + 19/1048576*n^10) * eps^10
+        + (5057/2097152 - 3043/1048576*n - 5771/2097152*n^2 + 3893/1048576*n^3 + 25381/8388608*n^4 - 24103/4194304*n^5 + 8933/8388608*n^6 + 14179/4194304*n^7 - 28533/8388608*n^8 + 399/262144*n^9 - 2925/8388608*n^10 + 35/1048576*n^11) * eps^11
+        + (4269/2097152 - 3449/2097152*n - 27455/8388608*n^2 + 104101/67108864*n^3 + 268897/67108864*n^4 - 17303/16777216*n^5 - 162199/33554432*n^6 + 27987/8388608*n^7 + 61363/33554432*n^8 - 115233/33554432*n^9 + 127809/67108864*n^10 - 33495/67108864*n^11 + 1771/33554432*n^12) * eps^12
+        + (991/524288 - 10081/8388608*n - 365791/134217728*n^2 - 9717/33554432*n^3 + 465795/134217728*n^4 + 27547/16777216*n^5 - 106205/33554432*n^6 - 89529/33554432*n^7 + 289573/67108864*n^8 + 17427/67108864*n^9 - 420741/134217728*n^10 + 146465/67108864*n^11 - 87285/134217728*n^12 + 1265/16777216*n^13) * eps^13
+        + (55563/33554432 - 344251/536870912*n - 1348101/536870912*n^2 - 244277/268435456*n^3 + 1091783/536870912*n^4 + 1517573/536870912*n^5 - 219671/268435456*n^6 - 915171/268435456*n^7 - 65579/134217728*n^8 + 2300175/536870912*n^9 - 565193/536870912*n^10 - 705799/268435456*n^11 + 1263413/536870912*n^12 - 426075/536870912*n^13 + 13455/134217728*n^14) * eps^14
+        + (1650255/1073741824 - 242867/536870912*n - 2099405/1073741824*n^2 - 798587/536870912*n^3 + 1248445/1073741824*n^4 + 85085/33554432*n^5 + 1183963/1073741824*n^6 - 612017/268435456*n^7 - 2724453/1073741824*n^8 + 612213/536870912*n^9 + 3906577/1073741824*n^10 - 1079195/536870912*n^11 - 2173807/1073741824*n^12 + 651625/268435456*n^13 - 991575/1073741824*n^14) * eps^15
+        + (92379/67108864 - 96367/536870912*n - 7319885/4294967296*n^2 - 6313853/4294967296*n^3 + 429327/2147483648*n^4 + 9301893/4294967296*n^5 + 15031227/8589934592*n^6 - 2278773/4294967296*n^7 - 22903967/8589934592*n^8 - 2725917/2147483648*n^9 + 4500833/2147483648*n^10 + 11631693/4294967296*n^11 - 5617393/2147483648*n^12 - 12008165/8589934592*n^13) * eps^16
+        + (2756519/2147483648 - 430227/4294967296*n - 11245169/8589934592*n^2 - 6724689/4294967296*n^3 - 53143/268435456*n^4 + 11801191/8589934592*n^5 + 4420815/2147483648*n^6 + 4422845/8589934592*n^7 - 13431985/8589934592*n^8 - 1236311/536870912*n^9 - 519961/8589934592*n^10 + 5300279/2147483648*n^11 + 29579711/17179869184*n^12) * eps^17
+        + (20057037/17179869184 + 1437191/34359738368*n - 38619865/34359738368*n^2 - 47458715/34359738368*n^3 - 11051395/17179869184*n^4 + 31753819/34359738368*n^5 + 923369/536870912*n^6 + 22435517/17179869184*n^7 - 20287619/34359738368*n^8 - 16694191/8589934592*n^9 - 53676765/34359738368*n^10 + 60038145/68719476736*n^11) * eps^18
+        + (75219653/68719476736 + 2460657/34359738368*n - 3690307/4294967296*n^2 - 45693585/34359738368*n^3 - 12731745/17179869184*n^4 + 3014801/8589934592*n^5 + 102479649/68719476736*n^6 + 95223/67108864*n^7 + 12997523/34359738368*n^8 - 45081435/34359738368*n^9 - 250602523/137438953472*n^10) * eps^19
+        + (138411809/137438953472 + 20479031/137438953472*n - 404248825/549755813888*n^2 - 623123853/549755813888*n^3 - 249636485/274877906944*n^4 + 24599285/274877906944*n^5 + 278247109/274877906944*n^6 + 206754789/137438953472*n^7 + 433813329/549755813888*n^8 - 463032277/1099511627776*n^9) * eps^20
+        + (260886645/274877906944 + 85615081/549755813888*n - 614045309/1099511627776*n^2 - 577943525/549755813888*n^3 - 959520737/1099511627776*n^4 - 65018321/274877906944*n^5 + 412167595/549755813888*n^6 + 341178333/274877906944*n^7 + 2517056589/2199023255552*n^8) * eps^21
+        + (1937599123/2199023255552 + 875827069/4398046511104*n - 2101908333/4398046511104*n^2 - 1944837617/2199023255552*n^3 - 4013825043/4398046511104*n^4 - 1514642649/4398046511104*n^5 + 52220173/137438953472*n^6 + 9631735815/8796093022208*n^7) * eps^22
+        + (7338112607/8796093022208 + 858111205/4398046511104*n - 3151357309/8796093022208*n^2 - 3552063895/4398046511104*n^3 - 7304761733/8796093022208*n^4 - 1117242591/2199023255552*n^5 + 3576385429/17592186044416*n^6) * eps^23
+        + (439177896603/562949953421312 + 30926258881/140737488355328*n - 43123141703/140737488355328*n^2 - 190181338763/281474976710656*n^3 - 230252313827/281474976710656*n^4 - 74140886391/140737488355328*n^5) * eps^24
+        + (208758190031/281474976710656 + 29681117575/140737488355328*n - 126131044829/562949953421312*n^2 - 21573269697/35184372088832*n^3 - 409510620075/562949953421312*n^4) * eps^25
+        + (392781497985/562949953421312 + 506107726005/2251799813685248*n - 429816687963/2251799813685248*n^2 - 575742720763/1125899906842624*n^3) * eps^26
+        + (2997989980695/4503599627370496 + 481944654003/2251799813685248*n - 599801259897/4503599627370496*n^2) * eps^27
+        + (2834595204413/4503599627370496 + 997668129067/4503599627370496*n) * eps^28
+        + 2712992943545/4503599627370496 * eps^29;
+C3[9] = + (2431/1179648 - 663/131072*n + 1105/196608*n^2 - 833/196608*n^3 + 153/65536*n^4 - 187/196608*n^5 + 221/786432*n^6 - 15/262144*n^7 + 17/2359296*n^8 - 1/2359296*n^9) * eps^9
+        + (663/262144 - 1105/196608*n + 1003/262144*n^2 + 187/196608*n^3 - 391/98304*n^4 + 1003/262144*n^5 - 3425/1572864*n^6 + 1921/2359296*n^7 - 13/65536*n^8 + 17/589824*n^9 - 1/524288*n^10) * eps^10
+        + (4199/2097152 - 21743/6291456*n - 4199/6291456*n^2 + 33269/6291456*n^3 - 50065/12582912*n^4 - 9443/12582912*n^5 + 14573/4194304*n^6 - 112667/37748736*n^7 + 53599/37748736*n^8 - 15487/37748736*n^9 + 2567/37748736*n^10 - 21/4194304*n^11) * eps^11
+        + (8109/4194304 - 5491/2097152*n - 3893/2097152*n^2 + 11305/3145728*n^3 + 11799/8388608*n^4 - 187397/37748736*n^5 + 2753/1179648*n^6 + 24241/12582912*n^7 - 118771/37748736*n^8 + 73177/37748736*n^9 - 693/1048576*n^10 + 4675/37748736*n^11 - 253/25165824*n^12) * eps^12
+        + (6953/4194304 - 80971/50331648*n - 252263/100663296*n^2 + 199465/100663296*n^3 + 895717/301989888*n^4 - 52205/25165824*n^5 - 482759/150994944*n^6 + 591815/150994944*n^7 + 2911/37748736*n^8 - 277705/100663296*n^9 + 689963/301989888*n^10 - 276985/301989888*n^11 + 58259/301989888*n^12 - 575/33554432*n^13) * eps^13
+        + (52105/33554432 - 122417/100663296*n - 450521/201326592*n^2 + 40603/100663296*n^3 + 1865333/603979776*n^4 + 23971/75497472*n^5 - 972811/301989888*n^6 - 36503/50331648*n^7 + 811127/201326592*n^8 - 149813/100663296*n^9 - 153359/75497472*n^10 + 81805/33554432*n^11 - 43547/37748736*n^12 + 40885/150994944*n^13 - 1755/67108864*n^14) * eps^14
+        + (4429673/3221225472 - 788207/1073741824*n - 6941611/3221225472*n^2 - 897577/3221225472*n^3 + 2356975/1073741824*n^4 + 17574277/9663676416*n^5 - 17208913/9663676416*n^6 - 8196295/3221225472*n^7 + 3937649/3221225472*n^8 + 10299955/3221225472*n^9 - 2716857/1073741824*n^10 - 3753553/3221225472*n^11 + 23362279/9663676416*n^12 - 13084435/9663676416*n^13 + 379015/1073741824*n^14) * eps^15
+        + (2758463/2147483648 - 1758869/3221225472*n - 5672105/3221225472*n^2 - 973687/1073741824*n^3 + 14858035/9663676416*n^4 + 19887425/9663676416*n^5 - 32501/536870912*n^6 - 24418015/9663676416*n^7 - 5340461/4831838208*n^8 + 2428553/1073741824*n^9 + 19060745/9663676416*n^10 - 29342159/9663676416*n^11 - 2979365/9663676416*n^12 + 21844849/9663676416*n^13) * eps^16
+        + (2490257/2147483648 - 7674811/25769803776*n - 20315813/12884901888*n^2 - 4435023/4294967296*n^3 + 27370555/38654705664*n^4 + 26375911/12884901888*n^5 + 1831967/2147483648*n^6 - 54254453/38654705664*n^7 - 10497871/4831838208*n^8 + 3956369/12884901888*n^9 + 32001391/12884901888*n^10 + 28530035/38654705664*n^11 - 59974063/19327352832*n^12) * eps^17
+        + (18666393/17179869184 - 889513/4294967296*n - 21696367/17179869184*n^2 - 15580247/12884901888*n^3 + 3662981/12884901888*n^4 + 14977259/9663676416*n^5 + 9479491/6442450944*n^6 - 2887897/6442450944*n^7 - 73237177/38654705664*n^8 - 16269899/12884901888*n^9 + 50631997/38654705664*n^10 + 83059381/38654705664*n^11) * eps^18
+        + (68321333/68719476736 - 14723375/206158430208*n - 56990675/51539607552*n^2 - 155817437/137438953472*n^3 - 18588719/103079215104*n^4 + 41892585/34359738368*n^5 + 57054647/38654705664*n^6 + 283540243/618475290624*n^7 - 22561439/17179869184*n^8 - 174386747/103079215104*n^9 - 158151485/618475290624*n^10) * eps^19
+        + (128591121/137438953472 - 1479029/51539607552*n - 726294569/824633720832*n^2 - 305943/268435456*n^3 - 295907705/824633720832*n^4 + 113271359/154618822656*n^5 + 1807217413/1236950581248*n^6 + 32409209/38654705664*n^7 - 581666617/1236950581248*n^8 - 111277655/68719476736*n^9) * eps^20
+        + (713238475/824633720832 + 53664037/1099511627776*n - 1263187013/1649267441664*n^2 - 1670261267/1649267441664*n^3 - 474955129/824633720832*n^4 + 4600090009/9895604649984*n^5 + 1438755463/1236950581248*n^6 + 314620739/274877906944*n^7 + 247598477/4947802324992*n^8) * eps^21
+        + (1797792591/2199023255552 + 110680117/1649267441664*n - 4012013791/6597069766656*n^2 - 1590584081/1649267441664*n^3 - 1351592063/2199023255552*n^4 + 41953639/309237645312*n^5 + 19375684513/19791209299968*n^6 + 85456501/77309411328*n^7) * eps^22
+        + (26806607255/35184372088832 + 11900807335/105553116266496*n - 55739761391/105553116266496*n^2 - 88591049429/105553116266496*n^3 - 24583779341/35184372088832*n^4 - 1960568177/105553116266496*n^5 + 212797419253/316659348799488*n^6) * eps^23
+        + (50883408771/70368744177664 + 4164850661/35184372088832*n - 14681082863/35184372088832*n^2 - 82400553121/105553116266496*n^3 - 70910402069/105553116266496*n^4 - 67176278281/316659348799488*n^5) * eps^24
+        + (190930903235/281474976710656 + 15383945467/105553116266496*n - 38240500283/105553116266496*n^2 - 35530344527/52776558133248*n^3 - 437558257621/633318697598976*n^4) * eps^25
+        + (45468475229/70368744177664 + 15280317955/105553116266496*n - 19959778025/70368744177664*n^2 - 32689473503/52776558133248*n^3) * eps^26
+        + (24702973639945/40532396646334464 + 726357235713/4503599627370496*n - 3324932711075/13510798882111488*n^2) * eps^27
+        + (5246222852159/9007199254740992 + 706735196961/4503599627370496*n) * eps^28
+        + 310707493777/562949953421312 * eps^29;
+C3[10] = + (4199/2621440 - 4199/1048576*n + 4845/1048576*n^2 - 969/262144*n^3 + 2907/1310720*n^4 - 10659/10485760*n^5 + 741/2097152*n^6 - 95/1048576*n^7 + 17/1048576*n^8 - 19/10485760*n^9 + 1/10485760*n^10) * eps^10
+        + (4199/2097152 - 4845/1048576*n + 7429/2097152*n^2 + 969/5242880*n^3 - 12597/4194304*n^4 + 35397/10485760*n^5 - 9329/4194304*n^6 + 2087/2097152*n^7 - 6479/20971520*n^8 + 135/2097152*n^9 - 171/20971520*n^10 + 1/2097152*n^11) * eps^11
+        + (6783/4194304 - 12597/4194304*n - 2261/41943040*n^2 + 174743/41943040*n^3 - 164901/41943040*n^4 + 1539/5242880*n^5 + 214809/83886080*n^6 - 29519/10485760*n^7 + 139141/83886080*n^8 - 1631/2621440*n^9 + 12559/83886080*n^10 - 893/41943040*n^11 + 23/16777216*n^12) * eps^12
+        + (13243/8388608 - 19703/8388608*n - 101099/83886080*n^2 + 138073/41943040*n^3 + 24719/83886080*n^4 - 337423/83886080*n^5 + 12363/4194304*n^6 + 57103/83886080*n^7 - 27323/10485760*n^8 + 178529/83886080*n^9 - 81173/83886080*n^10 + 4485/16777216*n^11 - 3553/83886080*n^12 + 25/8388608*n^13) * eps^13
+        + (92055/67108864 - 822035/536870912*n - 1020015/536870912*n^2 + 574655/268435456*n^3 + 2734037/1342177280*n^4 - 6716637/2684354560*n^5 - 4712349/2684354560*n^6 + 158653/41943040*n^7 - 320995/268435456*n^8 - 4870931/2684354560*n^9 + 6209363/2684354560*n^10 - 1727177/1342177280*n^11 + 272823/671088640*n^12 - 38285/536870912*n^13 + 2925/536870912*n^14) * eps^14
+        + (1390515/1073741824 - 638609/536870912*n - 9739457/5368709120*n^2 + 2244193/2684354560*n^3 + 2762359/1073741824*n^4 - 1609109/2684354560*n^5 - 14885329/5368709120*n^6 + 1720321/2684354560*n^7 + 3362447/1073741824*n^8 - 6643351/2684354560*n^9 - 4107621/5368709120*n^10 + 5967063/2684354560*n^11 - 8268441/5368709120*n^12 + 1490177/2684354560*n^13 - 575757/5368709120*n^14) * eps^15
+        + (2486055/2147483648 - 416271/536870912*n - 39210607/21474836480*n^2 + 939667/5368709120*n^3 + 9060325/4294967296*n^4 + 2491453/2684354560*n^5 - 46473241/21474836480*n^6 - 3953531/2684354560*n^7 + 44317207/21474836480*n^8 + 9488381/5368709120*n^9 - 64785587/21474836480*n^10 + 739973/2684354560*n^11 + 41224629/21474836480*n^12 - 9171349/5368709120*n^13) * eps^16
+        + (2335727/2147483648 - 2563477/4294967296*n - 16701111/10737418240*n^2 - 9668041/21474836480*n^3 + 17992927/10737418240*n^4 + 31720101/21474836480*n^5 - 2271699/2684354560*n^6 - 47531759/21474836480*n^7 + 1536949/10737418240*n^8 + 10243175/4294967296*n^9 + 3586031/10737418240*n^10 - 63134341/21474836480*n^11 + 12279279/10737418240*n^12) * eps^17
+        + (16987677/17179869184 - 12817701/34359738368*n - 245571871/171798691840*n^2 - 113240313/171798691840*n^3 + 346569259/343597383680*n^4 + 74555269/42949672960*n^5 + 27207641/343597383680*n^6 - 297892471/171798691840*n^7 - 90518711/68719476736*n^8 + 56969301/42949672960*n^9 + 132544051/68719476736*n^10 - 17233729/21474836480*n^11) * eps^18
+        + (63952469/68719476736 - 9581357/34359738368*n - 203499591/171798691840*n^2 - 76181293/85899345920*n^3 + 212001921/343597383680*n^4 + 103062223/68719476736*n^5 + 287585989/343597383680*n^6 - 73169205/68719476736*n^7 - 114638241/68719476736*n^8 - 59443911/343597383680*n^9 + 159059379/85899345920*n^10) * eps^19
+        + (588367381/687194767360 - 20787795/137438953472*n - 2904705599/2748779069440*n^2 - 1224194119/1374389534720*n^3 + 476022861/2748779069440*n^4 + 1802954677/1374389534720*n^5 + 739674421/687194767360*n^6 - 326887271/1374389534720*n^7 - 530422339/343597383680*n^8 - 279426503/274877906944*n^9) * eps^20
+        + (222258195/274877906944 - 55829477/549755813888*n - 477453485/549755813888*n^2 - 2590977593/2748779069440*n^3 - 58684921/1374389534720*n^4 + 1291134563/1374389534720*n^5 + 1706006381/1374389534720*n^6 + 33790047/137438953472*n^7 - 1348338613/1374389534720*n^8) * eps^21
+        + (3301594169/4398046511104 - 453528367/17592186044416*n - 67434894591/87960930222080*n^2 - 38367823899/43980465111040*n^3 - 2503383779/8796093022208*n^4 + 62281465759/87960930222080*n^5 + 98226145519/87960930222080*n^6 + 5981539941/8796093022208*n^7) * eps^22
+        + (25036620431/35184372088832 - 3706957/17592186044416*n - 110515260937/175921860444160*n^2 - 75242715363/87960930222080*n^3 - 13113832313/35184372088832*n^4 + 35799902519/87960930222080*n^5 + 181849615997/175921860444160*n^6) * eps^23
+        + (46828608507/70368744177664 + 1623985719/35184372088832*n - 77781379687/140737488355328*n^2 - 135023615257/175921860444160*n^3 - 343735176087/703687441776640*n^4 + 21076200917/87960930222080*n^5) * eps^24
+        + (22273557181/35184372088832 + 8209167567/140737488355328*n - 79486039261/175921860444160*n^2 - 512388782813/703687441776640*n^3 - 35491170583/70368744177664*n^4) * eps^25
+        + (670564680061/1125899906842624 + 196582254575/2251799813685248*n - 4472224828261/11258999068426240*n^2 - 3626987174247/5629499534213120*n^3) * eps^26
+        + (2559941004369/4503599627370496 + 206983074593/2251799813685248*n - 7284964906539/22517998136852480*n^2) * eps^27
+        + (4841011900185/9007199254740992 + 992966911831/9007199254740992*n) * eps^28
+        + 9267877312991/18014398509481984 * eps^29;
+C3[11] = + (29393/23068672 - 6783/2097152*n + 8075/2097152*n^2 - 6783/2097152*n^3 + 8721/4194304*n^4 - 4389/4194304*n^5 + 1729/4194304*n^6 - 525/4194304*n^7 + 119/4194304*n^8 - 19/4194304*n^9 + 21/46137344*n^10 - 1/46137344*n^11) * eps^11
+        + (6783/4194304 - 8075/2097152*n + 6783/2097152*n^2 - 323/1048576*n^3 - 18753/8388608*n^4 + 12255/4194304*n^5 - 9135/4194304*n^6 + 4711/4194304*n^7 - 219/524288*n^8 + 5131/46137344*n^9 - 85/4194304*n^10 + 105/46137344*n^11 - 1/8388608*n^12) * eps^12
+        + (22287/16777216 - 5491/2097152*n + 22287/67108864*n^2 + 218937/67108864*n^3 - 247779/67108864*n^4 + 65849/67108864*n^5 + 58673/33554432*n^6 - 84249/33554432*n^7 + 655201/369098752*n^8 - 300367/369098752*n^9 + 187059/738197504*n^10 - 38619/738197504*n^11 + 4809/738197504*n^12 - 25/67108864*n^13) * eps^13
+        + (5491/4194304 - 141151/67108864*n - 98363/134217728*n^2 + 196213/67108864*n^3 - 29417/67108864*n^4 - 52095/16777216*n^5 + 419083/134217728*n^6 - 103155/369098752*n^7 - 718191/369098752*n^8 + 1557273/738197504*n^9 - 1788277/1476395008*n^10 + 325161/738197504*n^11 - 6875/67108864*n^12 + 5187/369098752*n^13 - 117/134217728*n^14) * eps^14
+        + (1235475/1073741824 - 1541223/1073741824*n - 1529937/1073741824*n^2 + 2296199/1073741824*n^3 + 1365211/1073741824*n^4 - 2738587/1073741824*n^5 - 7375295/11811160064*n^6 + 38530187/11811160064*n^7 - 23317551/11811160064*n^8 - 10011949/11811160064*n^9 + 24284837/11811160064*n^10 - 18010915/11811160064*n^11 + 7660305/11811160064*n^12 - 1998361/11811160064*n^13 + 300321/11811160064*n^14) * eps^15
+        + (2349103/2147483648 - 1224911/1073741824*n - 781795/536870912*n^2 + 1166537/1073741824*n^3 + 1094423/536870912*n^4 - 13807153/11811160064*n^5 - 25077685/11811160064*n^6 + 17157263/11811160064*n^7 + 24268865/11811160064*n^8 - 33106325/11811160064*n^9 + 2076575/5905580032*n^10 + 19838275/11811160064*n^11 - 10084007/5905580032*n^12 + 10078335/11811160064*n^13) * eps^16
+        + (2117379/2147483648 - 6739785/8589934592*n - 1646453/1073741824*n^2 + 261625/536870912*n^3 + 8131213/4294967296*n^4 + 20997261/94489280512*n^5 - 101979543/47244640256*n^6 - 530353/1073741824*n^7 + 828023/369098752*n^8 + 43716997/94489280512*n^9 - 65673747/23622320128*n^10 + 31841459/23622320128*n^11 + 52076665/47244640256*n^12) * eps^17
+        + (15999297/17179869184 - 665231/1073741824*n - 23300153/17179869184*n^2 - 221463/2147483648*n^3 + 28505205/17179869184*n^4 + 3924281/4294967296*n^5 - 243226535/188978561024*n^6 - 77376389/47244640256*n^7 + 188744355/188978561024*n^8 + 45186567/23622320128*n^9 - 160724471/188978561024*n^10 - 25713125/11811160064*n^11) * eps^18
+        + (58546741/68719476736 - 28776169/68719476736*n - 10980371/8589934592*n^2 - 48605103/137438953472*n^3 + 39670397/34359738368*n^4 + 31828611/23622320128*n^5 - 187541869/377957122048*n^6 - 115448809/68719476736*n^7 - 42158467/94489280512*n^8 + 82411933/47244640256*n^9 + 753396595/755914244096*n^10) * eps^19
+        + (110659725/137438953472 - 2797611/8589934592*n - 299770405/274877906944*n^2 - 10459603/17179869184*n^3 + 226651699/274877906944*n^4 + 497934925/377957122048*n^5 + 409147909/1511828488192*n^6 - 510313799/377957122048*n^7 - 1751353333/1511828488192*n^8 + 493141905/755914244096*n^9) * eps^20
+        + (818467293/1099511627776 - 56886273/274877906944*n - 2178023121/2199023255552*n^2 - 1468259459/2199023255552*n^3 + 936005777/2199023255552*n^4 + 30592744379/24189255811072*n^5 + 483964345/755914244096*n^6 - 2151235101/3023656976384*n^7 - 17107054983/12094627905536*n^8) * eps^21
+        + (96937173/137438953472 - 338878191/2199023255552*n - 3672830975/4398046511104*n^2 - 1657202547/2199023255552*n^3 + 445677205/2199023255552*n^4 + 12225739435/12094627905536*n^5 + 45022865775/48378511622144*n^6 - 743433509/3023656976384*n^7) * eps^22
+        + (23130670543/35184372088832 - 2857753463/35184372088832*n - 26305948157/35184372088832*n^2 - 25618373853/35184372088832*n^3 - 1549180705/35184372088832*n^4 + 324075281367/387028092977152*n^5 + 367058948627/387028092977152*n^6) * eps^23
+        + (43968565791/70368744177664 - 1805535203/35184372088832*n - 2760991455/4398046511104*n^2 - 25963357003/35184372088832*n^3 - 177189123/1099511627776*n^4 + 225673037041/387028092977152*n^5) * eps^24
+        + (41252640009/70368744177664 - 1485684057/281474976710656*n - 39333792359/70368744177664*n^2 - 95968855991/140737488355328*n^3 - 41727255371/140737488355328*n^4) * eps^25
+        + (314637345025/562949953421312 + 791327487/70368744177664*n - 263720191503/562949953421312*n^2 - 5813138145/8796093022208*n^3) * eps^26
+        + (2374498758045/4503599627370496 + 184441277827/4503599627370496*n - 1875159093121/4503599627370496*n^2) * eps^27
+        + (4540838699861/9007199254740992 + 223044732129/4503599627370496*n) * eps^28
+        + 17213216597955/36028797018963968 * eps^29;
+C3[12] = + (52003/50331648 - 22287/8388608*n + 81719/25165824*n^2 - 572033/201326592*n^3 + 129789/67108864*n^4 - 52877/50331648*n^5 + 23023/50331648*n^6 - 5313/33554432*n^7 + 4301/100663296*n^8 - 437/50331648*n^9 + 21/16777216*n^10 - 23/201326592*n^11 + 1/201326592*n^12) * eps^12
+        + (22287/16777216 - 81719/25165824*n + 393737/134217728*n^2 - 62491/100663296*n^3 - 658559/402653184*n^4 + 83743/33554432*n^5 - 417197/201326592*n^6 + 60467/50331648*n^7 - 34569/67108864*n^8 + 8287/50331648*n^9 - 15479/402653184*n^10 + 209/33554432*n^11 - 253/402653184*n^12 + 1/33554432*n^13) * eps^13
+        + (37145/33554432 - 3692213/1610612736*n + 919885/1610612736*n^2 + 2047345/805306368*n^3 - 1807685/536870912*n^4 + 2268145/1610612736*n^5 + 107525/100663296*n^6 - 287615/134217728*n^7 + 1439165/805306368*n^8 - 1554985/1610612736*n^9 + 196337/536870912*n^10 - 78625/805306368*n^11 + 28451/1610612736*n^12 - 3151/1610612736*n^13 + 27/268435456*n^14) * eps^14
+        + (1181211/1073741824 - 1011655/536870912*n - 1258123/3221225472*n^2 + 1368385/536870912*n^3 - 966345/1073741824*n^4 - 1845635/805306368*n^5 + 3249555/1073741824*n^6 - 32195/33554432*n^7 - 4125455/3221225472*n^8 + 1038315/536870912*n^9 - 1464041/1073741824*n^10 + 330167/536870912*n^11 - 602911/3221225472*n^12 + 5049/134217728*n^13 - 14651/3221225472*n^14) * eps^15
+        + (2097163/2147483648 - 716243/536870912*n - 13577935/12884901888*n^2 + 26345695/12884901888*n^3 + 539465/805306368*n^4 - 30721445/12884901888*n^5 + 1671665/8589934592*n^6 + 16667215/6442450944*n^7 - 60325345/25769803776*n^8 - 7435/2147483648*n^9 + 3478199/2147483648*n^10 - 20654597/12884901888*n^11 + 11205989/12884901888*n^12 - 1294237/4294967296*n^13) * eps^16
+        + (2006267/2147483648 - 4643355/4294967296*n - 29853701/25769803776*n^2 + 15623785/12884901888*n^3 + 19883891/12884901888*n^4 - 37991705/25769803776*n^5 - 12448665/8589934592*n^6 + 47094413/25769803776*n^7 + 6739069/6442450944*n^8 - 2864351/1073741824*n^9 + 30201445/25769803776*n^10 + 1058057/1073741824*n^11 - 10580051/6442450944*n^12) * eps^17
+        + (43720079/51539607552 - 26598603/34359738368*n - 43949251/34359738368*n^2 + 71325415/103079215104*n^3 + 6957895/4294967296*n^4 - 2536467/8589934592*n^5 - 198525719/103079215104*n^6 + 13878817/51539607552*n^7 + 34508611/17179869184*n^8 - 52928069/103079215104*n^9 - 220720771/103079215104*n^10 + 66852739/34359738368*n^11) * eps^18
+        + (55326431/68719476736 - 64299007/103079215104*n - 120784247/103079215104*n^2 + 15781747/103079215104*n^3 + 106472291/68719476736*n^4 + 14611239/34359738368*n^5 - 150547861/103079215104*n^6 - 103209593/103079215104*n^7 + 99804641/68719476736*n^8 + 123227375/103079215104*n^9 - 12788579/8589934592*n^10) * eps^19
+        + (814404171/1099511627776 - 732481345/1649267441664*n - 466819643/412316860416*n^2 - 734752241/6597069766656*n^3 + 2621301201/2199023255552*n^4 + 785792285/824633720832*n^5 - 1433859853/1649267441664*n^6 - 770153889/549755813888*n^7 + 432049963/1649267441664*n^8 + 5608251079/3298534883328*n^9) * eps^20
+        + (772604523/1099511627776 - 48760475/137438953472*n - 13077992689/13194139533312*n^2 - 1241891819/3298534883328*n^3 + 4110854519/4398046511104*n^4 + 3534181601/3298534883328*n^5 - 586500377/3298534883328*n^6 - 2275702691/1649267441664*n^7 - 3789336937/6597069766656*n^8) * eps^21
+        + (358745439/549755813888 - 12934264661/52776558133248*n - 48333688039/52776558133248*n^2 - 4146286613/8796093022208*n^3 + 31281974437/52776558133248*n^4 + 59718172567/52776558133248*n^5 + 2095950701/8796093022208*n^6 - 25516746833/26388279066624*n^7) * eps^22
+        + (21821485195/35184372088832 - 10108238849/52776558133248*n - 27769272537/35184372088832*n^2 - 10217136851/17592186044416*n^3 + 13447296309/35184372088832*n^4 + 2169033311/2199023255552*n^5 + 21069180867/35184372088832*n^6) * eps^23
+        + (122479921063/211106232532992 - 2150084801/17592186044416*n - 302356197395/422212465065984*n^2 - 62203620647/105553116266496*n^3 + 20409605765/140737488355328*n^4 + 370492702933/422212465065984*n^5) * eps^24
+        + (38901506935/70368744177664 - 12663469807/140737488355328*n - 43169763871/70368744177664*n^2 - 262080088265/422212465065984*n^3 + 4124183297/281474976710656*n^4) * eps^25
+        + (292863078097/562949953421312 - 1583046845/35184372088832*n - 29152993591/52776558133248*n^2 - 1996652856445/3377699720527872*n^3) * eps^26
+        + (69950118165/140737488355328 - 1807466357/70368744177664*n - 1063027613707/2251799813685248*n^2) * eps^27
+        + (16935196336601/36028797018963968 + 223223833507/54043195528445952*n) * eps^28
+        + 16221720992423/36028797018963968 * eps^29;
+C3[13] = + (185725/218103808 - 37145/16777216*n + 185725/67108864*n^2 - 168245/67108864*n^3 + 120175/67108864*n^4 - 69575/67108864*n^5 + 16445/33554432*n^6 - 6325/33554432*n^7 + 1955/33554432*n^8 - 475/33554432*n^9 + 175/67108864*n^10 - 23/67108864*n^11 + 25/872415232*n^12 - 1/872415232*n^13) * eps^13
+        + (37145/33554432 - 185725/67108864*n + 356155/134217728*n^2 - 54625/67108864*n^3 - 39215/33554432*n^4 + 8855/4194304*n^5 - 259325/134217728*n^6 + 41515/33554432*n^7 - 625/1048576*n^8 + 14765/67108864*n^9 - 8297/134217728*n^10 + 11225/872415232*n^11 - 63/33554432*n^12 + 75/436207616*n^13 - 1/134217728*n^14) * eps^14
+        + (1002915/1073741824 - 2165335/1073741824*n + 766935/1073741824*n^2 + 2116575/1073741824*n^3 - 3237825/1073741824*n^4 + 1772265/1073741824*n^5 + 558555/1073741824*n^6 - 1889505/1073741824*n^7 + 1846575/1073741824*n^8 - 1148355/1073741824*n^9 + 6621687/13958643712*n^10 - 2147433/13958643712*n^11 + 502623/13958643712*n^12 - 80975/13958643712*n^13 + 8075/13958643712*n^14) * eps^15
+        + (2008015/2147483648 - 1815735/1073741824*n - 76705/536870912*n^2 + 2357385/1073741824*n^3 - 19665/16777216*n^4 - 1726035/1073741824*n^5 + 1491465/536870912*n^6 - 1503195/1073741824*n^7 - 363375/536870912*n^8 + 23156505/13958643712*n^9 - 9914347/6979321856*n^10 + 10709897/13958643712*n^11 - 501361/1744830464*n^12 + 1052013/13958643712*n^13) * eps^16
+        + (1798255/2147483648 - 10601045/8589934592*n - 1641165/2147483648*n^2 + 4086755/2147483648*n^3 + 913905/4294967296*n^4 - 18130905/8589934592*n^5 + 3204135/4294967296*n^6 + 1017741/536870912*n^7 - 33577953/13958643712*n^8 + 73063651/111669149696*n^9 + 1928075/1744830464*n^10 - 10703707/6979321856*n^11 + 57707979/55834574848*n^12) * eps^17
+        + (13840365/17179869184 - 2184195/2147483648*n - 15684505/17179869184*n^2 + 1348605/1073741824*n^3 + 19080865/17179869184*n^4 - 6839475/4294967296*n^5 - 14431629/17179869184*n^6 + 105895953/55834574848*n^7 + 48950133/223338299392*n^8 - 7886043/3489660928*n^9 + 372503147/223338299392*n^10 + 8024167/27917287424*n^11) * eps^18
+        + (101195745/137438953472 - 103316805/137438953472*n - 145814825/137438953472*n^2 + 56137605/68719476736*n^3 + 45844365/34359738368*n^4 - 11127843/17179869184*n^5 - 176827545/111669149696*n^6 + 177367791/223338299392*n^7 + 43666839/27917287424*n^8 - 502109665/446676598784*n^9 - 608048583/446676598784*n^10) * eps^19
+        + (192942285/274877906944 - 84667255/137438953472*n - 276352515/274877906944*n^2 + 46276975/137438953472*n^3 + 190922955/137438953472*n^4 + 544527/17179869184*n^5 - 80867391/55834574848*n^6 - 46739031/111669149696*n^7 + 1413025611/893353197568*n^8 + 208444667/446676598784*n^9) * eps^20
+        + (713651475/1099511627776 - 500804215/1099511627776*n - 2189663055/2199023255552*n^2 + 166841355/2199023255552*n^3 + 2545633095/2199023255552*n^4 + 1301305233/2199023255552*n^5 - 73499007/68719476736*n^6 - 3649124073/3573412790272*n^7 + 10673011569/14293651161088*n^8) * eps^21
+        + (1358850675/2199023255552 - 816309985/2199023255552*n - 3925550751/4398046511104*n^2 - 411093181/2199023255552*n^3 + 1069809697/1099511627776*n^4 + 887786559/1099511627776*n^5 - 28489507799/57174604644352*n^6 - 4430888365/3573412790272*n^7) * eps^22
+        + (20273133015/35184372088832 - 9511268919/35184372088832*n - 29503243001/35184372088832*n^2 - 10679084579/35184372088832*n^3 + 24333880611/35184372088832*n^4 + 33531947513/35184372088832*n^5 - 43359239675/457396837154816*n^6) * eps^23
+        + (38647569279/70368744177664 - 7657024935/35184372088832*n - 25922041023/35184372088832*n^2 - 15045539631/35184372088832*n^3 + 17766942325/35184372088832*n^4 + 31659609403/35184372088832*n^5) * eps^24
+        + (36274342699/70368744177664 - 42850331919/281474976710656*n - 11911257957/17592186044416*n^2 - 64900868793/140737488355328*n^3 + 40343787423/140737488355328*n^4) * eps^25
+        + (277172296351/562949953421312 - 2094012549/17592186044416*n - 332189237881/562949953421312*n^2 - 35829993671/70368744177664*n^3) * eps^26
+        + (1046221099377/2251799813685248 - 170172833119/2251799813685248*n - 604554123131/1125899906842624*n^2) * eps^27
+        + (2003125009747/4503599627370496 - 61476552589/1125899906842624*n) * eps^28
+        + 15190705138949/36028797018963968 * eps^29;
+C3[14] = + (334305/469762048 - 1002915/536870912*n + 1278225/536870912*n^2 - 596505/268435456*n^3 + 444015/268435456*n^4 - 542685/536870912*n^5 + 1924065/3758096384*n^6 - 201825/939524096*n^7 + 9945/134217728*n^8 - 11115/536870912*n^9 + 2457/536870912*n^10 - 207/268435456*n^11 + 25/268435456*n^12 - 27/3758096384*n^13 + 1/3758096384*n^14) * eps^14
+        + (1002915/1073741824 - 1278225/536870912*n + 2576115/1073741824*n^2 - 497835/536870912*n^3 - 865605/1073741824*n^4 + 6660225/3758096384*n^5 - 1906125/1073741824*n^6 + 4658355/3758096384*n^7 - 707265/1073741824*n^8 + 146835/536870912*n^9 - 95481/1073741824*n^10 + 11985/536870912*n^11 - 31527/7516192768*n^12 + 299/536870912*n^13 - 351/7516192768*n^14) * eps^15
+        + (1710855/2147483648 - 478515/268435456*n + 3411705/4294967296*n^2 + 1630815/1073741824*n^3 - 80250105/30064771072*n^4 + 6633315/3758096384*n^5 + 2765295/30064771072*n^6 - 10456095/7516192768*n^7 + 48041487/30064771072*n^8 - 604737/536870912*n^9 + 2449717/4294967296*n^10 - 1624435/7516192768*n^11 + 1847371/30064771072*n^12 - 48169/3758096384*n^13) * eps^16
+        + (1723965/2147483648 - 6533265/4294967296*n + 76935/2147483648*n^2 + 56398185/30064771072*n^3 - 19759875/15032385536*n^4 - 31583175/30064771072*n^5 + 36921495/15032385536*n^6 - 49642983/30064771072*n^7 - 355569/2147483648*n^8 + 40109813/30064771072*n^9 - 20948701/15032385536*n^10 + 26526277/30064771072*n^11 - 5886663/15032385536*n^12) * eps^17
+        + (24894855/34359738368 - 78264285/68719476736*n - 36988485/68719476736*n^2 + 418581945/240518168576*n^3 - 60094815/481036337152*n^4 - 107991795/60129542144*n^5 + 522459795/481036337152*n^6 + 303630087/240518168576*n^7 - 1091940219/481036337152*n^8 + 33522753/30064771072*n^9 + 40499933/68719476736*n^10 - 324917351/240518168576*n^11) * eps^18
+        + (96292605/137438953472 - 65462715/68719476736*n - 97786455/137438953472*n^2 + 85607565/68719476736*n^3 + 359327175/481036337152*n^4 - 762768759/481036337152*n^5 - 159920877/481036337152*n^6 + 852547365/481036337152*n^7 - 189618327/481036337152*n^8 - 831922211/481036337152*n^9 + 903295221/481036337152*n^10) * eps^19
+        + (177052965/274877906944 - 198593385/274877906944*n - 120299805/137438953472*n^2 + 850632495/962072674304*n^3 + 255130545/240518168576*n^4 - 1668127191/1924145348608*n^5 - 2324152365/1924145348608*n^6 + 2128566621/1924145348608*n^7 + 2025323859/1924145348608*n^8 - 2724276899/1924145348608*n^9) * eps^20
+        + (338946975/549755813888 - 82552875/137438953472*n - 471549795/549755813888*n^2 + 446058513/962072674304*n^3 + 4645483323/3848290697216*n^4 - 514236729/1924145348608*n^5 - 2539636863/1924145348608*n^6 + 110256645/1924145348608*n^7 + 2860511727/1924145348608*n^8) * eps^21
+        + (2519012745/4398046511104 - 8042808615/17592186044416*n - 15323258283/17592186044416*n^2 + 13365078339/61572651155456*n^3 + 2371903421/2199023255552*n^4 + 34764704609/123145302310912*n^5 - 139920418129/123145302310912*n^6 - 38482766489/61572651155456*n^7) * eps^22
+        + (19248770055/35184372088832 - 6660671445/17592186044416*n - 28084233477/35184372088832*n^2 - 4351178653/123145302310912*n^3 + 236611923917/246290604621824*n^4 + 68150566051/123145302310912*n^5 - 172847147773/246290604621824*n^6) * eps^23
+        + (36031799979/70368744177664 - 5033314047/17592186044416*n - 107266336785/140737488355328*n^2 - 20083658499/123145302310912*n^3 + 727351416229/985162418487296*n^4 + 46669684549/61572651155456*n^5) * eps^24
+        + (34437446319/70368744177664 - 33102303575/140737488355328*n - 187327049/274877906944*n^2 - 290583351929/985162418487296*n^3 + 10224940189/17592186044416*n^4) * eps^25
+        + (259380435671/562949953421312 - 195750751369/1125899906842624*n - 713851834615/1125899906842624*n^2 - 2727777187263/7881299347898368*n^3) * eps^26
+        + (993200127657/2251799813685248 - 158323530281/1125899906842624*n - 631656315671/1125899906842624*n^2) * eps^27
+        + (13155294584639/31525197391593472 - 13930847115/140737488355328*n) * eps^28
+        + 112658685443/281474976710656 * eps^29;
+C3[15] = + (646323/1073741824 - 1710855/1073741824*n + 2217775/1073741824*n^2 - 2124395/1073741824*n^3 + 1638819/1073741824*n^4 - 1049191/1073741824*n^5 + 563615/1073741824*n^6 - 254475/1073741824*n^7 + 96135/1073741824*n^8 - 150423/5368709120*n^9 + 38367/5368709120*n^10 - 4669/3221225472*n^11 + 725/3221225472*n^12 - 27/1073741824*n^13 + 29/16106127360*n^14) * eps^15
+        + (1710855/2147483648 - 2217775/1073741824*n + 2331165/1073741824*n^2 - 1059863/1073741824*n^3 - 563615/1073741824*n^4 + 1586793/1073741824*n^5 - 1732315/1073741824*n^6 + 1306305/1073741824*n^7 - 3776409/5368709120*n^8 + 346173/1073741824*n^9 - 1902313/16106127360*n^10 + 36917/1073741824*n^11 - 25153/3221225472*n^12 + 21547/16106127360*n^13) * eps^16
+        + (5892945/8589934592 - 6800065/4294967296*n + 3577121/4294967296*n^2 + 4983157/4294967296*n^3 - 10069699/4294967296*n^4 + 7701733/4294967296*n^5 - 502541/2147483648*n^6 - 1414127/1342177280*n^7 + 968223/671088640*n^8 - 6128483/5368709120*n^9 + 41761247/64424509440*n^10 - 18009853/64424509440*n^11 + 5979931/64424509440*n^12) * eps^17
+        + (5972985/8589934592 - 5892945/4294967296*n + 22011/134217728*n^2 + 6844087/4294967296*n^3 - 5882157/4294967296*n^4 - 326337/536870912*n^5 + 18126537/8589934592*n^6 - 18908667/10737418240*n^7 + 2622383/10737418240*n^8 + 21415079/21474836480*n^9 - 55870711/42949672960*n^10 + 4095751/4294967296*n^11) * eps^18
+        + (86853405/137438953472 - 144315455/137438953472*n - 49728185/137438953472*n^2 + 108068645/68719476736*n^3 - 12628253/34359738368*n^4 - 25408437/17179869184*n^5 + 43573631/34359738368*n^6 + 24761157/34359738368*n^7 - 17319235/8589934592*n^8 + 240067131/171798691840*n^9 + 31601183/257698037760*n^10) * eps^19
+        + (168754335/274877906944 - 122304455/137438953472*n - 150252509/274877906944*n^2 + 165190351/137438953472*n^3 + 308731767/687194767360*n^4 - 257790947/171798691840*n^5 + 4546243/68719476736*n^6 + 264538841/171798691840*n^7 - 69252419/85899345920*n^8 - 101279697/85899345920*n^9) * eps^20
+        + (9748205/17179869184 - 2961915/4294967296*n - 789535179/1099511627776*n^2 + 2502565179/2748779069440*n^3 + 892979397/1099511627776*n^4 - 4058500961/4123168604160*n^5 - 348426329/412316860416*n^6 + 858120331/687194767360*n^7 + 2315189833/4123168604160*n^8) * eps^21
+        + (299705865/549755813888 - 638342925/1099511627776*n - 4003125229/5497558138880*n^2 + 3007831367/5497558138880*n^3 + 16848959603/16492674416640*n^4 - 1323821551/2748779069440*n^5 - 9300135223/8246337208320*n^6 + 169736315/412316860416*n^7) * eps^22
+        + (17894468415/35184372088832 - 15913542447/35184372088832*n - 133457144181/175921860444160*n^2 + 56414449099/175921860444160*n^3 + 514339794913/527765581332480*n^4 + 15799330939/527765581332480*n^5 - 116951809217/105553116266496*n^6) * eps^23
+        + (34289203599/70368744177664 - 13355533647/35184372088832*n - 37471080293/52776558133248*n^2 + 8836479539/105553116266496*n^3 + 80449237869/87960930222080*n^4 + 171417192913/527765581332480*n^5) * eps^24
+        + (32203691103/70368744177664 - 249040377061/844424930131968*n - 484768709513/703687441776640*n^2 - 100719650663/2111062325329920*n^3 + 525315006811/703687441776640*n^4) * eps^25
+        + (246854172911/562949953421312 - 104020069985/422212465065984*n - 5286374681359/8444249301319680*n^2 - 384367611317/2111062325329920*n^3) * eps^26
+        + (932306372777/2251799813685248 - 425703913753/2251799813685248*n - 3317960448433/5629499534213120*n^2) * eps^27
+        + (1788762256877/4503599627370496 - 528241493161/3377699720527872*n) * eps^28
+        + 3392857970671/9007199254740992 * eps^29;
+C3[16] = + (17678835/34359738368 - 5892945/4294967296*n + 7753875/4294967296*n^2 - 15197595/8589934592*n^3 + 12096045/8589934592*n^4 - 4032015/4294967296*n^5 + 2278965/4294967296*n^6 - 4382625/17179869184*n^7 + 1788111/17179869184*n^8 - 153729/4294967296*n^9 + 44051/4294967296*n^10 - 20677/8589934592*n^11 + 3875/8589934592*n^12 - 279/4294967296*n^13) * eps^16
+        + (5892945/8589934592 - 7753875/4294967296*n + 33806895/17179869184*n^2 - 2171085/2147483648*n^3 - 5272635/17179869184*n^4 + 2629575/2147483648*n^5 - 49961925/34359738368*n^6 + 315549/268435456*n^7 - 25144131/34359738368*n^8 + 97991/268435456*n^9 - 2539675/17179869184*n^10 + 104315/2147483648*n^11 - 220193/17179869184*n^12) * eps^17
+        + (10235115/17179869184 - 97078515/68719476736*n + 57998985/68719476736*n^2 + 30085035/34359738368*n^3 - 140769915/68719476736*n^4 + 242500755/137438953472*n^5 - 65388765/137438953472*n^6 - 51866007/68719476736*n^7 + 174649629/137438953472*n^8 - 154238733/137438953472*n^9 + 48486449/68719476736*n^10 - 11678227/34359738368*n^11) * eps^18
+        + (83431695/137438953472 - 85292625/68719476736*n + 35047515/137438953472*n^2 + 92601495/68719476736*n^3 - 375786495/274877906944*n^4 - 36110133/137438953472*n^5 + 486541497/274877906944*n^6 - 243255915/137438953472*n^7 + 153035871/274877906944*n^8 + 46310869/68719476736*n^9 - 319425953/274877906944*n^10) * eps^19
+        + (38149065/68719476736 - 133056495/137438953472*n - 123158505/549755813888*n^2 + 3098731635/2199023255552*n^3 - 1178980065/2199023255552*n^4 - 324619011/274877906944*n^5 + 183751105/137438953472*n^6 + 76834833/274877906944*n^7 - 937074355/549755813888*n^8 + 1685222465/1099511627776*n^9) * eps^20
+        + (4652325/8589934592 - 456372855/549755813888*n - 1811480505/4398046511104*n^2 + 1251405303/1099511627776*n^3 + 925958313/4398046511104*n^4 - 1506611625/1099511627776*n^5 + 99867213/274877906944*n^6 + 172997329/137438953472*n^7 - 2305540773/2199023255552*n^8) * eps^21
+        + (1106107125/2199023255552 - 11527530885/17592186044416*n - 10297013847/17592186044416*n^2 + 7988241603/8796093022208*n^3 + 10444117217/17592186044416*n^4 - 18068838281/17592186044416*n^5 - 4569806627/8796093022208*n^6 + 11141677047/8796093022208*n^7) * eps^22
+        + (17062152465/35184372088832 - 9812616465/17592186044416*n - 21645687783/35184372088832*n^2 + 10515729759/17592186044416*n^3 + 29676530299/35184372088832*n^4 - 2748637785/4398046511104*n^5 - 31988983111/35184372088832*n^6) * eps^23
+        + (63917467893/140737488355328 - 15585334599/35184372088832*n - 92640075585/140737488355328*n^2 + 55477610943/140737488355328*n^3 + 60444721971/70368744177664*n^4 - 23535121849/140737488355328*n^5) * eps^24
+        + (15353322477/35184372088832 - 52919675455/140737488355328*n - 176994259657/281474976710656*n^2 + 24691209499/140737488355328*n^3 + 119255343701/140737488355328*n^4) * eps^25
+        + (231447333341/562949953421312 - 336197745329/1125899906842624*n - 697975437421/1125899906842624*n^2 + 51290363939/1125899906842624*n^3) * eps^26
+        + (889178086077/2251799813685248 - 284507373851/1125899906842624*n - 644017953049/1125899906842624*n^2) * eps^27
+        + (1683573628847/4503599627370496 - 897506094655/4503599627370496*n) * eps^28
+        + 3236675038231/9007199254740992 * eps^29;
+C3[17] = + (64822395/146028888064 - 10235115/8589934592*n + 3411705/2147483648*n^2 - 3411705/2147483648*n^3 + 2791395/2147483648*n^4 - 1928355/2147483648*n^5 + 2278965/4294967296*n^6 - 1157013/4294967296*n^7 + 504339/4294967296*n^8 - 187891/4294967296*n^9 + 29667/2147483648*n^10 - 7843/2147483648*n^11 + 1705/2147483648*n^12) * eps^17
+        + (10235115/17179869184 - 3411705/2147483648*n + 30705345/17179869184*n^2 - 2171085/2147483648*n^3 - 148335/1073741824*n^4 + 4328685/4294967296*n^5 - 11184459/8589934592*n^6 + 4819539/4294967296*n^7 - 801009/1073741824*n^8 + 860343/2147483648*n^9 - 1518473/8589934592*n^10 + 138105/2147483648*n^11) * eps^18
+        + (71645805/137438953472 - 173996955/137438953472*n + 115067505/137438953472*n^2 + 89230245/137438953472*n^3 - 122538195/68719476736*n^4 + 116788191/68719476736*n^5 - 44648835/68719476736*n^6 - 34126939/68719476736*n^7 + 75175279/68719476736*n^8 - 73970743/68719476736*n^9 + 51014623/68719476736*n^10) * eps^19
+        + (146703315/274877906944 - 154767345/137438953472*n + 43785795/137438953472*n^2 + 156007965/137438953472*n^3 - 364998495/274877906944*n^4 + 115971/68719476736*n^5 + 24948149/17179869184*n^6 - 117523573/68719476736*n^7 + 53786953/68719476736*n^8 + 26103457/68719476736*n^9) * eps^20
+        + (134917425/274877906944 - 982018155/1099511627776*n - 128013105/1099511627776*n^2 + 172486635/137438953472*n^3 - 712641795/1099511627776*n^4 - 1003151847/1099511627776*n^5 + 365003889/274877906944*n^6 - 17906623/274877906944*n^7 - 94572227/68719476736*n^8) * eps^21
+        + (1057102635/2199023255552 - 850997895/1099511627776*n - 663815307/2199023255552*n^2 + 1169497413/1099511627776*n^3 + 49560971/2199023255552*n^4 - 669423269/549755813888*n^5 + 1259901225/2199023255552*n^6 + 266092003/274877906944*n^7) * eps^22
+        + (15777490455/35184372088832 - 21840324879/35184372088832*n - 16655962689/35184372088832*n^2 + 31191967407/35184372088832*n^3 + 14292320879/35184372088832*n^4 - 35796602007/35184372088832*n^5 - 8516465049/35184372088832*n^6) * eps^23
+        + (30518839359/70368744177664 - 18775799295/35184372088832*n - 9098510199/17592186044416*n^2 + 21950540481/35184372088832*n^3 + 93296577/137438953472*n^4 - 25028086871/35184372088832*n^5) * eps^24
+        + (28684124199/70368744177664 - 121237396839/281474976710656*n - 80108249325/140737488355328*n^2 + 62476546353/140737488355328*n^3 + 104269770907/140737488355328*n^4) * eps^25
+        + (221067686111/562949953421312 - 51971219667/140737488355328*n - 312369078125/562949953421312*n^2 + 34424571581/140737488355328*n^3) * eps^26
+        + (835594467657/2251799813685248 - 672205282129/2251799813685248*n - 9778893735/17592186044416*n^2) * eps^27
+        + (1608685463477/4503599627370496 - 1123143299/4398046511104*n) * eps^28
+        + 3053457067201/9007199254740992 * eps^29;
+C3[18] = + (39803225/103079215104 - 71645805/68719476736*n + 96664975/68719476736*n^2 - 12302815/8589934592*n^3 + 10316025/8589934592*n^4 - 29419775/34359738368*n^5 + 18079789/34359738368*n^6 - 4814145/17179869184*n^7 + 20005447/154618822656*n^8 - 15970735/309237645312*n^9 + 608685/34359738368*n^10 - 133331/25769803776*n^11) * eps^18
+        + (71645805/137438953472 - 96664975/68719476736*n + 223621755/137438953472*n^2 - 68391425/68719476736*n^3 - 534905/68719476736*n^4 + 28288833/34359738368*n^5 - 79700845/68719476736*n^6 + 328110727/309237645312*n^7 - 51427295/68719476736*n^8 + 132652751/309237645312*n^9 - 42045641/206158430208*n^10) * eps^19
+        + (126233085/274877906944 - 313153165/274877906944*n + 450214705/549755813888*n^2 + 128894125/274877906944*n^3 - 851033855/549755813888*n^4 + 27708079/17179869184*n^5 - 635023933/824633720832*n^6 - 10743949/38654705664*n^7 + 2277775685/2473901162496*n^8 - 39095495/38654705664*n^9) * eps^20
+        + (259599735/549755813888 - 563308905/549755813888*n + 6216585/17179869184*n^2 + 523725935/549755813888*n^3 - 696028275/549755813888*n^4 + 248241769/1236950581248*n^5 + 360205027/309237645312*n^6 - 1324703563/824633720832*n^7 + 578515831/618475290624*n^8) * eps^21
+        + (1919738085/4398046511104 - 14510296015/17592186044416*n - 571757707/17592186044416*n^2 + 9787185553/8796093022208*n^3 - 14198943547/19791209299968*n^4 - 35731280915/52776558133248*n^5 + 200707555277/158329674399744*n^6 - 1602798301/4947802324992*n^7) * eps^22
+        + (15095149455/35184372088832 - 12695123317/17592186044416*n - 7461993973/35184372088832*n^2 + 17320543045/17592186044416*n^3 - 38933502733/316659348799488*n^4 - 167508491351/158329674399744*n^5 + 225029316355/316659348799488*n^6) * eps^23
+        + (28276211939/70368744177664 - 10324749795/17592186044416*n - 160063685731/422212465065984*n^2 + 44977263973/52776558133248*n^3 + 34943975527/140737488355328*n^4 - 76982106281/79164837199872*n^5) * eps^24
+        + (27428616759/70368744177664 - 214928208341/422212465065984*n - 1901680771/4398046511104*n^2 + 266821592123/422212465065984*n^3 + 168025657159/316659348799488*n^4) * eps^25
+        + (206917174391/562949953421312 - 1407328813243/3377699720527872*n - 1656940587997/3377699720527872*n^2 + 1604700872215/3377699720527872*n^3) * eps^26
+        + (799328663817/2251799813685248 - 405743161697/1125899906842624*n - 17171897611/35184372088832*n^2) * eps^27
+        + (1514801868617/4503599627370496 - 1997506016729/6755399441055744*n) * eps^28
+        + 1461210130553/4503599627370496 * eps^29;
+C3[19] = + (883631595/2611340115968 - 126233085/137438953472*n + 172136025/137438953472*n^2 - 178123365/137438953472*n^3 + 76338585/68719476736*n^4 - 55981629/68719476736*n^5 + 35624673/68719476736*n^6 - 19791485/68719476736*n^7 + 9613007/68719476736*n^8 - 4075291/68719476736*n^9 + 1501423/68719476736*n^10) * eps^19
+        + (126233085/274877906944 - 172136025/137438953472*n + 204068505/137438953472*n^2 - 133218315/137438953472*n^3 + 25446195/274877906944*n^4 + 45803151/68719476736*n^5 - 70683875/68719476736*n^6 + 68421991/68719476736*n^7 - 12732847/17179869184*n^8 + 30944913/68719476736*n^9) * eps^20
+        + (447553665/1099511627776 - 282901815/274877906944*n + 1744810665/2199023255552*n^2 + 714788607/2199023255552*n^3 - 2949064317/2199023255552*n^4 + 3330058719/2199023255552*n^5 - 466513575/549755813888*n^6 - 52627801/549755813888*n^7 + 415894171/549755813888*n^8) * eps^21
+        + (231011535/549755813888 - 2056152345/2199023255552*n + 1715472699/4398046511104*n^2 + 1751396739/2199023255552*n^3 - 2620093247/2199023255552*n^4 + 381959029/1099511627776*n^5 + 4006284039/4398046511104*n^6 - 811840865/549755813888*n^7) * eps^22
+        + (13730467455/35184372088832 - 26834758935/35184372088832*n + 1154658519/35184372088832*n^2 + 34587765501/35184372088832*n^3 - 26560472237/35184372088832*n^4 - 16713828219/35184372088832*n^5 + 41375557803/35184372088832*n^6) * eps^23
+        + (27079840719/70368744177664 - 23683023159/35184372088832*n - 4885170495/35184372088832*n^2 + 31837181505/35184372088832*n^3 - 8213174937/35184372088832*n^4 - 31695410011/35184372088832*n^5) * eps^24
+        + (25457271579/70368744177664 - 156005632095/281474976710656*n - 10545202575/35184372088832*n^2 + 114004448877/140737488355328*n^3 + 16505168273/140737488355328*n^4) * eps^25
+        + (198096366191/562949953421312 - 17051245797/35184372088832*n - 202196269517/562949953421312*n^2 + 44120523793/70368744177664*n^3) * eps^26
+        + (749484543777/2251799813685248 - 904154339527/2251799813685248*n - 237166138569/562949953421312*n^2) * eps^27
+        + (1451001339947/4503599627370496 - 197052059395/562949953421312*n) * eps^28
+        + 11027253546199/36028797018963968 * eps^29;
+C3[20] = + (328206021/1099511627776 - 447553665/549755813888*n + 616197075/549755813888*n^2 - 2588027715/2199023255552*n^3 + 11313378297/10995116277760*n^4 - 1063650951/1374389534720*n^5 + 139671337/274877906944*n^6 - 161159235/549755813888*n^7 + 81876301/549755813888*n^8 - 91508807/1374389534720*n^9) * eps^20
+        + (447553665/1099511627776 - 616197075/549755813888*n + 5973868485/4398046511104*n^2 - 5151407547/5497558138880*n^3 + 745124463/4398046511104*n^4 + 2933098077/5497558138880*n^5 - 999187257/1099511627776*n^6 + 255261409/274877906944*n^7 - 3993414699/5497558138880*n^8) * eps^21
+        + (797813055/2199023255552 - 16416787335/17592186044416*n + 67175859231/87960930222080*n^2 + 9242357391/43980465111040*n^3 - 102015059749/87960930222080*n^4 + 124091978953/87960930222080*n^5 - 39356567111/43980465111040*n^6 + 592399119/10995116277760*n^7) * eps^22
+        + (13225535115/35184372088832 - 15052072971/17592186044416*n + 71611679859/175921860444160*n^2 + 58313997297/87960930222080*n^3 - 195393281759/175921860444160*n^4 + 4977760923/10995116277760*n^5 + 24290150905/35184372088832*n^6) * eps^23
+        + (24669936369/70368744177664 - 12424628601/17592186044416*n + 11746262979/140737488355328*n^2 + 30472467141/35184372088832*n^3 - 541082739303/703687441776640*n^4 - 214208596351/703687441776640*n^5) * eps^24
+        + (24401503959/70368744177664 - 88423598371/140737488355328*n - 27848548649/351843720888320*n^2 + 582032816309/703687441776640*n^3 - 443970412913/1407374883553280*n^4) * eps^25
+        + (184144866101/562949953421312 - 73617505285/140737488355328*n - 163863036307/703687441776640*n^2 + 4297898591023/5629499534213120*n^3) * eps^26
+        + (89787248319/281474976710656 - 64845907663/140737488355328*n - 3332997588781/11258999068426240*n^2) * eps^27
+        + (10901346434011/36028797018963968 - 6951464328397/18014398509481984*n) * eps^28
+        + 10575447871909/36028797018963968 * eps^29;
+C3[21] = + (2038855585/7696581394432 - 797813055/1099511627776*n + 2216147375/2199023255552*n^2 - 2357980807/2199023255552*n^3 + 2098862037/2199023255552*n^4 - 4845520999/6597069766656*n^5 + 5726524817/11544872091648*n^6 - 1139229075/3848290697216*n^7 + 258225257/1649267441664*n^8) * eps^21
+        + (797813055/2199023255552 - 2216147375/2199023255552*n + 5478316311/4398046511104*n^2 - 1981576699/2199023255552*n^3 + 751444433/3298534883328*n^4 + 3238984625/7696581394432*n^5 - 10556856095/13194139533312*n^6 + 9949267255/11544872091648*n^7) * eps^22
+        + (11435320455/35184372088832 - 29873666615/35184372088832*n + 25744131691/35184372088832*n^2 + 4163629499/35184372088832*n^3 - 739894554773/738871813865472*n^4 + 965405949493/738871813865472*n^5 - 677248006993/738871813865472*n^6) * eps^23
+        + (23774829039/70368744177664 - 27620697099/35184372088832*n + 10971634235/26388279066624*n^2 + 405631341473/738871813865472*n^3 - 126601433727/123145302310912*n^4 + 129456725059/246290604621824*n^5) * eps^24
+        + (22261029909/70368744177664 - 553102652395/844424930131968*n + 8620472343/70368744177664*n^2 + 2249783201615/2955487255461888*n^3 - 2263819350305/2955487255461888*n^4) * eps^25
+        + (176646720641/562949953421312 - 123911959597/211106232532992*n - 51597036833/1688849860263936*n^2 + 39733441489/52776558133248*n^3) * eps^26
+        + (1337288787659/4503599627370496 - 2222831651699/4503599627370496*n - 795233577023/4503599627370496*n^2) * eps^27
+        + (2614429242859/9007199254740992 - 5913700976995/13510798882111488*n) * eps^28
+        + 9945743757025/36028797018963968 * eps^29;
+C3[22] = + (11435320455/48378511622144 - 11435320455/17592186044416*n + 16009448637/17592186044416*n^2 - 8620472343/8796093022208*n^3 + 7799474977/8796093022208*n^4 - 12256317821/17592186044416*n^5 + 8491054039/17592186044416*n^6 - 653158003/2199023255552*n^7) * eps^22
+        + (11435320455/35184372088832 - 16009448637/17592186044416*n + 40287513603/35184372088832*n^2 - 15188451271/17592186044416*n^3 + 9558755047/35184372088832*n^4 + 5724737791/17592186044416*n^5 - 24704740937/35184372088832*n^6) * eps^23
+        + (20583576819/70368744177664 - 27268841085/35184372088832*n + 98343755913/140737488355328*n^2 + 1583352063/35184372088832*n^3 - 121489410719/140737488355328*n^4 + 21194269441/17592186044416*n^5) * eps^24
+        + (10731608427/35184372088832 - 101627745377/140737488355328*n + 14719309919/35184372088832*n^2 + 63574719679/140737488355328*n^3 - 66603916857/70368744177664*n^4) * eps^25
+        + (322710607507/1125899906842624 - 1370068675847/2251799813685248*n + 343057591489/2251799813685248*n^2 + 751691842047/1125899906842624*n^3) * eps^26
+        + (1283746667079/4503599627370496 - 1236043889089/2251799813685248*n + 40279424959/4503599627370496*n^2) * eps^27
+        + (2436782869279/9007199254740992 - 4195124656575/9007199254740992*n) * eps^28
+        + 4774615334345/18014398509481984 * eps^29;
+C3[23] = + (171529806825/809240558043136 - 20583576819/35184372088832*n + 29028121155/35184372088832*n^2 - 31608398591/35184372088832*n^3 + 29028121155/35184372088832*n^4 - 23244740695/35184372088832*n^5 + 16482634311/35184372088832*n^6) * eps^23
+        + (20583576819/70368744177664 - 29028121155/35184372088832*n + 37120809477/35184372088832*n^2 - 29028121155/35184372088832*n^3 + 10699253851/35184372088832*n^4 + 8608339377/35184372088832*n^5) * eps^24
+        + (74417546961/281474976710656 - 99868465307/140737488355328*n + 46855492531/70368744177664*n^2 - 475207835/35184372088832*n^3 - 26136430925/35184372088832*n^4) * eps^25
+        + (77818821763/281474976710656 - 46855492531/70368744177664*n + 117206473721/281474976710656*n^2 + 25946347791/70368744177664*n^3) * eps^26
+        + (1173967590711/4503599627370496 - 2549380838081/4503599627370496*n + 787609465729/4503599627370496*n^2) * eps^27
+        + (2340726177457/9007199254740992 - 2314357198017/4503599627370496*n) * eps^28
+        + 556913250205/2251799813685248 * eps^29;
+C3[24] = + (107492012277/562949953421312 - 74417546961/140737488355328*n + 316963625945/422212465065984*n^2 - 697319977079/844424930131968*n^3 + 216409648059/281474976710656*n^4 - 264500680961/422212465065984*n^5) * eps^24
+        + (74417546961/281474976710656 - 316963625945/422212465065984*n + 548484883157/562949953421312*n^2 - 41533164779/52776558133248*n^3 + 553046878373/1688849860263936*n^4) * eps^25
+        + (135054066707/562949953421312 - 4401660092471/6755399441055744*n + 4279816803577/6755399441055744*n^2 - 202913745545/3377699720527872*n^3) * eps^26
+        + (1132800437073/4503599627370496 - 1385801088427/2251799813685248*n + 1851694849861/4503599627370496*n^2) * eps^27
+        + (1071403584791/4503599627370496 - 7127072067763/13510798882111488*n) * eps^28
+        + 1045457237/4398046511104 * eps^29;
+C3[25] = + (1215486600363/7036874417766400 - 135054066707/281474976710656*n + 96467190505/140737488355328*n^2 - 107111846009/140737488355328*n^3 + 504955845471/703687441776640*n^4) * eps^25
+        + (135054066707/562949953421312 - 96467190505/140737488355328*n + 507617009347/562949953421312*n^2 - 527575738417/703687441776640*n^3) * eps^26
+        + (983965343151/4503599627370496 - 2701746625109/4503599627370496*n + 13560625821127/22517998136852480*n^2) * eps^27
+        + (2068389622621/9007199254740992 - 2567357849371/4503599627370496*n) * eps^28
+        + 1961943067581/9007199254740992 * eps^29;
+C3[26] = + (2295919134019/14636698788954112 - 983965343151/2251799813685248*n + 1413743309125/2251799813685248*n^2 - 395848126555/562949953421312*n^3) * eps^26
+        + (983965343151/4503599627370496 - 1413743309125/2251799813685248*n + 3766212175509/4503599627370496*n^2) * eps^27
+        + (1798281489207/9007199254740992 - 4987686394593/9007199254740992*n) * eps^28
+        + 3788832068455/18014398509481984 * eps^29;
+C3[27] = + (17383387729001/121597189939003392 - 1798281489207/4503599627370496*n + 7792553119897/13510798882111488*n^2) * eps^27
+        + (1798281489207/9007199254740992 - 7792553119897/13510798882111488*n) * eps^28
+        + 6593698793759/36028797018963968 * eps^29;
+C3[28] = + (4709784852685/36028797018963968 - 6593698793759/18014398509481984*n) * eps^28
+        + 6593698793759/36028797018963968 * eps^29;
+C3[29] = + 125280277081421/1044835113549955072 * eps^29;
+
+C4[0] = + (2/3 - 4/15*n + 8/105*n^2 + 4/315*n^3 + 16/3465*n^4 + 20/9009*n^5 + 8/6435*n^6 + 28/36465*n^7 + 32/62985*n^8 + 4/11305*n^9 + 40/156009*n^10 + 44/229425*n^11 + 16/108675*n^12 + 52/450225*n^13 + 56/606825*n^14 + 20/267003*n^15 + 64/1038345*n^16 + 68/1324785*n^17 + 8/185185*n^18 + 76/2070705*n^19 + 80/2544009*n^20 + 28/1031355*n^21 + 88/3728745*n^22 + 92/4456305*n^23 + 32/1761795*n^24 + 100/6225009*n^25 + 104/7284585*n^26 + 12/941545*n^27 + 112/9803145*n^28 + 116/11282865*n^29)
+        - (1/5 - 16/35*n + 32/105*n^2 - 16/385*n^3 - 64/15015*n^4 - 16/15015*n^5 - 32/85085*n^6 - 112/692835*n^7 - 128/1616615*n^8 - 144/3380195*n^9 - 32/1300075*n^10 - 176/11700675*n^11 - 64/6653325*n^12 - 208/32566275*n^13 - 224/51175575*n^14 - 16/5191725*n^15 - 256/115256295*n^16 - 272/166481315*n^17 - 288/235370135*n^18 - 304/326481155*n^19 - 64/89040315*n^20 - 112/199280705*n^21 - 352/791736855*n^22 - 368/1035348195*n^23 - 128/446125645*n^24 - 16/68475099*n^25 - 416/2168378135*n^26 - 432/2722006595*n^27 - 448/3388620455*n^28) * eps
+        - (2/105 + 32/315*n - 1088/3465*n^2 + 1184/5005*n^3 - 128/3465*n^4 - 3232/765765*n^5 - 1856/1616615*n^6 - 6304/14549535*n^7 - 65792/334639305*n^8 - 288/2860165*n^9 - 25664/456326325*n^10 - 34144/1017958725*n^11 - 73856/3506302275*n^12 - 281632/20419054425*n^13 - 10048/1074687075*n^14 - 28832/4418157975*n^15 - 20992/4494995505*n^16 - 48416/14176524285*n^17 - 747072/293506558345*n^18 - 175712/91088242245*n^19 - 204928/138101528565*n^20 - 11296/9764754545*n^21 - 104896/114923649645*n^22 - 1558112/2140064719065*n^23 - 118016/201202665895*n^24 - 80032/167832467649*n^25 - 450112/1151408789685*n^26 - 2520288/7803992907865*n^27) * eps^2
+        + (11/315 - 368/3465*n - 32/6435*n^2 + 976/4095*n^3 - 154048/765765*n^4 + 368/11115*n^5 + 5216/1322685*n^6 + 372208/334639305*n^7 + 13184/30421755*n^8 + 29008/143416845*n^9 + 15459424/145568097675*n^10 + 24876368/410237366175*n^11 + 107584/2917007775*n^12 + 8182096/347123925225*n^13 + 1076896/68682273975*n^14 + 5572816/516924483075*n^15 + 419584/55049100795*n^16 + 3975824/720425188665*n^17 + 32325856/7924677075315*n^18 + 4950032/1612380184155*n^19 + 10050752/4281147385515*n^20 + 29925872/16434081899235*n^21 + 6663008/4657787917965*n^22 + 141444848/124429477237065*n^23 + 408253312/447273526284585*n^24 + 27307792/36907885385721*n^25 + 261022112/431449322191965*n^26) * eps^3
+        + (4/1155 + 1088/45045*n - 128/1287*n^2 + 64/3927*n^3 + 2877184/14549535*n^4 - 370112/2078505*n^5 + 3369088/111546435*n^6 + 6158272/1673196525*n^7 + 1772032/1673196525*n^8 + 582592/1386362835*n^9 + 69229184/347123925225*n^10 + 479862464/4512611027925*n^11 + 13232896/214886239425*n^12 + 487333184/12843585233325*n^13 + 4097514368/166966608033225*n^14 + 2215403584/134228057438475*n^15 + 22961152/2002940359695*n^16 + 7455695168/911337863661225*n^17 + 3709076864/620766370899675*n^18 + 552729152/124153274179935*n^19 + 7124808448/2110605661058895*n^20 + 23396048576/9000398853481035*n^21 + 353516672/174201268131891*n^22 + 58336832/36371693346219*n^23 + 417179454976/325466035959749685*n^24 + 333125284288/321947484219644283*n^25) * eps^4
+        + (97/15015 - 464/45045*n + 4192/153153*n^2 - 88240/969969*n^3 + 31168/1322685*n^4 + 11513072/66927861*n^5 - 90038048/557732175*n^6 + 56656/2028117*n^7 + 11176576/3234846615*n^8 + 1514798224/1504203675975*n^9 + 364902368/902522205585*n^10 + 875443216/4512611027925*n^11 + 1163297728/11131107202215*n^12 + 65826704/1077203922795*n^13 + 260103719072/6845630929362225*n^14 + 44215340656/1784012908864095*n^15 + 290929029376/17315419409563275*n^16 + 100721472976/8566575918415515*n^17 + 14151520/1674794900961*n^18 + 65554773104/10553028305294475*n^19 + 104193472576/22372420007224287*n^20 + 927092143568/261011566750950015*n^21 + 282176032480/102604546929683799*n^22 + 421431700016/195279621575849811*n^23 + 34028203613312/19853428193544730785*n^24) * eps^5
+        + (10/9009 + 4192/765765*n - 188096/14549535*n^2 + 23392/855855*n^3 - 2550656/30421755*n^4 + 44131552/1673196525*n^5 + 257683264/1673196525*n^6 - 31240736/210054975*n^7 + 451386112/17289697425*n^8 + 14726527328/4512611027925*n^9 + 4331513024/4512611027925*n^10 + 12975935008/33393321606645*n^11 + 31373075584/166966608033225*n^12 + 698039074144/6845630929362225*n^13 + 29703628096/494726268844665*n^14 + 1005634034464/26760193632961425*n^15 + 341277050932736/13835020108241056725*n^16 + 2337486955424/138945682579178475*n^17 + 5486091652672/463373879223384675*n^18 + 110047548877984/12864141504153965025*n^19 + 207975286912/32900617657682775*n^20 + 116341576864/24429654030877095*n^21 + 3202897200884032/877781898983444900445*n^22 + 5239237147019168/1846368821999659963005*n^23) * eps^6
+        + (193/85085 - 6832/2078505*n + 106976/14549535*n^2 - 26672/1956955*n^3 + 521792/19684665*n^4 - 130524976/1673196525*n^5 + 3724256/135917925*n^6 + 3355734064/23876248825*n^7 - 9928194688/71628746475*n^8 + 649052336/26389538175*n^9 + 27235216864/8787716212275*n^10 + 1802925232/1964313035685*n^11 + 56875960256/152125131763605*n^12 + 89961920528/494726268844665*n^13 + 834516960736/8410346570359305*n^14 + 12897954159632/219603493781604075*n^15 + 188320698409216/5097112671457231425*n^16 + 2360065137403504/96845140757687397075*n^17 + 9522329813406688/570310273350825782775*n^18 + 1062828903347216/90048990529077755175*n^19 + 44538234246208/5200397629338836925*n^20 + 15623861307536/2458772826284159385*n^21 + 1934793328169696/402591698030001044565*n^22) * eps^7
+        + (632/1322685 + 3456/1616615*n - 517376/111546435*n^2 + 27264/3380195*n^3 - 13728256/1003917915*n^4 + 337485952/13233463425*n^5 - 3335807744/45581929575*n^6 + 5933931904/214886239425*n^7 + 773057536/5945469075*n^8 - 2417337857408/18551845337025*n^9 + 35074718464/1504203675975*n^10 + 122682333568/41488672299165*n^11 + 5759356066304/6541380665835015*n^12 + 21217115597696/58872425992515135*n^13 + 6327384910592/35935117164262485*n^14 + 45144358136704/467850921534721725*n^15 + 168307641997312/2934701235081436275*n^16 + 114971778089344/3174268682843186175*n^17 + 279118225250048/11638985170425015975*n^18 + 2565033841015936/155539165459316122575*n^19 + 22281895799258624/1904621101567852142475*n^20 + 499531826463207808/58644190679703485491635*n^21) * eps^8
+        + (107/101745 - 4976/3380195*n + 582496/185910725*n^2 - 88112/16787925*n^3 + 241875008/29113619535*n^4 - 60768482384/4512611027925*n^5 + 110550963232/4512611027925*n^6 - 103976595664/1504203675975*n^7 + 80357441408/2929238737425*n^8 + 6763222232848/55655536011075*n^9 - 67861105568/550247643225*n^10 + 2212522672/99570961035*n^11 + 3295501210304/1163486679693975*n^12 + 901465527762928/1064232316018542825*n^13 + 6742139143828448/19369028151537479415*n^14 + 16530402013984624/96845140757687397075*n^15 + 12353373376796416/131610063080959796025*n^16 + 95765418832375792/1710930820052477348325*n^17 + 60673550827813472/1710930820052477348325*n^18 + 81981470164643248/3480859254589522881075*n^19 + 4349006711700386752/267723479189950694635725*n^20) * eps^9
+        + (1270/5148297 + 1376/1300075*n - 9664/4345965*n^2 + 2352160/646969323*n^3 - 1466054528/265447707525*n^4 + 1074734176/128931743655*n^5 - 129362368/9831396575*n^6 + 262162305568/11131107202215*n^7 - 38465435392/585847747485*n^8 + 267247345312/9878255309325*n^9 + 204209273106368/1784012908864095*n^10 - 3241185114016/27616298898825*n^11 + 6531220421504/307137753540705*n^12 + 3098495334496/1138216380768495*n^13 + 6086870028208448/7449626212129799775*n^14 + 38423353322878112/114062054670165156555*n^15 + 40496366139608576/244418688578925335475*n^16 + 665236142568416/7280556681074371695*n^17 + 367678743052291904/6729661225539744236745*n^18 + 30529744338007608544/879662860195552282374525*n^19) * eps^10
+        + (481/841225 - 27632/35102025*n + 238304/145422675*n^2 - 2354704/893763325*n^3 + 1351995712/347123925225*n^4 - 3628654736/644658718275*n^5 + 30646053728/3710369067405*n^6 - 2139721666448/166966608033225*n^7 + 14114295321472/622330084487475*n^8 - 409450644752/6534845820015*n^9 + 10307920635808/387828893231325*n^10 + 3499011467373232/32249464121774025*n^11 - 1206016607114944/10749821373924675*n^12 + 9545159677072/467383537996725*n^13 + 15013719882592/5721927876221025*n^14 + 34656665188077392/43870021026986598675*n^15 + 389398246998784/1192286285750855295*n^16 + 73559957119861936/456764336575095762675*n^17 + 182732593408974929312/2052546673789621992207225*n^18) * eps^11
+        + (2228/15540525 + 36032/59879925*n - 39261056/31556720475*n^2 + 1244864/629988975*n^3 - 12932462848/4512611027925*n^4 + 671728862912/166966608033225*n^5 - 37698002816/6678664321329*n^6 + 11134144068416/1369126185872445*n^7 - 733991428969984/58872425992515135*n^8 + 1232714276672/56337249753603*n^9 - 4429833678464/73797400736325*n^10 + 840415474013504/32249464121774025*n^11 + 3333478527060224/32249464121774025*n^12 - 2666448379438912/24771327513826425*n^13 + 16284062335255936/827736245792199975*n^14 + 333689425966716992/131610063080959796025*n^15 + 15659534365696/20459768715569799*n^16 + 22977355952311693888/72442823780810187960255*n^17) * eps^12
+        + (673/1950975 - 45968/97698825*n + 19761248/20419054425*n^2 - 5684848/3732515325*n^3 + 27973845952/12843585233325*n^4 - 500069826512/166966608033225*n^5 + 372104734816/91275079058163*n^6 - 1627062252976/290011950702045*n^7 + 12698466842752/1591146648446355*n^8 - 172098932532272/14189764213580571*n^9 + 4774693008614176/225746248852418175*n^10 - 13025415886952528/225746248852418175*n^11 + 4848026099408192/189913510939335925*n^12 + 619763904190141936/6267145860998085525*n^13 - 649317315038718944/6267145860998085525*n^14 + 31106397870170704/1637148159767368325*n^15 + 2385779859697408/971669556445713741*n^16) * eps^13
+        + (238/2629575 + 57568/153526725*n - 825536/1074687075*n^2 + 1194848/995395275*n^3 - 283558943872/166966608033225*n^4 + 2715755872/1180892000925*n^5 - 780655005376/254858986980585*n^6 + 171825550350112/42051732851796525*n^7 - 996847690701056/179675585821312425*n^8 + 1628471419526944/208269119909005155*n^9 - 29311863367971392/2483208737376599925*n^10 + 10654809266315936/520197877790354925*n^11 - 2080206830396032/37399847422835975*n^12 + 156667139836595552/6267145860998085525*n^13 + 187740421210774336/1977334790368379925*n^14 - 44223083570335579744/442263881445727643225*n^15) * eps^14
+        + (299/1335015 - 14192/46725525*n + 4932448/7952684355*n^2 - 19928240/20676979323*n^3 + 41885845312/30975705562725*n^4 - 106538926231952/58872425992515135*n^5 + 698069390155552/294362129962575675*n^6 - 1222675417496752/395286288806887335*n^7 + 3426171103075456/842131658762499105*n^8 - 1101372339312272/201341248976481075*n^9 + 53459494241119136/6983391102255009585*n^10 - 30879408909358352/2685919654713465225*n^11 + 522986071597155776/26322012616191959205*n^12 - 1636740144692612656/30450955771673050845*n^13 + 1047772560655445344/42799730462489771925*n^14) * eps^15
+        + (1072/17651865 + 86272/345768885*n - 11421184/22474977525*n^2 + 16677632/21215118925*n^3 - 18154021888/16569779339295*n^4 + 25154349615872/17315419409563275*n^5 - 70485959553536/37493279426127525*n^6 + 17021847805184/7060227510219975*n^7 - 300116388621985792/96845140757687397075*n^8 + 53507403275733248/13263029612809901925*n^9 - 4780406888960512/887872765984679475*n^10 + 2564172609357098752/342186164010495469665*n^11 - 1706337226816984064/152254778858365254225*n^12 + 179287783277363696896/9287541510360280507725*n^13) * eps^16
+        + (1153/7507115 - 34544/166481315*n + 3700832/8775943605*n^2 - 1518032/2335595955*n^3 + 14928483904/16569779339295*n^4 - 5708509424/4814305899975*n^5 + 45794146362208/30141656009239775*n^6 - 5643458496441232/2934701235081436275*n^7 + 4156028415620301184/1710930820052477348325*n^8 - 1159757261134928/375451134529839225*n^9 + 525138269596488544/131610063080959796025*n^10 - 6287452560651272656/1187587275095248982955*n^11 + 25307469319858098112/3449658275276675617155*n^12) * eps^17
+        + (2554/59814755 + 41056/235370135*n - 14837824/41929508335*n^2 + 3390304/6234993765*n^3 - 279486378368/372459822539805*n^4 + 42044271006688/42832879592077575*n^5 - 908499403281088/728158953065318775*n^6 + 2673843470669421536/1710930820052477348325*n^7 - 3332038388900879104/1710930820052477348325*n^8 + 594639889428168928/244418688578925335475*n^9 - 309769385066082483008/100944918383096163551175*n^10 + 4852059199993865385248/1231528004273773195324335*n^11) * eps^18
+        + (1441/13114465 - 48336/326481155*n + 9106016/30362747415*n^2 - 13405488/29164499455*n^3 + 235380121664/372459822539805*n^4 - 2367311016464/2878098628716675*n^5 + 404878095158752/389822469822847425*n^6 - 116162066506295792/90048990529077755175*n^7 + 247341466765626752/155539165459316122575*n^8 - 65920898026272999856/33648306127698721183725*n^9 + 14943489055072437854816/6157640021368865976621675*n^10) * eps^19
+        + (10540/338353197 + 33856/267120945*n - 7082368/27620305713*n^2 + 261152960/665956259969*n^3 - 7940593572608/14774239627412265*n^4 + 916716116672/1316024706307311*n^5 - 163090405515904/186436833393535725*n^6 + 10548437608477504/9776747543157013419*n^7 - 26616602067570450944/20188983676619232710235*n^8 + 173518074547495685824/108028772304716946958275*n^9) * eps^20
+        + (587/7219485 - 196112/1793526345*n + 3884000/17576558181*n^2 - 637552/1890061173*n^3 + 12449720852672/27001196560443105*n^4 - 466255241229968/783034700252850045*n^5 + 527323603107424/708459966895435755*n^6 - 572248526956172944/626987070702460643175*n^7 + 973916019063553575808/879662860195552282374525*n^8) * eps^21
+        + (1562/66703105 + 225632/2375210565*n - 286544192/1494007445385*n^2 + 84782368/290045401485*n^3 - 49602255488/124429477237065*n^4 + 263298573036064/513022734648418995*n^5 - 186977038393815616/292593966327814966815*n^6 + 5964364063236744416/7649242262570019846735*n^7) * eps^22
+        + (2113/34165005 - 257968/3106044585*n + 358566688/2140064719065*n^2 - 106220624/416550139005*n^3 + 5743685513024/16549120472529645*n^4 - 435137683275536/976398107879249055*n^5 + 340361707744440224/615456273999886654335*n^6) * eps^23
+        + (3656/202606425 + 293248/4015130805*n - 38087936/258689141865*n^2 + 43924864/196258677615*n^3 - 1343496883712/4418090985878955*n^4 + 80846540749696/207527123974335165*n^5) * eps^24
+        + (2497/51875075 - 13264/205425297*n + 3118880/23976066807*n^2 - 810041200/4100876153969*n^3 + 86272944083264/321947484219644283*n^4) * eps^25
+        + (4654/327806325 + 124384/2168378135*n - 44329792/383802929895*n^2 + 65844896/375780173615*n^3) * eps^26
+        + (971/25421715 - 139344/2722006595*n + 804004512/7803992907865*n^2) * eps^27
+        + (29092/2558620845 + 155456/3388620455*n) * eps^28
+        + 3361/109067695 * eps^29;
+C4[1] = + (1/45 - 16/315*n + 32/945*n^2 - 16/3465*n^3 - 64/135135*n^4 - 16/135135*n^5 - 32/765765*n^6 - 112/6235515*n^7 - 128/14549535*n^8 - 16/3380195*n^9 - 32/11700675*n^10 - 176/105306075*n^11 - 64/59879925*n^12 - 208/293096475*n^13 - 224/460580175*n^14 - 16/46725525*n^15 - 256/1037306655*n^16 - 272/1498331835*n^17 - 32/235370135*n^18 - 304/2938330395*n^19 - 64/801362835*n^20 - 112/1793526345*n^21 - 352/7125631695*n^22 - 368/9318133755*n^23 - 128/4015130805*n^24 - 16/616275891*n^25 - 416/19515403215*n^26 - 48/2722006595*n^27 - 448/30497584095*n^28) * eps
+        - (2/105 - 64/945*n + 128/1485*n^2 - 1984/45045*n^3 + 256/45045*n^4 + 64/109395*n^5 + 128/855855*n^6 + 2368/43648605*n^7 + 24064/1003917915*n^8 + 64/5311735*n^9 + 9088/1368978975*n^10 + 704/179639775*n^11 + 11008/4508102925*n^12 + 10816/6806351475*n^13 + 128/119409675*n^14 + 29632/39763421775*n^15 + 1024/1926426645*n^16 + 214336/552884447115*n^17 + 84608/293506558345*n^18 + 8512/39037818105*n^19 + 69376/414304585695*n^20 + 11456/87882790905*n^21 + 153472/1494007445385*n^22 + 1472/17983737135*n^23 + 119296/1810823993055*n^24 + 26944/503497402947*n^25 + 21632/493460909865*n^26 + 282432/7803992907865*n^27) * eps^2
+        - (1/105 - 16/2079*n - 5792/135135*n^2 + 3568/45045*n^3 - 103744/2297295*n^4 + 264464/43648605*n^5 + 544/855855*n^6 + 165328/1003917915*n^7 + 303488/5019589575*n^8 + 135664/5019589575*n^9 + 6000928/436704293025*n^10 + 554224/72394829325*n^11 + 63424/13884957009*n^12 + 598832/208274355135*n^13 + 4282016/2266515041175*n^14 + 664784/516924483075*n^15 + 57332992/63581711418225*n^16 + 77073104/118870156129725*n^17 + 3775712/7924677075315*n^18 + 132893296/372459822539805*n^19 + 3489344/12843442156545*n^20 + 3450352/16434081899235*n^21 + 39053344/237547183816215*n^22 + 20023984/153707001292845*n^23 + 9334144/89454705256917*n^24 + 102792464/1217960217728793*n^25 + 124807072/1812087153206253*n^26) * eps^3
+        + (4/1155 - 2944/135135*n + 256/9009*n^2 + 17536/765765*n^3 - 3053056/43648605*n^4 + 1923968/43648605*n^5 - 2061568/334639305*n^6 - 1104256/1673196525*n^7 - 289792/1673196525*n^8 - 3114112/48522699225*n^9 - 391369984/13537833083775*n^10 - 98944/6685349671*n^11 - 7490048/902522205585*n^12 - 7679360/1541230227999*n^13 - 316086016/100179964819935*n^14 - 839709568/402684172315425*n^15 - 433629184/303779287887075*n^16 - 2751201664/2734013590983675*n^17 - 451501312/620766370899675*n^18 - 200058752/372459822539805*n^19 - 853023232/2110605661058895*n^20 - 8347485824/27001196560443105*n^21 - 626995456/2613019021978365*n^22 - 35348608/187348533651279*n^23 - 146563836928/976398107879249055*n^24 - 38855441792/321947484219644283*n^25) * eps^4
+        + (1/9009 + 16/19305*n - 2656/153153*n^2 + 65072/2078505*n^3 + 526912/43648605*n^4 - 658160/10567557*n^5 + 14198752/334639305*n^6 - 1812592/295269975*n^7 - 97587328/145568097675*n^8 - 267846032/1504203675975*n^9 - 2119456/31853724903*n^10 - 45372848/1504203675975*n^11 - 2592068672/166966608033225*n^12 - 4380850576/500899824099675*n^13 - 5700161696/1080889094109825*n^14 - 39480194224/11774485198503027*n^15 - 12840471296/5771806469854425*n^16 - 196425584176/128498638776232725*n^17 - 108093549856/99943385714847675*n^18 - 11590396112/14774239627412265*n^19 - 273127762240/469820820151710027*n^20 - 343667608688/783034700252850045*n^21 - 518367866144/1539068203945256985*n^22 - 153626698640/585838864727549433*n^23 - 38138000512/184397165884316385*n^24) * eps^5
+        + (10/9009 - 1472/459459*n + 106112/43648605*n^2 - 204352/14549535*n^3 + 4359424/143416845*n^4 + 29558336/5019589575*n^5 - 4479616/79676025*n^6 + 282120896/6931814175*n^7 - 3037689344/501401225325*n^8 - 159800512/237505843575*n^9 - 128742272/712517530725*n^10 - 34081066304/500899824099675*n^11 - 739998464/23852372576175*n^12 - 329429443264/20536892788086675*n^13 - 1144477661056/126155198555389575*n^14 - 1615718080576/294362129962575675*n^15 - 145301040063488/41505060324723170175*n^16 - 39812087684416/17090318957238952425*n^17 - 8181314153344/5097112671457231425*n^18 - 307611729639616/270146971587233265525*n^19 - 9726206064896/11745520503792750675*n^20 - 1307488226368/2125379900686307265*n^21 - 1226010709111168/2633345696950334701335*n^22 - 1983732571347776/5539106465998979889015*n^23) * eps^6
+        + (349/2297295 + 28144/43648605*n - 32288/8729721*n^2 + 375344/111546435*n^3 - 12041408/1003917915*n^4 + 432232496/15058768725*n^5 + 310326496/145568097675*n^6 - 99405970096/1933976154825*n^7 + 17050659712/436704293025*n^8 - 1790101232/300840735195*n^9 - 4867489888/7259417740575*n^10 - 30362471408/166966608033225*n^11 - 472100207296/6845630929362225*n^12 - 1213812473968/38395060429901175*n^13 - 2070794882336/126155198555389575*n^14 - 128880963219824/13835020108241056725*n^15 - 5213913887488/922334673882737115*n^16 - 350085462103024/96845140757687397075*n^17 - 100618233981856/41730020001279935325*n^18 - 1349417396371216/810440914761699796575*n^19 - 18226976199582272/15398377380472296134925*n^20 - 324481362977936/376192242421476385905*n^21 - 309392942008518752/481902262541911250344305*n^22) * eps^7
+        + (632/1322685 - 44288/43648605*n + 52736/47805615*n^2 - 2034944/557732175*n^3 + 3396608/885809925*n^4 - 4651476224/436704293025*n^5 + 376863232/13970931975*n^6 - 521047808/1933976154825*n^7 - 33839405056/712517530725*n^8 + 71989123328/1919156414175*n^9 - 2920335016448/500899824099675*n^10 - 167196416/251311112325*n^11 - 332813237248/1828336210947675*n^12 - 189963362048/2734013590983675*n^13 - 189790575759872/5929294332103310025*n^14 - 1615852457389312/96845140757687397075*n^15 - 2759847897165824/290535422273062191225*n^16 - 89000869775895808/15398377380472296134925*n^17 - 6338477357045248/1710930820052477348325*n^18 - 38129485424793344/15398377380472296134925*n^19 - 53670222315578368/31327733291305705929675*n^20 - 189395928218833664/155234622387450402771975*n^21) * eps^8
+        + (43/479655 + 122576/334639305*n - 2304352/1673196525*n^2 + 2336816/1673196525*n^3 - 12805184/3669783975*n^4 + 54763949168/13537833083775*n^5 - 122726048/12640367025*n^6 + 114617716208/4512611027925*n^7 - 34612052864/18551845337025*n^8 - 2463842008976/55655536011075*n^9 + 247179941367712/6845630929362225*n^10 - 2994094055984/524709679077675*n^11 - 64595765995328/98120709987525225*n^12 - 3099595834864/17073245711527425*n^13 - 20252388370301728/290535422273062191225*n^14 - 94673925881072/2934701235081436275*n^15 - 4125115670603008/244418688578925335475*n^16 - 49466563811083856/5132792460157432044975*n^17 - 1436846393866144/244418688578925335475*n^18 - 381175372440689776/100944918383096163551175*n^19 - 6673125752239886656/2638988580586656847123575*n^20) * eps^9
+        + (1270/5148297 - 34624/77224455*n + 8999296/15058768725*n^2 - 219421376/145568097675*n^3 + 245188352/155607276825*n^4 - 8995427648/2707566616755*n^5 + 62537856/15193976525*n^6 - 300772218944/33393321606645*n^7 + 12025681693184/500899824099675*n^8 - 6752231485504/2281876976454075*n^9 - 7341173985537152/176617277977545405*n^10 + 2796003983106368/80280580898884275*n^11 - 5941399696481024/1064232316018542825*n^12 - 692086460430784/1064232316018542825*n^13 - 1345434958946432/7449626212129799775*n^14 - 71571032546168768/1026558492031486408995*n^15 - 45358930642410496/1399852489133845103175*n^16 - 261920528055495616/15398377380472296134925*n^17 - 97300359399296/9989601027520649535*n^18 - 330035192316442762432/55418760192319793789595075*n^19) * eps^10
+        + (15881/295269975 + 3275312/15058768725*n - 290237344/436704293025*n^2 + 3374142608/4512611027925*n^3 - 2324047552/1504203675975*n^4 + 22749713104/13537833083775*n^5 - 9287415008/2929238737425*n^6 + 2059124453296/500899824099675*n^7 - 1828414788736/216177818821965*n^8 + 2236007478391408/98120709987525225*n^9 - 3289422168026144/883086389887727025*n^10 - 1559442395410064/39717761076290115*n^11 + 93137685335849536/2767004021648211345*n^12 - 36715264470352/6721467259064481*n^13 - 395250439858913504/615935095218891845397*n^14 - 920542128392325776/5132792460157432044975*n^15 - 1071330999526287616/15398377380472296134925*n^16 - 69392630410138352/2137657095171448169319*n^17 - 105265368113339870944/6157640021368865976621675*n^18) * eps^11
+        + (2228/15540525 - 6120832/25688487825*n + 691211008/1933976154825*n^2 - 3492371072/4512611027925*n^3 + 208152064/246142419705*n^4 - 773080659584/500899824099675*n^5 + 290139660544/166966608033225*n^6 - 3669101648768/1208052516946275*n^7 + 3589606756281344/883086389887727025*n^8 - 181420012122752/22643240766351975*n^9 + 411019605061888/18926156098824975*n^10 - 37593628401801344/8804103705244308825*n^11 - 48134971208650240/1291268543435831961*n^12 + 857893200414386816/26322012616191959205*n^13 - 9146937940412344064/1710930820052477348325*n^14 - 3175025851183744/5017392434171487825*n^15 - 102210624046413824/574639004078346282075*n^16 - 75317795379180637568/1086642356712152819403825*n^17) * eps^12
+        + (733/21460725 + 5764688/41912795925*n - 3194656/8562829275*n^2 + 185012432/410237366175*n^3 - 2374742464/2862284709141*n^4 + 65055690512/71557117728525*n^5 - 10435905969184/6845630929362225*n^6 + 74203317689008/42051732851796525*n^7 - 83189743940224/28486657738313775*n^8 + 970218654799696/242719651021772925*n^9 - 12979601134119328/1699037557152410475*n^10 + 182872846566647344/8804103705244308825*n^11 - 106352279311029184/22812410934033031311*n^12 - 311872072090752592/8774004205397319735*n^13 + 702432581536430432/22219880779902303225*n^14 - 3453730558896213488/659770708386249434975*n^15 - 677845730256054991616/1086642356712152819403825*n^16) * eps^13
+        + (238/2629575 - 851648/5987542275*n + 458368/1995847425*n^2 - 4444753088/9821565178425*n^3 + 257876621056/500899824099675*n^4 - 926189860672/1080889094109825*n^5 + 16440112590464/17315419409563275*n^6 - 62997095167168/42051732851796525*n^7 + 14708637300203008/8301012064944634035*n^8 - 12992021530058176/4611673369413685575*n^9 + 126514656768577664/32281713585895799025*n^10 - 934589810873408/127665525684801195*n^11 + 2273402066071352576/114062054670165156555*n^12 - 8678130264714688/1754800841079463947*n^13 - 60752587029024640/1785845526459021027*n^14 + 1236016674552098630336/40246013211561215533475*n^15) * eps^14
+        + (1349/59007663 + 569168/6195804615*n - 6094472992/26363148636825*n^2 + 2579500208/8787716212275*n^3 - 10278771378368/20536892788086675*n^4 + 5804486242864/10389251645737965*n^5 - 986666922848/1136533320318825*n^6 + 1154950393173904/1185858866420662005*n^7 - 25102872528546944/17090318957238952425*n^8 + 171093766520283664/96845140757687397075*n^9 - 90252717369684512/33114790065531819645*n^10 + 856168540797233296/223164889572062262825*n^11 - 523921065908336192/74388296524020754275*n^12 + 148934374703642746192/7764993721776627965475*n^13 - 4530223920051850971488/879662860195552282374525*n^14) * eps^15
+        + (1072/17651865 - 1621504/17634213135*n + 25527296/163746264825*n^2 - 103998194176/360296364703275*n^3 + 5248424757248/15492743682240825*n^4 - 467691403586048/883086389887727025*n^5 + 301694693856256/512408152157076175*n^6 - 252813007696723456/290535422273062191225*n^7 + 286904030108225536/290535422273062191225*n^8 - 351698678463165952/244418688578925335475*n^9 + 37866741710291968/21596602216651186725*n^10 - 3343357802501632/1264961585514852225*n^11 + 87427882477068703744/23294981165329883896425*n^12 - 179996219456280053248/26478146293511607161775*n^13) * eps^16
+        + (4105/256743333 + 839312/13080031965*n - 27420423136/178581676418145*n^2 + 69811484144/345901445314425*n^3 - 96146193098048/294362129962575675*n^4 + 15405921597572848/41505060324723170175*n^5 - 2522567523013984/4611673369413685575*n^6 + 58989773513135888/96845140757687397075*n^7 - 13345966126725050752/15398377380472296134925*n^8 + 1699738669400076688/1710930820052477348325*n^9 - 21702598557454157792/15398377380472296134925*n^10 + 1576193121961143720976/908504265447865471960575*n^11 - 2497177697166830532544/972258950742452522624475*n^12) * eps^17
+        + (2554/59814755 - 14367296/228073660815*n + 1013644928/9174446936655*n^2 - 167156355008/853223565108915*n^3 + 84963738158848/360913568041071045*n^4 - 14611840804674368/41505060324723170175*n^5 + 1819399468775296/4611673369413685575*n^6 - 2858231484366780352/5132792460157432044975*n^7 + 837914285761024/1346129677460643075*n^8 - 7953299207910592/9248274702986364045*n^9 + 301043012700456113536/302834755149288490653525*n^10 - 8502565529331757967296/6157640021368865976621675*n^11) * eps^18
+        + (23263/2006513145 + 44125168/949080717585*n - 1895498144/17652901347081*n^2 + 5803380481936/40101507560119005*n^3 - 19655652872896/87117068147844735*n^4 + 3287964577171024/12631974881437486575*n^5 - 46210682062489376/125190060003839805975*n^6 + 372537686814738512/905786904733664478525*n^7 - 8650226115503323264/15398377380472296134925*n^8 + 101222691712671952/160484766904763376075*n^9 - 47176442350469959824736/55418760192319793789595075*n^10) * eps^19
+        + (10540/338353197 - 3712/82302129*n + 14840576/183064816935*n^2 - 2144136832/15388989250635*n^3 + 5316349300224/31190061435648115*n^4 - 6607647772488064/26779786748647471539*n^5 + 66555255361792/238679026280280495*n^6 - 44052878135978368/115777273537385685225*n^7 + 384486668476460567552/908504265447865471960575*n^8 - 3468834561318140695424/6157640021368865976621675*n^9) * eps^20
+        + (27329/3154914945 + 13289392/382771889955*n - 1286021216/16459191268065*n^2 + 770506950736/7181693789965695*n^3 - 1152005167333952/7079713738148182131*n^4 + 195075922055654512/1026558492031486408995*n^5 - 8145969897756512/31107833091863224515*n^6 + 12664143027275104208/43262107878469784379075*n^7 - 651402398229792722048/1679356369464236175442275*n^8) * eps^21
+        + (1562/66703105 - 127424/3811384395*n + 2102950784/34362171243855*n^2 - 37430848576/364239015184863*n^3 + 696434041088/5463585227772945*n^4 - 6373599267875264/35398568690740910655*n^5 + 545772421678208/2661698573054612091*n^6 - 8466792971121000512/31046924477490080554395*n^7) * eps^22
+        + (3401/512475075 + 28492208/1071585381825*n - 5331168/90848077775*n^2 + 8186753917904/100165729175837325*n^3 - 99012798127808/815635223288961075*n^4 + 1929159053254544/13474293888733636959*n^5 - 5854490607967819616/30333202075708699392225*n^6) * eps^23
+        + (3656/202606425 - 35305216/1385220127725*n + 29556996608/624734277603975*n^2 - 4014261183232/51436455522727275*n^3 + 32964315529286656/336857347218340923975*n^4 - 29338515257596672/216297875582303119605*n^5) * eps^24
+        + (100381/19328652945 + 22113584/1063075911975*n - 39278656544/868533020083575*n^2 + 44603405612432/700327125194055975*n^3 - 9121454090180288/98004601813921127325*n^4) * eps^25
+        + (4654/327806325 - 17462848/878193144675*n + 276219008/7401913647975*n^2 - 2750176959296/45302178830156325*n^3) * eps^26
+        + (45767/11058446025 + 176617072/10656655819425*n - 1087907102432/30552632234291475*n^2) * eps^27
+        + (29092/2558620845 - 125915776/7959869448795*n) * eps^28
+        + 917561/273868982145 * eps^29;
+C4[2] = + (4/525 - 32/1575*n + 64/3465*n^2 - 32/5005*n^3 + 128/225225*n^4 + 32/765765*n^5 + 64/8083075*n^6 + 32/14549535*n^7 + 256/334639305*n^8 + 288/929553625*n^9 + 64/456326325*n^10 + 352/5089793625*n^11 + 128/3506302275*n^12 + 416/20419054425*n^13 + 64/5373435375*n^14 + 32/4418157975*n^15 + 512/112374887625*n^16 + 544/184294815705*n^17 + 576/293506558345*n^18 + 608/455441211225*n^19 + 128/138101528565*n^20 + 32/48823772725*n^21 + 704/1494007445385*n^22 + 736/2140064719065*n^23 + 256/1006013329475*n^24 + 32/167832467649*n^25 + 832/5757043948425*n^26 + 864/7803992907865*n^27) * eps^2
+        - (8/1575 - 128/5775*n + 256/6825*n^2 - 6784/225225*n^3 + 4608/425425*n^4 - 128/124355*n^5 - 5888/72747675*n^6 - 9088/557732175*n^7 - 1024/214512375*n^8 - 3968/2281631625*n^9 - 35584/48522699225*n^10 - 235136/683728943625*n^11 - 303616/1735619626125*n^12 - 1664/17531511375*n^13 - 22784/419725007625*n^14 - 16768/516924483075*n^15 - 710656/35323173010125*n^16 - 850816/66038975627625*n^17 - 25856/3047952721275*n^18 - 1184384/206922123633225*n^19 - 512/129731738955*n^20 - 17536/6320800730475*n^21 - 87296/43990219225225*n^22 - 697728/483892411477475*n^23 - 216064/203306148311175*n^24 - 107392/135328913080977*n^25 - 3018496/5033575425572925*n^26) * eps^3
+        - (8/1925 - 1856/225225*n - 128/17325*n^2 + 42176/1276275*n^3 - 2434816/72747675*n^4 + 195136/14549535*n^5 - 761984/557732175*n^6 - 947392/8365982625*n^7 - 199168/8365982625*n^8 - 250816/34659070875*n^9 - 12285568/4512611027925*n^10 - 2049728/1735619626125*n^11 - 854272/1504203675975*n^12 - 3794752/12843585233325*n^13 - 136569728/834833040166125*n^14 - 983872/10325235187575*n^15 - 263816192/4556689318306125*n^16 - 166125632/4556689318306125*n^17 - 73477504/3103831854498375*n^18 - 68603072/4345364596297725*n^19 - 159244544/14774239627412265*n^20 - 338106304/45001994267405175*n^21 - 3319168/622147386185325*n^22 - 318736576/82745602362648225*n^23 - 353437184/125179244599903725*n^24 - 675465152/321947484219644283*n^25) * eps^4
+        + (8/10725 - 128/17325*n + 64256/3828825*n^2 - 128/25935*n^3 - 266752/10392525*n^4 + 11222912/334639305*n^5 - 8292608/557732175*n^6 + 4484992/2788660875*n^7 + 340992/2450641375*n^8 + 11977088/395843072625*n^9 + 2246912/237505843575*n^10 + 82282624/22563055139625*n^11 + 4942336/3057996484125*n^12 + 661387648/834833040166125*n^13 + 5904128/14079866164875*n^14 + 23140740736/98120709987525225*n^15 + 12064565248/86577097047816375*n^16 + 18372231296/214164397960387875*n^17 + 27322100992/499716928574238375*n^18 + 241091456/6715563467005575*n^19 + 1114236416/46060864720755885*n^20 + 21761259136/1305057833754750075*n^21 + 859481344/73288962092631285*n^22 + 40995250048/4881990539396245275*n^23 + 606575260672/99267140967723653925*n^24) * eps^5
+        - (4/25025 + 928/3828825*n + 292288/72747675*n^2 - 106528/6613425*n^3 + 6139264/557732175*n^4 + 10832608/557732175*n^5 - 162679232/5019589575*n^6 + 85724192/5472484875*n^7 - 3655690496/2051186830875*n^8 - 3604983136/22563055139625*n^9 - 7007552/196200479475*n^10 - 9537699488/834833040166125*n^11 - 13154432/2929238737425*n^12 - 200866912/99212042454525*n^13 - 6420816704/6371474674514625*n^14 - 17688656864/32706903329175075*n^15 - 21307711227392/69175100541205283625*n^16 - 5244426197152/28483864928731587375*n^17 - 417090283072/3640794765326593875*n^18 - 362186962528/4911763119767877555*n^19 - 573931129472/11745520503792750675*n^20 - 1058701197088/31880698510294608975*n^21 - 33756633788608/1462969831639074834075*n^22 - 50313491799008/3077281369999433271675*n^23) * eps^6
+        + (464/1276275 - 17152/10392525*n + 83456/72747675*n^2 - 181504/79676025*n^3 + 115303424/8365982625*n^4 - 4580096/334639305*n^5 - 508046848/34659070875*n^6 + 2213207296/71628746475*n^7 - 17261467648/1074431197125*n^8 + 4782020864/2507006126625*n^9 + 1014518272/5757469242525*n^10 + 33657011968/834833040166125*n^11 + 149965386752/11409384882270375*n^12 + 1104106298624/210258664258982625*n^13 + 16287375872/6782537556741375*n^14 + 18546580736/15321173984763075*n^15 + 45457260285952/69175100541205283625*n^16 + 5907631030528/15620183993175386625*n^17 + 130174950780416/570310273350825782775*n^18 + 247185478912/1725076446917198375*n^19 + 4546015751168/48883737715785067095*n^20 + 194686818012928/3134935353512303215875*n^21 + 541960491316736/12748737104283366411225*n^22) * eps^7
+        + (1168/72747675 + 128/1865325*n - 12032/7436429*n^2 + 5669504/2788660875*n^3 - 42320384/25097947875*n^4 + 1690753408/145568097675*n^5 - 3812261632/259345461375*n^6 - 1083259264/97675563375*n^7 + 220583066624/7521018379875*n^8 - 1505036615552/92759226685125*n^9 + 1611235072/806601971175*n^10 + 6334750336/33458606692875*n^11 + 1667637018112/37738734610586625*n^12 + 937077639296/63991767383168625*n^13 + 4509356511488/760165940013244875*n^14 + 294484214656/107248217893341525*n^15 + 32262664812544/23058366847068427875*n^16 + 729031420097152/950517122251376304625*n^17 + 25918478235392/58194925852125079875*n^18 + 2318317188006784/8554654100262386741625*n^19 + 558196229800448/3256287689777295598425*n^20 + 492800344582544512/4398314300977761411872625*n^21) * eps^8
+        + (208/1119195 - 192256/334639305*n + 34304/91933875*n^2 - 164096/121246125*n^3 + 1760402432/727840488375*n^4 - 7092326144/4512611027925*n^5 + 223317267968/22563055139625*n^6 - 17696559872/1187529217875*n^7 - 7016842532864/834833040166125*n^8 + 860408727296/30919742228375*n^9 - 22226861374976/1369126185872445*n^10 + 21222698179328/10292382166523625*n^11 + 88454767616/442649819492595*n^12 + 50501718260992/1064232316018542825*n^13 + 7723646961783296/484225703788436985375*n^14 + 314323524352/48062104594385805*n^15 + 2532668227735552/827869751638295491125*n^16 + 40384078766338816/25663962300787160224875*n^17 + 19229411505664/22105049354683169875*n^18 + 770798397212533504/1514173775746442453267625*n^19 + 250556302305381376/803170437569852083907175*n^20) * eps^9
+        + (236/9561123 + 50272/557732175*n - 180416/253514625*n^2 + 4019104/6220858875*n^3 - 25917758848/22563055139625*n^4 + 494758496/196200479475*n^5 - 12204703424/7521018379875*n^6 + 4056672544/472457860875*n^7 - 22131315968/1504203675975*n^8 - 314109390176/49391276546625*n^9 + 288234585666624/10902301109725025*n^10 - 31315082826784/1939144466156625*n^11 + 111197020252288/52765141526472375*n^12 + 14390751017248/69105994546658625*n^13 + 24312743742913856/484225703788436985375*n^14 + 622105174713376/36402783405371858475*n^15 + 60584296191732224/8554654100262386741625*n^16 + 4228371181856/1264546060644846525*n^17 + 12685404296720576/7314849158195374170375*n^18 + 29737849987907314208/30788200106844329883108375*n^19) * eps^10
+        + (3464/32807775 - 1302656/5019589575*n + 153380608/727840488375*n^2 - 45513088/64282208375*n^3 + 18741801472/22563055139625*n^4 - 925614464/902522205585*n^5 + 692308704512/278277680055375*n^6 - 1431548425856/834833040166125*n^7 + 37095814581248/4889736378115875*n^8 - 57202079464576/3988646747460375*n^9 - 156331212808448/32706903329175075*n^10 + 2294120744984192/91139789909361375*n^11 - 22462403210597888/1403552764604165175*n^12 + 1062101785588352/496641747475319985*n^13 + 1839082934090104576/8554654100262386741625*n^14 + 89891107232678272/1710930820052477348325*n^15 + 513933681977344/28420777741735504125*n^16 + 74871039262438528/9896560625793741524625*n^17 + 36964023452909851904/10262733368948109961036125*n^18) * eps^11
+        + (296/15540525 + 1728/24395525*n - 49758848/136745788725*n^2 + 427124032/1327238537625*n^3 - 5044327168/7521018379875*n^4 + 298545088/318031634349*n^5 - 801131699072/834833040166125*n^6 + 6305965926464/2632934972831625*n^7 - 378931864297984/210258664258982625*n^8 + 911863359318208/133800968164807125*n^9 - 192205122085248128/13835020108241056725*n^10 - 6780515998533184/1913935588096588875*n^11 + 38905530524711168/1619483959158652125*n^12 - 946513267068414656/59822755945890816375*n^13 + 83570609810086528/38708842082635234125*n^14 + 1131108186078795712/5132792460157432044975*n^15 + 131223039038073856/2407271503571450641125*n^16 + 9360216457260964928/493928343960069463365375*n^17) * eps^12
+        + (56/858429 - 55168/399169485*n + 5211904/37921101075*n^2 - 3002446208/7521018379875*n^3 + 48699457024/119261862880875*n^4 - 919739008/1451883548115*n^5 + 365596999424/368044673621625*n^6 - 10263813181312/11066245487314875*n^7 + 3358672820415488/1471810649812878375*n^8 - 43146790366966912/23058366847068427875*n^9 + 200474306313855232/32281713585895799025*n^10 - 1223232504628096/91139789909361375*n^11 - 5571695531272704/2175096389591250125*n^12 + 117245774985483904/5101165235696116125*n^13 - 6362058788044060928/407364480964875559125*n^14 + 1432428366354690688/659770708386249434975*n^15 + 406876011841654183936/1811070594520254699006375*n^16) * eps^13
+        + (6748/491730525 + 2464/47453715*n - 35434816/169647031125*n^2 + 2367228064/12099029567625*n^3 - 338914889344/834833040166125*n^4 + 643139268064/1369126185872445*n^5 - 42372035912768/70086221419660875*n^6 + 528871923808/521733658210875*n^7 - 9028483998408448/9882157220172183375*n^8 + 375698992716832/173371179301266375*n^9 - 3261967803906496/1699037557152410475*n^10 + 4454132788010992864/777695827296580612875*n^11 - 324957881336448/25082916539157575*n^12 - 51719952215776/29149515632549235*n^13 + 40751993548714355392/1848808028994435229875*n^14 - 1505262899486918255456/97740317799505809152725*n^15) * eps^14
+        + (63392/1475191575 - 40448/491730525*n + 22100992/232479264875*n^2 - 10707459584/43938581061375*n^3 + 395889698816/1629912126038625*n^4 - 1272720851456/3165184193145975*n^5 + 57785079583744/113216203831759875*n^6 - 5771910533522944/9882157220172183375*n^7 + 400461014478848/395286288806887335*n^8 - 8980497036868096/9882157220172183375*n^9 + 861739038708736/418695852855651525*n^10 - 7151522689996655104/3666280328683880032125*n^11 + 136923421975731791872/25663962300787160224875*n^12 - 21113609897148018176/1688042113429701731625*n^13 - 121850848500674573312/107275958560433205167625*n^14) * eps^15
+        + (216352/21800053275 + 276003584/7259417740575*n - 364665344/2792083746375*n^2 + 45336414464/345738935826375*n^3 - 54656669920256/210258664258982625*n^4 + 2651168079104/9495552579437925*n^5 - 9112145249388032/23058366847068427875*n^6 + 259248276999003392/484225703788436985375*n^7 - 25094568739469312/44020518526221544125*n^8 + 2852336745721263872/2851551366754128913875*n^9 - 215254033283584/237135248794522155*n^10 + 16753729491723017984/8554654100262386741625*n^11 - 39706593780549643264/20188983676619232710235*n^12 + 2373769153328288102144/473664617028374305893975*n^13) * eps^16
+        + (1248/41951525 - 14245376/268867323725*n + 10222592/149641089675*n^2 - 1801381376/11340026117875*n^3 + 236349194786816/1471810649812878375*n^4 - 3691013040948736/13835020108241056725*n^5 + 371324256164864/1213598255108864625*n^6 - 2021022934670848/5206727997725128875*n^7 + 427036746482839552/777695827296580612875*n^8 - 1598379187657077248/2851551366754128913875*n^9 + 1279883225050112/1305057833754750075*n^10 - 35243011544058408448/38824968608883139827375*n^11 + 57528704095634149967872/30788200106844329883108375*n^12) * eps^17
+        + (2188/299073775 + 118112/4177173275*n - 1651234880/18960523669087*n^2 + 396968969632/4266117825544575*n^3 - 527133283672192/3007613067008925375*n^4 + 712898585518304/3873805630307495883*n^5 - 102467165232448/380980097394521625*n^6 + 1667960274927658784/5132792460157432044975*n^7 - 9803797102758335744/25663962300787160224875*n^8 + 1582433972899100512/2851551366754128913875*n^9 - 167731799286812796352/302834755149288490653525*n^10 + 2057307675985255174816/2148013960942627666263375*n^11) * eps^18
+        + (4776/222945905 - 545152/15064773295*n + 75166464/1485934456825*n^2 - 2430966148992/22278615311177225*n^3 + 25097198606848/221613594411183975*n^4 - 777828977914496/4210658293812495525*n^5 + 346053142459467008/1710930820052477348325*n^6 - 2300283426585485696/8554654100262386741625*n^7 + 2890306701807143936/8554654100262386741625*n^8 - 63408372990350273152/168241530638493605918625*n^9 + 379976274656827151616/684182224596540664069075*n^10) * eps^19
+        + (729128/132296100027 + 1037632/48401012205*n - 312986836352/5129781278546925*n^2 + 8491740695488/123684726382742525*n^3 - 569171041087744/4611673369413685575*n^4 + 14781690121669568/114062054670165156555*n^5 - 325240456165524608/1710930820052477348325*n^6 + 264121805570445376/1222093442894626677375*n^7 - 15019589271866087936/56080510212831201972875*n^8 + 322915232383134423488/932975760813464541912375*n^9) * eps^20
+        + (50248/3154914945 - 4224/163387745*n + 351214336/9143995148925*n^2 - 13428756608/171810856219275*n^3 + 149145346743808/1787806499532369225*n^4 - 15142621991500672/114062054670165156555*n^5 + 3607505909629184/25284691921957793325*n^6 - 1346982356013579136/6977759335237061996625*n^7 + 426802317284889955328/1884991843276183462231125*n^8) * eps^21
+        + (402908/95051924625 + 61416608/3707025060375*n - 1594343872/35872596353475*n^2 + 176968781792/3392422200251175*n^3 - 11134005164416/123581094437721375*n^4 + 5634047312627936/58997614484568184425*n^5 - 23365464365584673216/168241530638493605918625*n^6 + 7084481509357518688/46298045273450120124975*n^7) * eps^22
+        + (10384/854125125 - 34177792/1785975636375*n + 36665846272/1230537213462375*n^2 - 878996127488/15176625632702625*n^3 + 54887110257664/865067661064049625*n^4 - 850509595404544/8637367877393357025*n^5 + 909150023994065408/8631398964632556737625*n^6) * eps^23
+        + (10096/3039096375 + 90261376/6926100638625*n - 104352359168/3123671388019875*n^2 + 31307137302656/771546832840909125*n^3 - 38042941521183232/561428912030568206625*n^4 + 498270120528775552/6849432726772932120825*n^5) * eps^24
+        + (509392/53690702625 - 8609536/590597728875*n + 1032951296/43865304044625*n^2 - 971880602368/22022865572140125*n^3 + 391353414474752/7911102710525447125*n^4) * eps^25
+        + (2894476/1093234093875 + 3389629984/325419348610125*n - 164895679936/6399913855999125*n^2 + 1620742521773024/50360922132857114625*n^3) * eps^26
+        + (139048/18430743375 - 86549632/7611897013875*n + 412763643136/21823308738779625*n^2) * eps^27
+        + (4247096/1982931154875 + 5788830656/685433202535125*n) * eps^28
+        + 185528/30429886905 * eps^29;
+C4[3] = + (8/2205 - 256/24255*n + 512/45045*n^2 - 256/45045*n^3 + 1024/765765*n^4 - 256/2909907*n^5 - 512/101846745*n^6 - 256/334639305*n^7 - 2048/11712375675*n^8 - 256/5019589575*n^9 - 512/29113619535*n^10 - 2816/410237366175*n^11 - 1024/347123925225*n^12 - 3328/2429867476575*n^13 - 512/755505013725*n^14 - 256/723694276305*n^15 - 4096/21193903806075*n^16 - 4352/39623385376575*n^17 - 512/7924677075315*n^18 - 4864/124153274179935*n^19 - 1024/41955244378047*n^20 - 256/16434081899235*n^21 - 5632/554276762237835*n^22 - 5888/871006340659455*n^23 - 2048/447273526284585*n^24 - 1280/405986739242931*n^25 - 6656/3020145255343755*n^26) * eps^3
+        - (16/8085 - 1024/105105*n + 2048/105105*n^2 - 1024/51051*n^3 + 4096/373065*n^4 - 1024/357357*n^5 + 161792/780825045*n^6 + 1024/79676025*n^7 + 8192/3904125225*n^8 + 13312/26127607275*n^9 + 2048/13080031965*n^10 + 84992/1504203675975*n^11 + 241664/10529425731825*n^12 + 13312/1302972414975*n^13 + 2048/418462676775*n^14 + 467968/187919280413865*n^15 + 2834432/2126455015209525*n^16 + 17408/23367637529775*n^17 + 268288/620766370899675*n^18 + 175104/675945603868535*n^19 + 1101824/6894645159459057*n^20 + 130048/1285771264783005*n^21 + 2048/31266894280083*n^22 + 1672192/38614614435902505*n^23 + 499712/17129791366302615*n^24 + 2145280/107315828073214761*n^25) * eps^4
+        - (136/63063 - 256/45045*n + 512/1072071*n^2 + 494336/33948915*n^3 - 44032/1996995*n^4 + 204032/14196819*n^5 - 42496/10140585*n^6 + 1651456/5019589575*n^7 + 3172352/145568097675*n^8 + 39570176/10529425731825*n^9 + 6040064/6317655439095*n^10 + 9663232/31588277195475*n^11 + 44557312/389588752077525*n^12 + 156928/3273855059475*n^13 + 50066944/2281876976454075*n^14 + 211489024/19624141997505045*n^15 + 61804544/11018903260631175*n^16 + 83527936/27257287013140275*n^17 + 1220781568/699603700003933725*n^18 + 319501568/310259032175657565*n^19 + 294585344/469820820151710027*n^20 + 6025472/15353621573585295*n^21 + 6149632/24429654030877095*n^22 + 1419008/8597216044219803*n^23 + 15341295616/138973997354813115495*n^24) * eps^5
+        + (64/315315 - 16384/5360355*n + 966656/101846745*n^2 - 868352/101846745*n^3 - 3506176/468495027*n^4 + 966656/46293975*n^5 - 2736128/168120225*n^6 + 254590976/48522699225*n^7 - 930414592/2105885146365*n^8 - 975978496/31588277195475*n^9 - 175947776/31588277195475*n^10 - 1719713792/1168766256232575*n^11 - 189497344/389588752077525*n^12 - 471973888/2522074552922925*n^13 - 23683022848/294362129962575675*n^14 - 2875506688/76316107768075175*n^15 - 166335741952/8804103705244308825*n^16 - 7264288768/725043834549531315*n^17 - 8638251008/1551295160878287825*n^18 - 43198234624/13411551780926474175*n^19 - 5872648192/3045134945427750175*n^20 - 10622910464/8926595582882490513*n^21 - 4633606045696/6144473292884114303115*n^22 - 6324103528448/12924581753997619741035*n^23) * eps^6
+        - (16/97461 + 14848/101846745*n + 74752/101846745*n^2 - 1180160/156165009*n^3 + 1804288/156165009*n^4 + 21661184/11712375675*n^5 - 6329863168/339658894575*n^6 + 77686373888/4512611027925*n^7 - 191476584448/31588277195475*n^8 + 1902050816/3509808577275*n^9 + 602135552/15178782548475*n^10 + 1734961664/233753251246515*n^11 + 32315783168/15973138835178525*n^12 + 4767689216/6937827978915925*n^13 + 354268160/1308276133167003*n^14 + 3839243089408/32281713585895799025*n^15 + 5498545266688/96845140757687397075*n^16 + 19638642446848/677915985303811779525*n^17 + 62312623694848/3992171913455780479425*n^18 + 16645612231168/1891028801110632858675*n^19 + 185414359607296/35929547221102024314825*n^20 + 2746091096576/877781898983444900445*n^21 + 146389811987456/74962574173186194498003*n^22) * eps^7
+        + (5024/33948915 - 96256/101846745*n + 2363392/2342475135*n^2 - 223232/3904125225*n^3 + 179101696/35137127025*n^4 - 12169295872/1018976683725*n^5 + 21649608704/10529425731825*n^6 + 73147930624/4512611027925*n^7 - 110974713856/6317655439095*n^8 + 45664495616/6834890387325*n^9 - 38688231424/61514013485925*n^10 - 6727825408/140526148110075*n^11 - 204859727872/22156289352021825*n^12 - 5333835708416/2060534909738029725*n^13 - 12449383788544/13835020108241056725*n^14 - 11682410842112/32281713585895799025*n^15 - 15675688321024/96845140757687397075*n^16 - 564491569272832/7185909444220404862965*n^17 - 162424807264256/3992171913455780479425*n^18 - 25758343960576/1159017652293613687575*n^19 - 867930864951296/68382041485323207566925*n^20 - 986317559527424/131013617475933318651525*n^21) * eps^8
+        - (1744/101846745 + 512/15935205*n + 2819072/3904125225*n^2 - 574976/354920475*n^3 + 293840896/1018976683725*n^4 - 104608193024/31588277195475*n^5 + 50770254848/4512611027925*n^6 - 2319237632/501401225325*n^7 - 70544060416/5059594182825*n^8 + 152043321856/8657527823945*n^9 - 12686255881216/1774793203908725*n^10 + 1910603827712/2714802252619275*n^11 + 4965264541696/89588474336436075*n^12 + 11708566053376/1064232316018542825*n^13 + 27753253723136/8804103705244308825*n^14 + 8328847653376/7449626212129799775*n^15 + 12046676107264/26322012616191959205*n^16 + 118607935682048/570310273350825782775*n^17 + 136251371367424/1330723971151926826475*n^18 + 3451317953686016/64237675334697558623475*n^19 + 60965191496247296/2052546673789621992207225*n^20) * eps^9
+        + (13760/156165009 - 868352/2342475135*n + 2834432/11712375675*n^2 - 7192576/16174233075*n^3 + 7776468992/4512611027925*n^4 - 4603068416/6317655439095*n^5 + 23153426432/10529425731825*n^6 - 68229349376/6678664321329*n^7 + 7325440344064/1168766256232575*n^8 + 63577941262336/5324379611726175*n^9 - 44408364941312/2559670695326745*n^10 + 28661243789312/3822884804708775*n^11 - 24786086817923072/32281713585895799025*n^12 - 3817219702784/61277771427624675*n^13 - 1226804449460224/96845140757687397075*n^14 - 8872730492715008/2395303148073468287655*n^15 - 623934886248448/466617496377948367725*n^16 - 2853622228533248/5132792460157432044975*n^17 - 1724063864471552/6729661225539744236745*n^18 - 16517156456001093632/129310440448746185509055175*n^19) * eps^10
+        + (2824/688963275 + 169216/11712375675*n - 776704/1940907969*n^2 + 22551296/45581929575*n^3 - 485960704/1504203675975*n^4 + 304217344/191444104215*n^5 - 2695489024/2419805913525*n^6 + 8952644864/5757469242525*n^7 - 5695372408832/622330084487475*n^8 + 17565250440448/2409982350570795*n^9 + 22610939298304/2213249097462975*n^10 - 21402530278491392/1257729100749186975*n^11 + 1752626126402468864/225971995101270593175*n^12 - 14296223366555392/17382461161636199475*n^13 - 288001255055872/4203761228630165475*n^14 - 170463009837350144/11976515740367341438275*n^15 - 30452830506323968/7185909444220404862965*n^16 - 1203551903703808/774513440279510206275*n^17 - 1344666689909348864/2052546673789621992207225*n^18) * eps^11
+        + (848/15540525 - 1506304/8562829275*n + 494897152/4512611027925*n^2 - 1525812224/4512611027925*n^3 + 1189474304/1858133952675*n^4 - 74582428672/233753251246515*n^5 + 1436219392/1037059677225*n^6 - 9475007491072/6845630929362225*n^7 + 70856261853184/58872425992515135*n^8 - 16848457551905792/2060534909738029725*n^9 + 254950781338028032/32281713585895799025*n^10 + 19961192018277376/2282545405063339325*n^11 - 11266641625872879616/677915985303811779525*n^12 + 20501971947705344/2580589472175682275*n^13 - 70802116737542144/81472896192975111825*n^14 - 54344855357336576/733256065736776006425*n^15 - 19768531954614272/1259562261464658012225*n^16 - 104711917718588416/22047815933290057205295*n^17) * eps^12
+        + (2456/364832325 + 1801984/79168614525*n - 339889664/1504203675975*n^2 + 205509376/957220521075*n^3 - 109868782592/389588752077525*n^4 + 54139545344/77917750415505*n^5 - 312640051712/840691517640975*n^6 + 349164957867776/294362129962575675*n^7 - 58011733055488/37464271086145995*n^8 + 33115510536049408/32281713585895799025*n^9 - 215925931198897664/29474608056687468675*n^10 + 507489742441723648/61628725936710161775*n^11 + 9972967174487194624/1330723971151926826475*n^12 - 34133956918870784/2108170346834596275*n^13 + 1256638470211792384/155539165459316122575*n^14 - 1517965285997460736/1670483282935397505575*n^15 - 10235580119040855076864/129310440448746185509055175*n^16) * eps^13
+        + (17536/491730525 - 32768/342721275*n + 32768/479809785*n^2 - 87051763712/389588752077525*n^3 + 115073417216/389588752077525*n^4 - 809341124608/3194627767035705*n^5 + 476140039995392/686844969912676575*n^6 - 7648126664704/17315419409563275*n^7 + 2295366957006848/2252212575760172025*n^8 - 1505996592152576/922334673882737115*n^9 + 642554502878101504/677915985303811779525*n^10 - 937147600273702912/142014020636766894525*n^11 + 44138249302114304/5259778542102477575*n^12 + 31679339599003648/4926579901426302525*n^13 - 38784788290715746304/2462071180075516184175*n^14 + 910141441476937023488/111378501678506619732175*n^15) * eps^14
+        + (6752/1121145597 + 828416/39240095895*n - 22733400064/166966608033225*n^2 + 12663202816/106251477839325*n^3 - 9940302737408/47919416505535575*n^4 + 142477291621376/412106981947605945*n^5 - 511499016656896/2060534909738029725*n^6 + 1833727522382848/2767004021648211345*n^7 - 49222696013062144/96845140757687397075*n^8 + 1755522210632704/1976431444034436675*n^9 - 3980569541165627392/2395303148073468287655*n^10 + 3693492679339365376/3992171913455780479425*n^11 - 214983640335726014464/35929547221102024314825*n^12 + 152736093675883697152/18118318684145465252775*n^13 + 1030498930683129116672/186595152162692908382475*n^14) * eps^15
+        + (7104/290667377 - 5550080/96792236541*n + 116482048/2419805913525*n^2 - 37516668928/253541886272675*n^3 + 112198220398592/686844969912676575*n^4 - 12087336398848/62440451810243325*n^5 + 9147933925376/24661354916650725*n^6 - 24968440568492032/96845140757687397075*n^7 + 60100118709960704/96845140757687397075*n^8 - 12851567387414528/22812410934033031311*n^9 + 578870590466711552/733256065736776006425*n^10 - 94517652107104256/57121696694915777925*n^11 + 658362218889165488128/706614428681673144858225*n^12 - 2587762813002169044992/473664617028374305893975*n^13) * eps^16
+        + (63136/12979801835 + 6603776/376414253215*n - 115496960/1322827232727*n^2 + 887622656/11561294920175*n^3 - 43488723791872/294362129962575675*n^4 + 75193702847488/382787117619317775*n^5 - 3822735799883776/20542908645570053925*n^6 + 36656101850983424/96845140757687397075*n^7 - 1972951098707156992/7185909444220404862965*n^8 + 328771821253526528/570310273350825782775*n^9 - 3105328344576980992/5132792460157432044975*n^10 + 217025910651311236096/302834755149288490653525*n^11 - 70045496023034800943104/43103480149582061836351725*n^12) * eps^17
+        + (384/22037015 - 19693568/532171875235*n + 23750672384/663618328418045*n^2 - 906788864/8981300685357*n^3 + 2473671458816/24060904536071403*n^4 - 97688010118627328/677915985303811779525*n^5 + 458602279763968/2098811100011801175*n^6 - 3630274708209664/19665871494856061475*n^7 + 4490469276862251008/11976515740367341438275*n^8 - 1171359654445416448/3992171913455780479425*n^9 + 18008930028582633472/33648306127698721183725*n^10 - 1241396166426066944/1957914156238113188115*n^11) * eps^18
+        + (7256/1889173195 + 4900096/346489785785*n - 31059853824/526317984607415*n^2 + 38700561003264/717371413019906645*n^3 - 2876286797818880/27116639412152471181*n^4 + 84142172780774656/677915985303811779525*n^5 - 5603644391945728/39789088838429705775*n^6 + 107992837810298624/466617496377948367725*n^7 - 192399843750455296/1026558492031486408995*n^8 + 1829483213954652416/5011449848806192516725*n^9 - 92159294855156056576/295904898052050767755275*n^10) * eps^19
+        + (208560/16246889477 - 23395328/926072700189*n + 5966964736/217627084544415*n^2 - 59040218112/828510128879615*n^3 + 96692817891328/1369527243038003595*n^4 - 203186292622336/1893520275156891927*n^5 + 17678406396274688/126068586740708857245*n^6 - 714429587557256192/5132792460157432044975*n^7 + 45769716805203484672/192713026004092675870425*n^8 - 2770267341515812025344/14367826716527353945450575*n^9) * eps^20
+        + (5695096/1877174392275 + 37023086848/3264406268166225*n - 135977211392/3264406268166225*n^2 + 19436995328/486188167599225*n^3 - 2916383737510912/37543936490179753725*n^4 + 1016222889010513664/11976515740367341438275*n^5 - 3851462753392374272/35929547221102024314825*n^6 + 67996526692104448/448644081702649615783*n^7 - 6002521005978183563264/43103480149582061836351725*n^8) * eps^21
+        + (1293248/133072694475 - 31178752/1729945028175*n + 23344955392/1088135422722075*n^2 - 20955891089408/403698241829889825*n^3 + 31312543744/608896292352775*n^4 - 3711165786734592/45887033487997476775*n^5 + 22699071565427326976/235538142893891048286075*n^6 - 1975768440081947803648/18472920064106597929865025*n^7) * eps^22
+        + (70576/29211079275 + 7439872/814404890187*n - 61061929984/2004017747638725*n^2 + 1769998572032/57671177404269975*n^3 - 70447795996672/1211094725489669475*n^4 + 48276040517729792/786000476842795489275*n^5 - 307128224790756352/3725130079472998170975*n^6) * eps^23
+        + (4576/607819275 - 292864/21987621075*n + 323268608/18931341745575*n^2 - 204679168/5263836485355*n^3 + 30640655949824/785215261581214275*n^4 - 20770366119528448/335286916695178495425*n^5) * eps^24
+        + (363376/186843645135 + 76231168/10276400482425*n - 192745499648/8395819194141225*n^2 + 163618760840704/6769828876875874425*n^3 - 6126423998867456/137653187163142779975*n^4) * eps^25
+        + (433472/72882272925 - 1978056704/195251609166075*n + 158870945792/11519844940798425*n^2 - 1279016321024/42860359262006055*n^3) * eps^26
+        + (4160936/2628224005275 + 3079920896/506546373283335*n - 128748399563264/7261342261016607225*n^2) * eps^27
+        + (631696/132195410325 - 3245452288/411259921521075*n) * eps^28
+        + 594728/456448303575 * eps^29;
+C4[4] = + (64/31185 - 512/81081*n + 1024/135135*n^2 - 512/109395*n^3 + 2048/1247103*n^4 - 2560/8729721*n^5 + 1024/66927861*n^6 + 512/717084225*n^7 + 4096/45176306175*n^8 + 512/29113619535*n^9 + 1024/232077138579*n^10 + 512/386795230965*n^11 + 2048/4512611027925*n^12 + 6656/38530755699975*n^13 + 1024/14311423545705*n^14 + 512/16107366892617*n^15 + 8192/546802718196735*n^16 + 8704/1171720110421575*n^17 + 1024/266042730385575*n^18 + 9728/4692993764001543*n^19 + 10240/8864543776447359*n^20 + 512/771462758869803*n^21 + 1024/2613019021978365*n^22 + 11776/49647361417588935*n^23 + 4096/27897088796549973*n^24 + 12800/137977493236990407*n^25) * eps^4
+        - (128/135135 - 2048/405405*n + 77824/6891885*n^2 - 198656/14549535*n^3 + 8192/855855*n^4 - 256000/66927861*n^5 + 1282048/1673196525*n^6 - 284672/6453758025*n^7 - 2932736/1310112879075*n^8 - 1378304/4512611027925*n^9 - 102400/1624539970053*n^10 - 677888/40613499251325*n^11 - 876544/166966608033225*n^12 - 2048/1091285019825*n^13 - 241664/325982425207725*n^14 - 3737600/11774485198503027*n^15 - 22642688/155838774686069475*n^16 - 661504/9402339422651175*n^17 - 10719232/299830157144543025*n^18 - 37783552/1994522349700655775*n^19 - 1024000/98334590264311401*n^20 - 38912/6580123531536555*n^21 - 1773568/513022734648418995*n^22 - 47104/22706932741377885*n^23 - 1851392/1452689867820346155*n^24) * eps^5
+        - (512/405405 - 2048/530145*n + 299008/130945815*n^2 + 280576/43648605*n^3 - 14114816/1003917915*n^4 + 63039488/5019589575*n^5 - 87683072/15058768725*n^6 + 243132416/187158982725*n^7 - 3305586688/40613499251325*n^8 - 1816576/410237366175*n^9 - 26021888/40613499251325*n^10 - 208984064/1502699472299025*n^11 - 1482752/38530755699975*n^12 - 258390016/20536892788086675*n^13 - 1101824/236688927871275*n^14 - 1674704896/883086389887727025*n^15 - 103952580608/124515180974169510525*n^16 - 20090607616/51270956871716857275*n^17 - 141357056/728158953065318775*n^18 - 244905162752/2431322744285099389725*n^19 - 5751365632/105709684534134756075*n^20 - 52934656/1738947191470615035*n^21 - 46270369792/2633345696950334701335*n^22 - 57764907008/5539106465998979889015*n^23) * eps^6
+        + (128/2297295 - 2048/1438965*n + 241664/43648605*n^2 - 1071104/143416845*n^3 - 598016/3011753745*n^4 + 27613184/2377700325*n^5 - 863424512/62386327575*n^6 + 14341695488/1933976154825*n^7 - 10573889536/5801928464475*n^8 + 554350592/4512611027925*n^9 + 10652495872/1502699472299025*n^10 + 19990528/18551845337025*n^11 + 385441792/1579760983698975*n^12 + 26510989312/378465595666168725*n^13 + 36253696/1532249375166675*n^14 + 53436065792/5929294332103310025*n^15 + 52137918464/13835020108241056725*n^16 + 1480593344512/871606266819186573675*n^17 + 4181365755904/5132792460157432044975*n^18 + 1000732862464/2431322744285099389725*n^19 + 43487879168/199978927019120729025*n^20 + 134786934784/1128576727264429157715*n^21 + 14014785654784/206529541089390535861845*n^22) * eps^7
+        - (17536/130945815 + 1024/43648605*n - 333824/3011753745*n^2 - 3402752/1003917915*n^3 + 76509184/9035261235*n^4 - 506510336/119101170825*n^5 - 544454656/64774320975*n^6 + 81273324544/5801928464475*n^7 - 116438441984/13537833083775*n^8 + 384681841664/166966608033225*n^9 - 9210947584/55655536011075*n^10 - 56273062912/5600970760387275*n^11 - 1406799613952/883086389887727025*n^12 - 17382315008/46478231046722475*n^13 - 7065012224/63755853033368925*n^14 - 1597517556736/41505060324723170175*n^15 - 13088473088/870735531287898675*n^16 - 96767968256/15052177302514463475*n^17 - 2168797042688/733256065736776006425*n^18 - 22253970224128/15398377380472296134925*n^19 - 2024631116115968/2725512796343596415881725*n^20 - 631344565525504/1583393148351994108274145*n^21) * eps^8
+        + (2944/43648605 - 1722368/3011753745*n + 13266944/15058768725*n^2 + 108544/717084225*n^3 + 19259392/13790661885*n^4 - 304229926912/40613499251325*n^5 + 13166350336/1933976154825*n^6 + 217784215552/40613499251325*n^7 - 1070803042304/79089445910475*n^8 + 1576695216128/166966608033225*n^9 - 7317091151872/2678725146272175*n^10 + 71083022336/342591383636775*n^11 + 332174286848/25231039711077915*n^12 + 180362430464/83287746471016395*n^13 + 457253050314752/871606266819186573675*n^14 + 66028500992/413279405793829575*n^15 + 2626638683471872/46195132141416888404775*n^16 + 1048407575824384/46195132141416888404775*n^17 + 1373352398848/138724120544795460675*n^18 + 341593997830144/73662508009286389618425*n^19 + 382965711284199424/166256280576959381368785225*n^20) * eps^9
+        - (14848/602350749 + 63488/1673196525*n + 413696/1368978975*n^2 - 58701824/48522699225*n^3 + 71114752/164427122475*n^4 - 241801216/738427259115*n^5 + 890097664/148767396525*n^6 - 185319725056/23118453419985*n^7 - 14710882304/5272629727365*n^8 + 87149336576/6838792137225*n^9 - 1769065070153728/176617277977545405*n^10 + 39343512737792/12675881194560675*n^11 - 10281234043641856/41505060324723170175*n^12 - 1581078206464/96748392365322075*n^13 - 806631639658496/290535422273062191225*n^14 - 112074429466624/162088182952339959315*n^15 - 269338565378048/1248517084903159146075*n^16 - 18582400043008/236898113545727632845*n^17 - 1933197962104832/60566951029857698130705*n^18 - 60399947547314176/4262981553255368753045775*n^19) * eps^10
+        + (13696/295269975 - 1263616/5019589575*n + 93507584/436704293025*n^2 - 143448064/1504203675975*n^3 + 14614028288/13537833083775*n^4 - 609875968/624823065405*n^5 - 1237520384/26363148636825*n^6 - 253546190848/55655536011075*n^7 + 5681519509504/677040421585275*n^8 + 214664647481344/294362129962575675*n^9 - 31278745921441792/2649259169663181075*n^10 + 290271896455168/27949535572204155*n^11 - 994793732507705344/290535422273062191225*n^12 + 1007756234246144/3528770311008852525*n^13 + 180209601368526848/9239026428283377680955*n^14 + 52513246916810752/15398377380472296134925*n^15 + 4467930789675008/5132792460157432044975*n^16 + 1202387450415104/4333088706428611154025*n^17 + 146144562349641728/1420993851085122917681925*n^18) * eps^11
+        - (2752/792566775 + 3126784/436704293025*n + 278027264/1230712098525*n^2 - 1906406912/4512611027925*n^3 + 13318144/148767396525*n^4 - 385723904/479329975215*n^5 + 651327491072/500899824099675*n^6 + 2585190754816/61610678364260025*n^7 + 1285145378811904/378465595666168725*n^8 - 1896715047424/228719603700525*n^9 + 108991838453582848/124515180974169510525*n^10 + 34341601112433152/3169477333887951177*n^11 - 616093273555376128/58107084454612438245*n^12 + 79626751390577152/21536192140520693895*n^13 - 611808984871936/1906919799439293639*n^14 - 348075945959202304/15398377380472296134925*n^15 - 11052858295372292096/2725512796343596415881725*n^16 - 16246381930177024/15352874741615973900525*n^17) * eps^12
+        + (34048/1094496975 - 4296704/33929406225*n + 9199616/113763303225*n^2 - 666202112/4512611027925*n^3 + 11972722688/23852372576175*n^4 - 19444084736/100179964819935*n^5 + 97002643456/175528998188775*n^6 - 539677367382016/378465595666168725*n^7 + 37863377108992/294362129962575675*n^8 - 849685773930496/337439514835147725*n^9 + 2307997411351846912/290535422273062191225*n^10 - 952506302124032/452782476269707311*n^11 - 10149533533759029248/1026558492031486408995*n^12 + 2536635024778391552/236898113545727632845*n^13 - 345761202095071232/87990727888413120771*n^14 + 170146429996470272/481454300714290128225*n^15 + 4257384430093558022144/166256280576959381368785225*n^16) * eps^13
+        + (7168/4946230575 + 8974336/1933976154825*n - 93282304/644658718275*n^2 + 1573646336/8787716212275*n^3 - 1366114304/12843585233325*n^4 + 202461184/415348221015*n^5 - 411651006464/1274294934902925*n^6 + 3839857856512/10228799882869425*n^7 - 494905525829632/348782019535488825*n^8 + 3102394617856/8943128706038175*n^9 - 23750499115491328/12631974881437486575*n^10 + 6281828177286582272/839911493480307061905*n^11 - 362043035983265792/119367266515289117325*n^12 - 66153523158142976/7357084271606448225*n^13 + 278535696937581191168/25957264727081870627445*n^14 - 10888422776491155263488/2638988580586656847123575*n^15) * eps^14
+        + (120064/5605727985 - 192512/2712449025*n + 3118014464/71557117728525*n^2 - 661172224/5386019613975*n^3 + 716483084288/2933841826869525*n^4 - 51287781376/468480843441765*n^5 + 378645470961664/883086389887727025*n^6 - 307621081034752/711515319852397203*n^7 + 14911080071168/54731947680953631*n^8 - 881401908588544/658810481344812225*n^9 + 5137439471148163072/9239026428283377680955*n^10 - 1347004173866315776/942757798804426293975*n^11 + 107407504440093753344/15398377380472296134925*n^12 - 260611080305794551808/69884943495989651689275*n^13 - 64625496610661007302656/7916965741759970541370725*n^14) * eps^15
+        + (6400/2616006393 + 1107968/140504859495*n - 2029686784/21778253221725*n^2 + 1198225408/12989812010175*n^3 - 1367443873792/13585944459811185*n^4 + 719433310676992/2649259169663181075*n^5 - 63814622162944/456099564007946925*n^6 + 157784678176768/438213306595870575*n^7 - 442694333281845248/871606266819186573675*n^8 + 4703020945135616/20780536275941020425*n^9 - 174940641115230208/143018984957947022925*n^10 + 179184835005863936/244418688578925335475*n^11 - 3826143738499702784/3428317982822133856455*n^12 + 16560752844714960140288/2557788931953221251827465*n^13) * eps^16
+        + (84736/5562772215 - 1101824/25471641195*n + 5169913856/178581676418145*n^2 - 233627242496/2559670695326745*n^3 + 70218421682176/529851833932636215*n^4 - 367435176251392/4016618741102242275*n^5 + 11260909794107392/41505060324723170175*n^6 - 157314981962559488/871606266819186573675*n^7 + 4600932081707548672/15398377380472296134925*n^8 - 2826045097184792576/5132792460157432044975*n^9 + 3358887872888479744/15398377380472296134925*n^10 - 2997036152580109078528/2725512796343596415881725*n^11 + 48333318506986607427584/55418760192319793789595075*n^12) * eps^17
+        + (29696/12381654285 + 126963712/15737082596235*n - 174095884288/2803448856786435*n^2 + 192265793536/3463083881912655*n^3 - 2065111023763456/24903036194833902105*n^4 + 137907822072991744/871606266819186573675*n^5 - 1454755457867776/15291338014371694275*n^6 + 16143676059275264/63194435213976591525*n^7 - 923844554893459456/4199557467401535309525*n^8 + 1290691679389454336/5132792460157432044975*n^9 - 90880238263941996544/160324282137858612698925*n^10 + 38669172193378346979328/166256280576959381368785225*n^11) * eps^18
+        + (171776/15383267445 - 4296704/152649346185*n + 786882560/36910611907533*n^2 - 1117064032256/16769721343322493*n^3 + 1268559669477376/15847386669439755885*n^4 - 6079247310737408/79236933347198779425*n^5 + 238252404104617984/1399852489133845103175*n^6 - 4954857180036468736/46195132141416888404775*n^7 + 3590745911011278848/15398377380472296134925*n^8 - 10935270658690822144/43262107878469784379075*n^9 + 4039796192998858153984/18472920064106597929865025*n^10) * eps^19
+        + (244288/116731852965 + 16665088/2289740192775*n - 60094358528/1399031257785525*n^2 + 3775697939968/101196594313152975*n^3 - 11699335030784/179675585821312425*n^4 + 16586730946151936/167982298696061412381*n^5 - 60983345813341184/810440914761699796575*n^6 + 378264738379902464/2199768197210328019275*n^7 - 19768926062753615872/160324282137858612698925*n^8 + 9935173508449188352/47245319857050122582775*n^9) * eps^20
+        + (2254208/268167770325 - 202909696/10519032013425*n + 1358934016/82295956340325*n^2 - 160058079232/3264406268166225*n^3 + 850193500332032/16090258495791323025*n^4 - 321074139364931584/5132792460157432044975*n^5 + 243713411755012096/2199768197210328019275*n^6 - 707822781060487168/9054859788516931614225*n^7 + 3972497411381290090496/23750897225279911624112175*n^8) * eps^21
+        + (46064128/26177300041725 + 2135226368/340304900542425*n - 129082421248/4197093773356575*n^2 + 14011652593664/519040596638429775*n^3 - 11242059096064/222445969987898475*n^4 + 34969938420373504/530978530361113659825*n^5 - 31791272768638976/519442118609414220675*n^6 + 64623481105209387008/552346447099532828467725*n^7) * eps^22
+        + (567424/87633237825 - 2525366272/183241100292075*n + 127744077824/9711778315479975*n^2 - 1465656547328/39926199741417675*n^3 + 64825892864/1735921727887725*n^4 - 434460028991488/8637367877393357025*n^5 + 3702905819309092864/48999787968452514402825*n^6) * eps^23
+        + (4411264/3014175784725 + 36530244608/6869306613388275*n - 6393343404032/281641571148919275*n^2 + 1926123498496/93880523716306425*n^3 - 8066704574943232/204941183272696925775*n^4 + 83042824808834048/1785916025662073210325*n^5) * eps^24
+        + (14258816/2802654677025 - 85649408/8407964031075*n + 24432791552/2289768871129425*n^2 - 155146314299392/5538950899262079075*n^3 + 28150215791353856/1013628014564960470725*n^4) * eps^25
+        + (74207744/61002462438225 + 81445824512/18158399652444975*n - 55287432851456/3214036738482760575*n^2 + 45322371937982464/2810139455013426996075*n^3) * eps^26
+        + (32066944/7884672015825 - 75653347328/9769108627607175*n + 245769011032064/28008034435349770725*n^2) * eps^27
+        + (83335616/82093349811825 + 9767500288/2579721325904925*n) * eps^28
+        + 4519424/1369344910725 * eps^29;
+C4[5] = + (128/99099 - 2048/495495*n + 4096/765765*n^2 - 6144/1616615*n^3 + 8192/4849845*n^4 - 10240/22309287*n^5 + 12288/185910725*n^6 - 2048/717084225*n^7 - 16384/145568097675*n^8 - 2048/167133741775*n^9 - 4096/1985548852287*n^10 - 2048/4512611027925*n^11 - 8192/68023432902425*n^12 - 2048/55655536011075*n^13 - 4096/325982425207725*n^14 - 2048/436092044389001*n^15 - 32768/17315419409563275*n^16 - 34816/42832879592077575*n^17 - 4096/11104820634983075*n^18 - 38912/221613594411183975*n^19 - 40960/469820820151710027*n^20 - 6144/136720344488592865*n^21 - 4096/171007578216139665*n^22 - 47104/3580126395557246535*n^23 - 49152/6617809397848243595*n^24) * eps^5
+        - (256/495495 - 8192/2807805*n + 376832/53348295*n^2 - 8192/855855*n^3 + 294912/37182145*n^4 - 761856/185910725*n^5 + 6373376/5019589575*n^6 - 1417216/6931814175*n^7 + 14614528/1504203675975*n^8 + 6873088/16546240435725*n^9 + 114688/2363748633675*n^10 + 483328/55655536011075*n^11 + 3702784/1836632688365475*n^12 + 1564672/2788960748999425*n^13 + 16384/91615975711975*n^14 + 434176/6845630929362225*n^15 + 113115136/4611673369413685575*n^16 + 19357696/1898924328582105825*n^17 + 7651328/1699037557152410475*n^18 + 188801024/90048990529077755175*n^19 + 2588672/2533347559641573675*n^20 + 36364288/70137536722648139745*n^21 + 26591232/97531322109271655605*n^22 + 334061568/2256673004666251065895*n^23) * eps^6
+        - (6784/8423415 - 432128/160044885*n + 397312/160044885*n^2 + 3233792/1227010785*n^3 - 90112/10140585*n^4 + 16893952/1673196525*n^5 - 304615424/48522699225*n^6 + 129972224/58605338025*n^7 - 19623657472/49638721307175*n^8 + 112556032/5515413478575*n^9 + 1717645312/1836632688365475*n^10 + 1488896/12843585233325*n^11 + 548397056/25100646740994825*n^12 + 1909467136/359775936620925825*n^13 + 26341376/17132187458139325*n^14 + 212998144/419243033583062325*n^15 + 2574811136/13835020108241056725*n^16 + 7177459712/96845140757687397075*n^17 + 1640075264/51846388486438707525*n^18 + 42549766144/2971616687459565920775*n^19 + 384894803968/56460717061731752494725*n^20 + 4678068224/1379371555545413414985*n^21 + 93907152896/53544695837990138927145*n^22) * eps^7
+        + (512/53348295 - 16384/22863555*n + 950272/283156335*n^2 - 7094272/1227010785*n^3 + 27459584/11043097065*n^4 + 44056576/7661478825*n^5 - 15664185344/1504203675975*n^6 + 55903043584/7091245901025*n^7 - 156559081472/49638721307175*n^8 + 125727391744/204070298707275*n^9 - 62808752128/1836632688365475*n^10 - 11392663552/6845630929362225*n^11 - 33476509696/154189687123253925*n^12 - 138500489216/3237983429588332425*n^13 - 950960128/88019214106796775*n^14 - 1150632968192/355098849444853789275*n^15 - 106967072768/96845140757687397075*n^16 - 305122557952/733256065736776006425*n^17 - 22689579008/133476872486363481075*n^18 - 4193065713664/56460717061731752494725*n^19 - 114398135779328/3331182306642173397188775*n^20 - 32269630521344/1935258292430215021223955*n^21) * eps^8
+        - (16768/160044885 - 18432/409003595*n - 1716224/6135053925*n^2 - 784384/557732175*n^3 + 358162432/64049962977*n^4 - 21357307904/3818363177475*n^5 - 8616275968/3818363177475*n^6 + 393340928/41057668575*n^7 - 4234428416/475688341975*n^8 + 84470368256/21110720555925*n^9 - 102917165056/121259162999975*n^10 + 4928882046976/98120709987525225*n^11 + 8343515193344/3237983429588332425*n^12 + 178912274432/508980672878433525*n^13 + 633749204992/8804103705244308825*n^14 + 20039994431488/1065296548334561367825*n^15 + 2233706971136/384086510624025527175*n^16 + 4259891402752/2091137668953027870175*n^17 + 1138831732736/1447710693890557756275*n^18 + 283557603328/862777080197403107275*n^19 + 26333931741184/179665889217659219477025*n^20) * eps^9
+        + (40192/1227010785 - 6627328/18405161775*n + 13451264/18405161775*n^2 - 1220608/177916563825*n^3 + 625639424/49638721307175*n^4 - 40023105536/9927744261435*n^5 + 8635301888/1272787725825*n^6 - 3905085440/5651177502663*n^7 - 601491439616/73465307534619*n^8 + 78960137363456/8366882246998275*n^9 - 3063088825974784/647596685917666485*n^10 + 318151765925888/294362129962575675*n^11 - 3436000146980864/50728407063550541325*n^12 - 141582966784/38892210884398575*n^13 - 18976575045632/36734363735674529925*n^14 - 14207981707264/129794751866050005735*n^15 - 1664495212691456/56460717061731752494725*n^16 - 105714509602816/11292143412346350498945*n^17 - 248688188440576/74026273480937186604195*n^18 - 20727065127968768/15630932361936352094501175*n^19) * eps^10
+        - (451456/18405161775 + 468992/18405161775*n + 2215936/21349987659*n^2 - 186566656/220616539143*n^3 + 10790330368/16546240435725*n^4 + 69511168/174170951955*n^5 + 1481088978944/612210896121825*n^6 - 336223479808/49638721307175*n^7 + 216393505521664/75301940222984475*n^8 + 2378698436777984/359775936620925825*n^9 - 31129006450757632/3237983429588332425*n^10 + 14764481067108352/2767004021648211345*n^11 - 6488450473984/4973860874943675*n^12 + 335812940167168/3902185158734657025*n^13 + 955302786666496/198107779163971061385*n^14 + 13339668624545792/18820239020577250831575*n^15 + 8742367278497792/56460717061731752494725*n^16 + 763066338654208/17813809126428734744325*n^17 + 8502065922936832/610216578694211943629175*n^18) * eps^11
+        + (75776/2906078175 - 21692416/123173005725*n + 1413349376/7091245901025*n^2 + 807206912/49638721307175*n^3 + 29159063552/49638721307175*n^4 - 392668971008/367326537673095*n^5 - 141528793088/612210896121825*n^6 - 91066548813824/75301940222984475*n^7 + 19940018063147008/3237983429588332425*n^8 - 14101050299973632/3237983429588332425*n^9 - 20817214190780416/4113114086233827675*n^10 + 36951885405552640/3873805630307495883*n^11 - 95511505657397248/16389177666685559505*n^12 + 1316229674909106176/868626416334334653765*n^13 - 18190456006246400/173725283266866930753*n^14 - 9295527959658496/1525965325992750067425*n^15 - 3078599776131874816/3331182306642173397188775*n^16 - 2480267930475757568/11953065923833681013442075*n^17) * eps^12
+        - (157952/25416651975 + 63254528/5515413478575*n + 684187648/5515413478575*n^2 - 531623936/1504203675975*n^3 + 4810227712/68023432902425*n^4 - 384561152/1316582572305*n^5 + 4242336096256/3585806677284975*n^6 - 3859307081728/27209944786456575*n^7 + 7701409398784/17315419409563275*n^8 - 546830624075776/102897377410853025*n^9 + 330876058407968768/62664502843209492225*n^10 + 14091916227989504/3873805630307495883*n^11 - 34993139294239965184/3764047804115450166315*n^12 + 1800608637785731072/289542138778111551255*n^13 - 355896986804224/208015905173553477*n^14 + 19560882727191252992/158627728887722542723275*n^15 + 1508191457506470068224/203202120705172577228515275*n^16) * eps^13
+        + (1938944/102771679725 - 17088512/181826817975*n + 34045952/472749726735*n^2 - 6395052032/122442179224365*n^3 + 25022234624/68023432902425*n^4 - 35317563392/152125131763605*n^5 + 591038611456/5771806469854425*n^6 - 506800255483904/462569061369761775*n^7 + 124425632874496/241947887425519275*n^8 - 98713540640768/2984023944914737725*n^9 + 205916220474097664/46317241231937450775*n^10 - 349988448862552064/60385793648910965235*n^11 - 3447444843814387712/1447710693890557756275*n^12 + 563260537104941056/62943943212632945925*n^13 - 15920738443405656064/2440426598272654503435*n^14 + 156734826902743629824/82905802001294401154025*n^15) * eps^14
+        - (12032/12332601567 + 4599808/2158205274225*n + 170288193536/1836632688365475*n^2 - 290734034944/1836632688365475*n^3 + 267831984128/6845630929362225*n^4 - 1040046419968/3463083881912655*n^5 + 12144070811648/32706903329175075*n^6 - 12323923677184/395286288806887335*n^7 + 10271238256623616/11213647877205909135*n^8 - 45081806458482688/56068239386029545675*n^9 - 81270905450586112/594323337491913184155*n^10 - 26646047229472768/7301269502357655825*n^11 + 20005720522276225024/3321218650690103087925*n^12 + 47542518825522900992/36606398974089817551525*n^13 - 4201054759030906560512/492014820109376700311175*n^14) * eps^15
+        + (218112/15986705735 - 290357248/5323573009755*n + 131006464/3802552149825*n^2 - 842694656/13344309803825*n^3 + 790763536384/3924828399501009*n^4 - 7426755887104/98120709987525225*n^5 + 75745991262208/354744105339514275*n^6 - 3377930257793024/7449626212129799775*n^7 + 4306377448357888/96845140757687397075*n^8 - 27137013481472/37825596510476775*n^9 + 2956012676751097856/2971616687459565920775*n^10 + 801788666804862976/5132792460157432044975*n^11 + 3289715296102045057024/1110394102214057799062925*n^12 - 31552966617464087478272/5210310787312117364833725*n^13) * eps^16
+        + (294656/469127123465 + 25858048/13604686580485*n - 9844842496/152125131763605*n^2 + 175265755136/2180460221945005*n^3 - 2666742562816/58872425992515135*n^4 + 215614078521344/1064232316018542825*n^5 - 46888924340224/354744105339514275*n^6 + 28689645211648/201341248976481075*n^7 - 11152793875152896/23225305249581140475*n^8 + 650630500139831296/6273413006859083610525*n^9 - 30411772176709967872/56460717061731752494725*n^10 + 332517313573568196608/302834755149288490653525*n^11 + 6147866059759464267776/67734040235057525742838425*n^12) * eps^17
+        + (13824/1375739365 - 59359232/1748564732915*n + 45142409216/2180460221945005*n^2 - 1079315316736/19624141997505045*n^3 + 13677762117632/120304522680357015*n^4 - 21487658647552/446290971233582475*n^5 + 107709256466432/601522613401785075*n^6 - 317939842858467328/1710930820052477348325*n^7 + 32625224557920256/330179631939951768975*n^8 - 8782461881349357568/18820239020577250831575*n^9 + 66561309202129190912/370131367404685933020975*n^10 - 9846754133827698688/24929716685703910836525*n^11) * eps^18
+        + (27392/25638779075 + 8081408/2425428500495*n - 739467264/16345279025075*n^2 + 23711257718784/512408152157076175*n^3 - 4197953748992/94483064153841363*n^4 + 66534864318464/517888453249665225*n^5 - 113093248480108544/1710930820052477348325*n^6 + 8321651132554350592/56460717061731752494725*n^7 - 12728279499474894848/56460717061731752494725*n^8 + 30034408600463986688/370131367404685933020975*n^9 - 3791666672669202522112/8834874813268372922978925*n^10) * eps^19
+        + (362496/47933369575 - 73990144/3307402500675*n + 24686231552/1709927092848975*n^2 - 5424909975552/123684726382742525*n^3 + 737167248982016/10760571195298599675*n^4 - 2806535039418368/68437232802099093933*n^5 + 141729549396082688/1107072883563367695975*n^6 - 2818897757929472/31142149510056123825*n^7 + 110767543318740992/937568901390986039175*n^8 - 1624194242334359552/6542455349662660653225*n^9) * eps^20
+        + (179072/160900662195 + 5079242752/1399031257785525*n - 45133008896/1399031257785525*n^2 + 3194148988928/107725406849485425*n^3 - 300531459629056/7695341019726284925*n^4 + 4673381031931672576/56460717061731752494725*n^5 - 2564296548162482176/56460717061731752494725*n^6 + 3314224376139778048/27993128627245154598225*n^7 - 1369582736990797021184/11953065923833681013442075*n^8) * eps^21
+        + (5634304/969529631175 - 104833024/6786707418225*n + 2751414272/251108174474325*n^2 - 23908622336/700459644586275*n^3 + 158037016576/3570635749232475*n^4 - 1796889271328768/49921058410019232975*n^5 + 7584413032870494208/85414930939542907620225*n^6 - 568203943290363904/10290278052624326592825*n^7) * eps^22
+        + (14777984/14401062082575 + 2047571968/590443545385575*n - 105351344128/4470501129347925*n^2 + 87661905668096/4245485905837412775*n^3 - 15411476668416/471720656204156975*n^4 + 16965096326715392/306146705876497876775*n^5 - 189726703450447433728/5210310787312117364833725*n^6) * eps^23
+        + (1524224/334908420525 - 8459829248/763256290376475*n + 2999519051776/344228586959790225*n^2 - 9129476276224/344228586959790225*n^3 + 22885325392510976/751451005333222061175*n^4 - 1421006686098669568/45838511325326545731675*n^5) * eps^24
+        + (99522176/110050906984515 + 655403008/208717237384425*n - 4588589584384/260270395018377975*n^2 + 3208194018019328/209864695183152107175*n^3 - 4971722761576448/185532556611192442575*n^4) * eps^25
+        + (356096/98232628725 - 49703919616/6052799884148325*n + 51891453952/7288065166627575*n^2 - 6483388995346432/312237717223714110675*n^3) * eps^26
+        + (22625408/28910464058025 + 25774721024/9286683510194475*n - 4256878292992/315710533087678575*n^2) * eps^27
+        + (98029568/33445438812225 - 650254352384/104048760144831975*n) * eps^28
+        + 3108352/4619256832179 * eps^29;
+C4[6] = + (512/585585 - 4096/1422135*n + 8192/2078505*n^2 - 4096/1322685*n^3 + 16384/10140585*n^4 - 4096/7243275*n^5 + 8192/65189475*n^6 - 28672/1890494775*n^7 + 32768/58605338025*n^8 + 4096/214886239425*n^9 + 8192/4512611027925*n^10 + 4096/15178782548475*n^11 + 16384/310080843490275*n^12 + 4096/325982425207725*n^13 + 57344/16565834153738025*n^14 + 4096/3822884804708775*n^15 + 65536/179675585821312425*n^16 + 69632/517888453249665225*n^17 + 8192/154457959741128225*n^18 + 77824/3508402228405626825*n^19 + 16384/1677931500541821525*n^20 + 4096/910877100294131685*n^21 + 8192/3799921640620973595*n^22 + 94208/87922324857126664905*n^23) * eps^6
+        - (1024/3318315 - 16384/9006855*n + 98304/21015995*n^2 - 770048/111546435*n^3 + 65536/10140585*n^4 - 606208/152108775*n^5 + 1015808/630164925*n^6 - 114688/283117575*n^7 + 11665408/214886239425*n^8 - 1097728/501401225325*n^9 - 4489216/55655536011075*n^10 - 180224/21924908125575*n^11 - 38469632/29664400693902975*n^12 - 3751936/14017244283932175*n^13 - 12156928/182224175691118275*n^14 - 14925824/778594205225687175*n^15 - 262144/42531901957701975*n^16 - 6373376/2934701235081436275*n^17 - 42827776/51846388486438707525*n^18 - 30195712/90048990529077755175*n^19 - 11730944/81472896192975111825*n^20 - 1163264/17913916305784589805*n^21 - 360448/11786197631078613015*n^22) * eps^7
+        - (103424/189143955 - 8192/4203199*n + 3260416/1450103655*n^2 + 253952/315239925*n^3 - 28082176/5019589575*n^4 + 103325696/13233463425*n^5 - 822099968/136745788725*n^6 + 1433600/505614681*n^7 - 401801216/501401225325*n^8 + 2190548992/18551845337025*n^9 - 73121792/14186705257725*n^10 - 547889152/2696763699445725*n^11 - 28002254848/1275569229837827925*n^12 - 1073225728/294362129962575675*n^13 - 20235665408/25693608772447676775*n^14 - 85799051264/419662276616645387325*n^15 - 2324824064/38151116056058671575*n^16 - 1049976832/51846388486438707525*n^17 - 838811648/114062054670165156555*n^18 - 1639800832/570310273350825782775*n^19 - 5253726208/4388909494917224502225*n^20 - 66113314816/125666122885078897482075*n^21) * eps^8
+        - (1024/189143955 + 1654784/4350310965*n - 45842432/21751554825*n^2 + 31342592/7250518275*n^3 - 6135283712/1892385269775*n^4 - 10298703872/4512611027925*n^5 + 6553174016/902522205585*n^6 - 1929592832/265447707525*n^7 + 668086697984/166966608033225*n^8 - 913531224064/723521968143975*n^9 + 1061266948096/5234894240100525*n^10 - 3303047708672/347882517228498525*n^11 - 1519936274432/3826707689513483775*n^12 - 625052991488/13835020108241056725*n^13 - 340739325952/43413338960342626275*n^14 - 76600623104/43413338960342626275*n^15 - 31673898237952/66726301982046616584675*n^16 - 9749494448128/66726301982046616584675*n^17 - 85542404096/1710930820052477348325*n^18 - 27544600576/1477242708045309710505*n^19 - 138002181062656/18472920064106597929865025*n^20) * eps^9
+        - (71168/870062193 - 36864/483367885*n - 8192/31387525*n^2 - 99487744/210265029975*n^3 + 206400176128/58663943363025*n^4 - 157536256/30474775773*n^5 + 1459478528/1504203675975*n^6 + 314377302016/55655536011075*n^7 - 124925476864/16078265958755*n^8 + 640587280384/128417319021225*n^9 - 9891103023104/5669196577057013*n^10 + 35120897650688/115960839076166175*n^11 - 129391717695488/8564536257482558925*n^12 - 838089404416/1257729100749186975*n^13 - 5874723561472/74058048814702127175*n^14 - 12759336988672/889684026427288221129*n^15 - 1516148424704/453920421646575623025*n^16 - 91688259584/98853780714143135681*n^17 - 128511000682496/437427979660083375388425*n^18 - 10085039747072/97740317799505809152725*n^19) * eps^10
+        + (118784/7250518275 - 15269888/65254664475*n + 158990336/270340752825*n^2 - 1072234496/6518215929225*n^3 - 71041024/180504441117*n^4 - 3131899904/1676112667515*n^5 + 767602327552/144704393628795*n^6 - 7247836020736/2170565904431925*n^7 - 326399017091072/88993202081708925*n^8 + 35920955899904/4672414761310725*n^9 - 22026456501714944/3826707689513483775*n^10 + 36243071515820032/16350478309739430675*n^11 - 24770945246560256/59951753802377912475*n^12 + 17755041759232/813824712249473925*n^13 + 1642198110175232/1627470780049917477675*n^14 + 2782922322673664/22242100660682205528225*n^15 + 223455531237376/9532328854578088083525*n^16 + 100384158318592/17813809126428734744325*n^17 + 42957093661179904/26683106759265085898693925*n^18) * eps^11
+        - (1445888/65254664475 + 7897088/630795089925*n + 2424832/197521694825*n^2 - 6604095488/11732788672605*n^3 + 14287765504/19554647787675*n^4 + 906395648/2630988975069*n^5 + 22769893376/42560115773175*n^6 - 4711849558016/1046978848020105*n^7 + 1066871483531264/225100452324322575*n^8 + 35504692166656/20463677484029325*n^9 - 76345812706066432/10579721259243161025*n^10 + 6068059858960384/961792841749378275*n^11 - 478285812169048064/179855261407133737425*n^12 + 11756726194307072/22219880779902303225*n^13 - 654323284159299584/22242100660682205528225*n^14 - 94770142918180864/66726301982046616584675*n^15 - 719292224190808064/3936851816940750378495825*n^16 - 499369150090805248/14126350637257986652249725*n^17) * eps^12
+        + (1380352/90113584275 - 7386628096/58663943363025*n + 368705536/2022894598725*n^2 + 6750208/205838397765*n^3 + 18468306944/70018254981675*n^4 - 82814894080/86822636177277*n^5 + 2978608709632/29664400693902975*n^6 + 9194635264/44354768930901*n^7 + 764169233629184/225100452324322575*n^8 - 18918718461771776/3526573753081053675*n^9 - 3627328171802624/74058048814702127175*n^10 + 745621946343817216/114453348168176014725*n^11 - 21203780625144479744/3177442951526029361175*n^12 + 320789326680752128/104750866533825143775*n^13 - 6167729552277241856/9532328854578088083525*n^14 + 49486985870301790208/1312283938980250126165275*n^15 + 454620391029060141056/240147960833385773088245325*n^16) * eps^13
+        - (846848/121457439675 + 2760704/270340752825*n + 3755098112/58663943363025*n^2 - 10839138304/38080103586525*n^3 + 47457796096/434113180886385*n^4 - 38041296896/1618058219667435*n^5 + 574179688448/662633366149521*n^6 - 16095472541696/28772238267018675*n^7 - 852568899584/1849925032215975*n^8 - 3031959594082304/1299264014293019775*n^9 + 199399103086592/36548518879726425*n^10 - 60421317679783936/45609228969273148725*n^11 - 6672117285593513984/1170636876878010817275*n^12 + 5045150093198467072/733256065736776006425*n^13 - 1924429501006250622976/562407402420107196927975*n^14 + 8739482245092077723648/11435617182542179670868825*n^15) * eps^14
+        + (10240/857346633 - 1343488/18893379505*n + 49142628352/723521968143975*n^2 - 800620544/94372430627475*n^3 + 29913645056/120098788234425*n^4 - 14168250155008/51022769193513117*n^5 - 24690420416512/425189743279275975*n^6 - 16306272150519808/25693608772447676775*n^7 + 1053863745683456/1204772085980800155*n^8 + 2085142575153152/5097112671457231425*n^9 + 205141644672696320/140476425225361298073*n^10 - 18323705530956218368/3511910630634032451825*n^11 + 159481393476014047232/66726301982046616584675*n^12 + 489546767922423037952/100944918383096163551175*n^13 - 79622081860613047779328/11435617182542179670868825*n^14) * eps^15
+        - (2717696/1303643185845 + 1836138496/434113180886385*n + 4381376512/74847100152825*n^2 - 1375220350976/9888133564634325*n^3 + 90641821007872/3826707689513483775*n^4 - 593210015105024/3826707689513483775*n^5 + 350306565259264/922334673882737115*n^6 + 159804932096/11168854890749325*n^7 + 488092323692281856/1258986829849936161975*n^8 - 23509815515070464/22953664252510016025*n^9 - 723446958058078208/3511910630634032451825*n^10 - 53863391092240203776/66726301982046616584675*n^11 + 6298552764167390298112/1312283938980250126165275*n^12 - 33340680555495243776/10478116882646964225675*n^13) * eps^16
+        + (264192/29180156005 - 22183936/518653740605*n + 459997184/14869373781405*n^2 - 4054633644032/141729914426425325*n^3 + 35892774436864/225100452324322575*n^4 - 165276001992704/1976431444034436675*n^5 + 330119439908864/4611673369413685575*n^6 - 2591369816276992/6456342717179159805*n^7 + 3979077460688896/43870021026986598675*n^8 - 202257437979738112/1059147650508676453725*n^9 + 7722684046167310336/7414033553560735176075*n^10 - 60600652525666336768/1312283938980250126165275*n^11 + 4062175202748267102208/11435617182542179670868825*n^12) * eps^17
+        - (29696/89423058725 + 86007808/113656707639475*n + 909564624896/20247130632346475*n^2 - 4874605256704/67135222623043575*n^3 + 8913665490944/446290971233582475*n^4 - 147497164496896/1064232316018542825*n^5 + 411105742077952/2767004021648211345*n^6 - 140225607434297344/5132792460157432044975*n^7 + 1872239470911094784/5132792460157432044975*n^8 - 18411038875648/89301676499424675*n^9 + 10877741177165627392/171167470301771755586775*n^10 - 10158457386319702188032/10441215688408077090793275*n^11) * eps^18
+        + (135168/19606125175 - 390529024/14332077502925*n + 303955968/17771776103627*n^2 - 77308821504/2451713646684575*n^3 + 121867688738816/1257729100749186975*n^4 - 2378965909504/66196268460483525*n^5 + 173125825593344/1709221598454023325*n^6 - 14482771405635584/74388296524020754275*n^7 + 4249471492292608/190103424450275260925*n^8 - 529596339336839168/1770963480405195851775*n^9 + 27063289888053788672/89241159729983564878575*n^10) * eps^19
+        + (8065024/25797739505265 + 352878592/386966092578975*n - 46464827392/1399031257785525*n^2 + 14703099904/355075769519835*n^3 - 198597506367488/8804103705244308825*n^4 + 1332322775498752/13331928467941381935*n^5 - 2265423354462208/34916955511275047925*n^6 + 49038258159517696/733256065736776006425*n^7 - 81549844466630656/379017215455930526475*n^8 + 1082408332765528064/24147607926936729320085*n^9) * eps^20
+        + (45056/8468455905 - 242941952/13324107217005*n + 1904607232/171810856219275*n^2 - 12027756544/425792121934725*n^3 + 107565505839104/1787806499532369225*n^4 - 4677584484237312/190103424450275260925*n^5 + 64934853946507264/733256065736776006425*n^6 - 48138266780041216/508965975040820992695*n^7 + 6948561124651958272/155234622387450402771975*n^8) * eps^21
+        + (14907904/28116359304075 + 12387831808/7675766090012475*n - 1394830041088/56800669066092315*n^2 + 129385368375296/5017392434171487825*n^3 - 339203576086528/15052177302514463475*n^4 + 352973598659203072/5132792460157432044975*n^5 - 19296744227725312/539812397770567719525*n^6 + 11106387256285720576/155234622387450402771975*n^7) * eps^22
+        + (20016128/4800354027525 - 7508672512/590443545385575*n + 3266801139712/406815602770661175*n^2 - 4080124248064/173013532212809925*n^3 + 30916335173632/792219858027077025*n^4 - 206717405857660928/9768863069331886795275*n^5 + 420161316872027275264/6157640021368865976621675*n^6) * eps^23
+        + (664576/1153573448475 + 43416952832/23660945001670725*n - 509581410304/27717107001957135*n^2 + 11525019836416/663751772941605075*n^3 - 189239766700490752/9176810762099651231925*n^4 + 3799119443637886976/79969350926868389306775*n^5) * eps^24
+        + (24341504/7336727132301 - 1010843648/110050906984515*n + 21086830592/3380135000238675*n^2 - 15924466597888/829504724044079475*n^3 + 1205956028389326848/45388009985519896633575*n^4) * eps^25
+        + (71266816/128782976258475 + 21557248/11798830183525*n - 333133422592/23807679544316745*n^2 + 125585723838464/10072184426571422925*n^3) * eps^26
+        + (7036928/2628224005275 - 51925090304/7598195599250025*n + 110139925594112/21784026783049821675*n^2) * eps^27
+        + (4612096/9121483312425 + 601554944/350332525740175*n) * eps^28
+        + 139264/63626127165 * eps^29;
+C4[7] = + (1024/1640925 - 65536/31177575*n + 131072/43648605*n^2 - 65536/25741485*n^3 + 262144/175510125*n^4 - 65536/105306075*n^5 + 131072/727113375*n^6 - 458752/13524308775*n^7 + 524288/148767396525*n^8 - 65536/578539875375*n^9 - 131072/38530755699975*n^10 - 65536/227681738227125*n^11 - 262144/6845630929362225*n^12 - 65536/9704246042722275*n^13 - 917504/630775992776947875*n^14 - 65536/179675585821312425*n^15 - 1048576/10158581198358817875*n^16 - 65536/2031716239671763575*n^17 - 131072/11964551189178163275*n^18 - 1245184/311708044139115306375*n^19 - 262144/169212938246948309175*n^20 - 65536/103349517148757248875*n^21 - 131072/481420841700211039305*n^22) * eps^7
+        - (2048/10392525 - 262144/218243025*n + 16252928/5019589575*n^2 - 42729472/8365982625*n^3 + 30408704/5791834125*n^4 - 11272192/3053876175*n^5 + 283639808/157783602375*n^6 - 442236928/743836982625*n^7 + 652214272/5206858878375*n^8 - 306970624/21405975388875*n^9 + 251133952/500899824099675*n^10 + 151257088/9334951267312125*n^11 + 2152726528/1471810649812878375*n^12 + 23330816/113216203831759875*n^13 + 378011648/9882157220172183375*n^14 + 835452928/96845140757687397075*n^15 + 297795584/132061555578664632375*n^16 + 356777984/538404803513017347375*n^17 + 141033472/658050315404798980125*n^18 + 444858368/5922452838643190821125*n^19 + 1970274304/69884943495989651689275*n^20 + 1628176384/144999372559706420171625*n^21) * eps^8
+        - (84992/218243025 - 2424832/1673196525*n + 5373952/2788660875*n^2 - 65536/760543875*n^3 - 7635992576/2183521465125*n^4 + 6166740992/1041371775675*n^5 - 347209728/64282208375*n^6 + 1813970944/578539875375*n^7 - 6911688704/5837993287875*n^8 + 25729630208/92759226685125*n^9 - 237436534784/6845630929362225*n^10 + 19432800256/14866774240534125*n^11 + 4423155712/98120709987525225*n^12 + 13752664064/3192696948055628475*n^13 + 84292272128/132061555578664632375*n^14 + 97583104/787358867948678025*n^15 + 82997936128/2851551366754128913875*n^16 + 202549035008/25663962300787160224875*n^17 + 525991936/219350105134932993375*n^18 + 8466399232/10588627802422674498375*n^19 + 136503885824/473664617028374305893975*n^20) * eps^9
+        - (16384/1673196525 + 1048576/5019589575*n - 14680064/10756263375*n^2 + 137363456/42814146375*n^3 - 217512411136/67689165418875*n^4 - 208666624/644658718275*n^5 + 266338304/55987729875*n^6 - 237490929664/38530755699975*n^7 + 10820641619968/2504499120498375*n^8 - 3027063799808/1629912126038625*n^9 + 424329152036864/883086389887727025*n^10 - 235471372288/3616242382832625*n^11 + 8647887290368/3294052406724061125*n^12 + 1531605680128/15963484740278142375*n^13 + 14010378354688/1452677111365310956125*n^14 + 2557180116992/1710930820052477348325*n^15 + 5922357248/19605777158737326375*n^16 + 5662418403328/76991886902361480674625*n^17 + 2079991005184/100944918383096163551175*n^18 + 19640114741248/3044986823753834823604125*n^19) * eps^10
+        - (323584/5019589575 - 262144/3011753745*n - 3670016/18348919875*n^2 - 92536832/2051186830875*n^3 + 48279584768/22563055139625*n^4 - 43778048/10342118475*n^5 + 118776922112/49107825892125*n^6 + 133187239936/49107825892125*n^7 - 369268621312/61012753381125*n^8 + 21431886020608/4122718907038875*n^9 - 131710776246272/51946258228689825*n^10 + 18575217393664/25808394680215875*n^11 - 3164393701376/30141656009239775*n^12 + 14365663428608/3192696948055628475*n^13 + 1212658841288704/6999262445669225515875*n^14 + 1834384359424/100642989414851608725*n^15 + 610225094656/207525301623615850875*n^16 + 164609601568768/267207136896431021164875*n^17 + 251045778817024/1620431584570754204374125*n^18) * eps^11
+        + (8192/1003917915 - 1048576/6718527585*n + 6314524672/13537833083775*n^2 - 189792256/727840488375*n^3 - 28491907072/67689165418875*n^4 - 326575849472/500899824099675*n^5 + 180915011584/49107825892125*n^6 - 24383142756352/6040262584731375*n^7 - 145899963547648/259731291143449125*n^8 + 461865768452096/86577097047816375*n^9 - 14004622345633792/2441474136748421775*n^10 + 3512761381289984/1109760971249282625*n^11 - 5214964780367872/5321161580092714125*n^12 + 129418252933660672/846064691234741545875*n^13 - 41050864514760704/5922452838643190821125*n^14 - 1436339103858688/5132792460157432044975*n^15 - 12667925961900032/412956484294484305436625*n^16 - 83652980966948864/16299635350682292291057375*n^17) * eps^12
+        - (937984/48522699225 + 35913728/13537833083775*n - 122159104/4512611027925*n^2 - 736362496/2051186830875*n^3 + 1751018110976/2504499120498375*n^4 + 52370341888/500899824099675*n^5 - 495914057728/1801481823516375*n^6 - 1636748754944/650955616900875*n^7 + 5727152242688/1242733450447125*n^8 - 91166448287744/71388132653462625*n^9 - 3851787754274816/899490471433629075*n^10 + 13822108124315648/2316869396116923375*n^11 - 717165187245801472/192962122562309475375*n^12 + 1293029046747136/1035574897472143875*n^13 - 207432010174038016/999894635095603645125*n^14 + 2995763339444092928/302834755149288490653525*n^15 + 939434993543806976/2252795129769097308520125*n^16) * eps^13
+        + (606208/65400159825 - 13631488/148767396525*n + 216006656/1327238537625*n^2 + 13716422656/834833040166125*n^3 + 182775185408/2504499120498375*n^4 - 15302162120704/20536892788086675*n^5 + 86374671712256/210258664258982625*n^6 + 553624010752/1006022317028625*n^7 + 123755061837824/91784741983023375*n^8 - 54365938253824/12188217770103375*n^9 + 40612998252855296/15291338014371694275*n^10 + 380996869807931392/122794077994196938875*n^11 - 123568266508500992/20780536275941020425*n^12 + 706765068528779264/169212938246948309175*n^13 - 2440372655440789504/1610252154285475845375*n^14 + 41420770302229479424/155234622387450402771975*n^15) * eps^14
+        - (1243136/180504441117 + 101318656/13537833083775*n + 72173748224/2504499120498375*n^2 - 26437353472/119261862880875*n^3 + 2168374951936/14669209134347625*n^4 + 72842321199104/883086389887727025*n^5 + 774414801829888/1471810649812878375*n^6 - 4627044041621504/5929294332103310025*n^7 - 992466414075904/2466344841027692625*n^8 - 11629158270631936/25485563357286157125*n^9 + 3172029662252761088/810440914761699796575*n^10 - 14495633009888854016/4052204573808498982875*n^11 - 49622588403021774848/25663962300787160224875*n^12 + 2005821013245790650368/349424717479948258446375*n^13 - 3394298700190297358336/746883560543393447299125*n^14) * eps^15
+        + (782336/100280245065 - 5467799552/100179964819935*n + 160890355712/2504499120498375*n^2 + 273797349376/34228154646811125*n^3 + 75710926422016/490603549937626125*n^4 - 23330738929664/80280580898884275*n^5 - 29193338355712/483741961826610375*n^6 - 9256022006300672/37248131060648998875*n^7 + 14381676595511296/15620183993175386625*n^8 + 769074433359872/10470812852218343625*n^9 - 87967869218848768/810440914761699796575*n^10 - 246744717810779815936/76991886902361480674625*n^11 + 414848533771432493056/100944918383096163551175*n^12 + 3642053818971149828096/4262981553255368753045775*n^13) * eps^16
+        - (24430592/9595782070875 + 1219100672/278277680055375*n + 105279913984/2933841826869525*n^2 - 175938815000576/1471810649812878375*n^3 + 5660664659968/191975302149505875*n^4 - 4267311104/74709183293685*n^5 + 162669271973888/483741961826610375*n^6 - 6997871323119616/111744393181946996625*n^7 + 9176096709804032/257497949506225687875*n^8 - 2742583007248384/3125558677479863625*n^9 + 184000164420386816/669494668716186788475*n^10 + 25825509353978724352/65833642423758367533375*n^11 + 474430975810962194432/191231056564250496168375*n^12) * eps^17
+        + (16384/2645652625 - 4459593728/131142354968625*n + 683694620672/23362073806553625*n^2 - 4708587536384/490603549937626125*n^3 + 4981810735874048/41505060324723170175*n^4 - 4141263468101632/41505060324723170175*n^5 - 128620429312/61488978258849141*n^6 - 846813328864968704/2851551366754128913875*n^7 + 1788171473911808/8804103705244308825*n^8 + 1326028891881472/17711499172385893875*n^9 + 9596814579755646976/13166728484751673506675*n^10 - 750111204931779166208/1338617395949753473178625*n^11) * eps^18
+        - (2904064/3461235175125 + 2958819328/1637164237834125*n + 4705547190272/152256274118573625*n^2 - 146247378010112/2231454856167912375*n^3 + 262034852675584/23058366847068427875*n^4 - 3520094671732736/41505060324723170175*n^5 + 192477728515555328/1222093442894626677375*n^6 + 197600147073138688/25663962300787160224875*n^7 + 16561239183333523456/76991886902361480674625*n^8 - 60789556653064192/195251292810630877275*n^9 - 4137720727496818688/43809296594719204576755*n^10) * eps^19
+        + (34512896/7087291072875 - 9907994624/446499337591125*n + 3823108096/246887869020975*n^2 - 25192398061568/1517948914697294625*n^3 + 3534351694299136/44020518526221544125*n^4 - 204278900719616/5404835865381641325*n^5 + 18176218480246784/407364480964875559125*n^6 - 49000957506224128/268264414293942441375*n^7 + 632282024639463424/24291557899675547378625*n^8 - 46549976629564669952/362214118904050939801275*n^9) * eps^20
+        - (2117632/16664711441625 + 26093551616/86939799590957625*n + 103808499187712/4260050179956923625*n^2 - 53918297227264/1420016726652307875*n^3 + 78919969518125056/6999262445669225515875*n^4 - 224942358339518464/3079675476094459226985*n^5 + 368415416516608/5142048146821711125*n^6 - 17484436828061696/931035320196623767125*n^7 + 410932027851051892736/2328519335811756041579625*n^8) * eps^21
+        + (25772032/6694371262875 - 133717557248/8856653180783625*n + 1545601024/163766200744125*n^2 - 101307837841408/5789298962505562875*n^3 + 911117337493504/17367896887516688625*n^4 - 4578636945424384/236898113545727632845*n^5 + 373748610906456064/6851465048626436440125*n^6 - 5893247183635873792/59705623995173231835375*n^7) * eps^22
+        + (383798272/2232164622799125 + 134230114304/274556248604292375*n - 1587412992/84540195648671*n^2 + 4215981839024128/179468267837672449125*n^3 - 6728033666596864/538404803513017347375*n^4 + 45351317263679488/822175805835172372815*n^5 - 14952491409948934144/417939367966212622847625*n^6) * eps^23
+        + (31922176/10382161036275 - 756217020416/70982835005012175*n + 83513311232/12911695808365125*n^2 - 77487943712768/4850493725342498625*n^3 + 35707127975641088/1024705916363484628875*n^4 - 154170794895474688/11072679359104853904015*n^5) * eps^24
+        + (95460352/330152720953545 + 15683878912/18158399652444975*n - 1152264568832/79674610719911625*n^2 + 16279305360441344/1049323475915760535875*n^3 - 7264491379390939136/576078588277752534195375*n^4) * eps^25
+        + (319913984/128782976258475 - 140867796992/18158399652444975*n + 8628023066624/1785575965823755875*n^2 - 21496495314305024/1561188586118570553375*n^3) * eps^26
+        + (89350144/275963520553875 + 38433980416/37990977996250125*n - 5437096198144/484089484067773815*n^2) * eps^27
+        + (648134656/319251915934875 - 48446308352/8346157230868875*n) * eps^28
+        + 13087612928/40785938165944125 * eps^29;
+C4[8] = + (16384/35334585 - 131072/82447365*n + 262144/111546435*n^2 - 393216/185910725*n^3 + 524288/386122275*n^4 - 131072/203591745*n^5 + 262144/1168767425*n^6 - 917504/16529710725*n^7 + 1048576/115707975075*n^8 - 393216/475688341975*n^9 + 262144/11131107202215*n^10 + 131072/207443361495825*n^11 + 524288/10902301109725025*n^12 + 131072/22643240766351975*n^13 + 1835008/1976431444034436675*n^14 + 131072/717371413019906645*n^15 + 2097152/49889920996384416675*n^16 + 131072/11964551189178163275*n^17 + 786432/248596785819590725825*n^18 + 131072/131610063080959796025*n^19 + 524288/1552998744355325593095*n^20 + 131072/1074069426368195704975*n^21) * eps^8
+        - (32768/247342095 - 524288/632096465*n + 1048576/451497475*n^2 - 19398656/5019589575*n^3 + 2097152/490128275*n^4 - 3670016/1101980715*n^5 + 646971392/347123925225*n^6 - 524288/701260455*n^7 + 297795584/1427065025925*n^8 - 100139008/2650263619575*n^9 + 573571072/152125131763605*n^10 - 345505792/2973354848106825*n^11 - 140509184/42051732851796525*n^12 - 31981568/118248035113171425*n^13 - 370147328/10760571195298599675*n^14 - 173539328/29933952597830650005*n^15 - 1652555776/1385039235280576901025*n^16 - 163053568/570310273350825782775*n^17 - 1048576/13559824681068585045*n^18 - 145227776/6285947298581079781575*n^19 - 236978176/31577641135224953726265*n^20) * eps^9
+        - (327680/1137773637 - 2097152/1896289395*n + 4194304/2585849175*n^2 - 140509184/274961962275*n^3 - 746586112/347123925225*n^4 + 4011851776/902522205585*n^5 - 180355072/38569325025*n^6 + 593494016/186138916425*n^7 - 16492003328/11131107202215*n^8 + 824180736/1773020183725*n^9 - 1819459715072/19624141997505045*n^10 + 1029701632/102529477520925*n^11 - 510757175296/1537224456471228525*n^12 - 140509184/13821198909331725*n^13 - 1431352377344/1646367392880685750275*n^14 - 225198473216/1939054929392807661435*n^15 - 8623489024/421533680302784274225*n^16 - 2097152/478582047567126531*n^17 - 7159676928/6574956369780209886475*n^18 - 2451870580736/8052298489482363200197575*n^19) * eps^10
+        - (32768/3160482325 + 524288/4491211725*n - 2245001216/2474657660475*n^2 + 1357381632/568254722035*n^3 - 222103076864/76714387474725*n^4 + 252182528/347123925225*n^5 + 3595567104/1236789689135*n^6 - 825139658752/166966608033225*n^7 + 2229746532352/526586994566325*n^8 - 24933922504704/10902301109725025*n^9 + 236428469469184/294362129962575675*n^10 - 220538009550848/1257729100749186975*n^11 + 1499084095488/73201164593868025*n^12 - 13072994926592/18091949372315228025*n^13 - 2040474989756416/87257471822676344764575*n^14 - 6790939410432/3231758215654679435725*n^15 - 25599422758912/87257471822676344764575*n^16 - 20380647424/379017215455930526475*n^17 - 10682977222656/894699832164707022244175*n^18) * eps^11
+        - (4390912/85333022775 - 30932992/353522522925*n - 974127104/6974035224975*n^2 + 1518862336/10959198210675*n^3 + 7400849408/5901106728825*n^4 - 488389476352/149391175608675*n^5 + 25309478912/8787716212275*n^6 + 52781645824/72059272940655*n^7 - 66496793411584/15492743682240825*n^8 + 523779964928/108340864910775*n^9 - 2218114952462336/728158953065318775*n^10 + 110526137368576/92674775844676935*n^11 - 24551725073432576/86650915414772934225*n^12 + 1139122395152384/32115374244636122475*n^13 - 243837663444992/183699940679318620557*n^14 - 3944412899442688/87257471822676344764575*n^15 - 21872702478352384/5148190837537904341109925*n^16 - 79756985368576/129181259189556628880175*n^17) * eps^12
+        + (3178496/824885886825 - 8159494144/76714387474725*n + 28228714496/76714387474725*n^2 - 7773618176/25571462491575*n^3 - 918323986432/2838432336564825*n^4 - 73427058688/2838432336564825*n^5 + 368816685056/157052261537325*n^6 - 72769601536/19245644325765*n^7 + 676461543424/534232540766925*n^8 + 9767632764928/3152203260023025*n^9 - 25415227305623552/5097112671457231425*n^10 + 135017417670656/36638864868825765*n^11 - 66304019129171968/41373860513360049675*n^12 + 145615781360041984/353269116690997347225*n^13 - 137176212422262784/2493070623505038421845*n^14 + 3729769993966452736/1716063612512634780369975*n^15 + 1058897908499218432/13653897438687485426421975*n^16) * eps^13
+        - (425787392/25571462491575 - 312475648/76714387474725*n - 3149922304/76714387474725*n^2 - 266338304/1220831112501*n^3 + 133689245696/218340948966525*n^4 - 706671017984/6125038199955675*n^5 - 169910302932992/333610413957585765*n^6 - 42284273893376/37625234656870575*n^7 + 2678029734117376/728158953065318775*n^8 - 50720495632384/18670742386290225*n^9 - 147754295071080448/86650915414772934225*n^10 + 1991354095820079104/417499865180269592175*n^11 - 6383204028028813312/1530832838994321837975*n^12 + 13477708903179354112/6712113217128949597275*n^13 - 21544372591302541312/38708201785999280760225*n^14 + 8255721773950736269312/104679880363270721602568475*n^15) * eps^14
+        + (17530880/3068575498989 - 148373504/2191839642135*n + 404992557056/2838432336564825*n^2 - 20048248832/2838432336564825*n^3 - 3228475326464/116375725799157825*n^4 - 5795679305728/10998145515085245*n^5 + 170148181835776/294362129962575675*n^6 + 465493530509312/1083849501567271725*n^7 + 208517906563072/1333091006381122065*n^8 - 260996618389028864/86650915414772934225*n^9 + 3267061749675720704/918499703396593102785*n^10 + 94463949577650176/270146971587233265525*n^11 - 374414914557426270208/87257471822676344764575*n^12 + 48107557630944739328/10703099454340757465925*n^13 - 107256596269866972872704/44862805869973166401100775*n^14) * eps^15
+        - (2392064/370600905675 + 13398966272/2838432336564825*n + 969408512/113537293462593*n^2 - 65784774656/391837460603225*n^3 + 65613878788096/384935093027983575*n^4 + 491445762654208/5004156209363786475*n^5 + 167957703950336/670072198974638075*n^6 - 27991057629184/35524164265415595*n^7 - 274682871808/4774307409778725*n^8 + 31849951526912/81267337633079675*n^9 + 85896645649629184/39934769712895352295*n^10 - 14718170769933991936/3793803122725058468025*n^11 + 6913119271458439168/8290162379288090726425*n^12 + 93498692521370058752/25617068365267327254075*n^13) * eps^16
+        + (18907136/3625073226775 - 4455923712/105127123576475*n + 2328359862272/38791908599719275*n^2 + 17735090176/1630549432832775*n^3 + 10321999691776/122052590472287475*n^4 - 1564119174479872/5736471752197511325*n^5 - 12271672623104/26132815760010884925*n^6 - 1687898088275968/548789130960228583425*n^7 + 85790295270096896/114963730991668438425*n^8 - 48612562263605248/140511226767594758075*n^9 - 144303099260960768/252920208181670564535*n^10 - 32925506590743199744/24870487137864272179275*n^11 + 5803202512319846285312/1517099715409720602935775*n^12) * eps^17
+        - (2818048/1052440614225 + 2097152/556196266395*n + 34830175698944/1668052069787928825*n^2 - 817174151168/8136839364819165*n^3 + 9693923228254208/235195341840097964325*n^4 + 1509699878912/12378702202110419175*n^5 + 20629029027577856/78398447280032654775*n^6 - 1502359475323928576/9695274646964038307175*n^7 - 77656474062422016/646351643130935887145*n^8 - 15703217037901824/28102245353518951615*n^9 + 3216346923887755264/4974097427572854435855*n^10 + 151253870568701689856/303419943081944120587155*n^11) * eps^18
+        + (5668864/1307577732825 - 35127296/1285830078225*n + 1102053376/39315814688475*n^2 - 557695107072/8710938586670294975*n^3 + 137507511468032/1606212090615303171*n^4 - 182280443123990528/1646367392880685750275*n^5 - 5069564455944192/190103424450275260925*n^6 - 1757120135666597888/9695274646964038307175*n^7 + 8143172317497786368/29085823940892114921525*n^8 + 4608940312331026432/38134746944725217341555*n^9 + 27362078865048469504/82750893567802941978315*n^10) * eps^19
+        - (30605312/27952275991419 + 2339897344/1128841915038075*n + 158625682161664/7586946510970902075*n^2 - 2136205134659584/36585942064015238895*n^3 + 18482688723779584/1646367392880685750275*n^4 - 8057707396857856/183699940679318620557*n^5 + 1468225245085171712/9695274646964038307175*n^6 - 45659846177456128/12465353117525192109225*n^7 + 3630426979762700288/43262107878469784379075*n^8 - 46360400310384984064/136836444919308132813815*n^9) * eps^20
+        + (199327744/56660018901525 - 1799016153088/98531772869751975*n + 10114609184768/689722410088263825*n^2 - 35751973093376/4828056870617846775*n^3 + 509942296483987456/7932497438425122251325*n^4 - 3839901122350809088/87257471822676344764575*n^5 + 820897336077058048/87257471822676344764575*n^6 - 6551724376476614656/43262107878469784379075*n^7 + 1594219615901188096/25479889743595307489469*n^8) * eps^21
+        - (3604480/9407823081427 + 3482423656448/4045128729436574325*n + 2660096597295104/149669762989153250025*n^2 - 92190363168538624/2644165812808374083775*n^3 + 179628626935808/27639363896951645475*n^4 - 616136831697682432/12465353117525192109225*n^5 + 7747397749250719744/100944918383096163551175*n^6 + 3997177385754558464/2638988580586656847123575*n^7) * eps^22
+        + (248348672/87234019741575 - 3932568420352/311163748418198025*n + 20285863493632/2355954095166356475*n^2 - 50564857069568/4960911468683628675*n^3 + 943092251230208/21041107263727114725*n^4 - 19962886927941632/1012825268057821038975*n^5 + 13369059142137806848/473664617028374305893975*n^6) * eps^23
+        - (9158656/176496737616675 + 51089113088/402236065028402325*n + 2603006914985984/181408465327809448575*n^2 - 790244020584448/36281693065561889715*n^3 + 3890695479230464/568170272325119119425*n^4 - 77002004121387008/1824125611149066646575*n^5) * eps^24
+        + (96272384/41574787083039 - 185838075904/20579519606104305*n + 2264108367872/402236065028402325*n^2 - 733824970391552/69954898394384035725*n^3 + 40925748722139136/1324318593741959848725*n^4) * eps^25
+        + (223215616/2189310596394075 + 9760145408/34299199343507175*n - 64667779072/5668495129599225*n^2 + 297990161956864/20815847814914274045*n^3) * eps^26
+        + (34930688/18397568036925 - 1867513856/281414651824075*n + 9746486657024/2420447420338869075*n^2) * eps^27
+        + (80084992/472492835583615 + 407322492928/816625117500347925*n) * eps^28
+        + 474546176/302118060488475 * eps^29;
+C4[9] = + (32768/92147055 - 524288/423876453*n + 1048576/557732175*n^2 - 524288/295269975*n^3 + 2097152/1712565855*n^4 - 524288/816762177*n^5 + 1048576/4083810885*n^6 - 524288/6806351475*n^7 + 4194304/251835004575*n^8 - 524288/218257003965*n^9 + 1048576/5369122297539*n^10 - 524288/104941935815535*n^11 - 2097152/17315419409563275*n^12 - 524288/62601900942267225*n^13 - 1048576/1139354597149263495*n^14 - 524288/3873805630307495883*n^15 - 8388608/342186164010495469665*n^16 - 524288/100642989414851608725*n^17 - 1048576/833530399512745374825*n^18 - 524288/1552998744355325593095*n^19 - 2097152/21175594643621439557613*n^20) * eps^9
+        - (65536/706460755 - 2097152/3532303775*n + 4194304/2445441075*n^2 - 2097152/703227525*n^3 + 310378496/88482569175*n^4 - 10485760/3539302767*n^5 + 4194304/2268783825*n^6 - 216006656/251835004575*n^7 + 16777216/57436053675*n^8 - 1050673152/14914228604275*n^9 + 20971520/1877010234099*n^10 - 2097152/2124330684525*n^11 + 2457862144/90424968027719325*n^12 + 2097152/2981042902012725*n^13 + 1665138688/32281713585895799025*n^14 + 10485760/1754800841079463947*n^15 + 33554432/36402783405371858475*n^16 + 2097152/12026520747686670225*n^17 + 8216641536/213105938808758567496925*n^18 + 1524629504/157888205676124768631325*n^19) * eps^10
+        - (2326528/10596911325 - 82313216/95372201925*n + 221249536/162693756225*n^2 - 2214068224/3175541093725*n^3 - 5773459456/4512611027925*n^4 + 38273024/11541204675*n^5 - 1439694848/363761673275*n^6 + 30220484608/9821565178425*n^7 - 675505242112/402684172315425*n^8 + 416099598336/641311829983825*n^9 - 3008871006208/17315419409563275*n^10 + 2228015857664/73984064749952175*n^11 - 606058053632/210991592064678425*n^12 + 629970305024/7449626212129799775*n^13 + 11919585968128/5132792460157432044975*n^14 + 286785536/1597507768489708075*n^15 + 2127007055872/97523056742991208854525*n^16 + 1188855021568/338462373402145960142175*n^17 + 390595608576/565194011623229244230975*n^18) * eps^11
+        - (131072/13624600275 + 180355072/2765793855825*n - 52856619008/85739609530575*n^2 + 153607995392/85739609530575*n^3 - 214295379968/85739609530575*n^4 + 9030336512/7259417740575*n^5 + 15695085568/9821565178425*n^6 - 1529423593472/402684172315425*n^7 + 6129622974464/1574129037233025*n^8 - 6244047781888/2473631344223325*n^9 + 901962769891328/813824712249473925*n^10 - 169940577419264/517888453249665225*n^11 + 5983846365396992/96845140757687397075*n^12 - 2497185367195648/394830189242879388075*n^13 + 1016145951850496/5132792460157432044975*n^14 + 79944201797632/13931865248998744122075*n^15 + 2678152291680256/5753860347836481322416975*n^16 + 1219100030271488/20646204777530903568672675*n^17) * eps^12
+        - (38371328/921931285275 - 7124549632/85739609530575*n - 7777288192/85739609530575*n^2 + 5844238336/28579869843525*n^3 + 2206377967616/3172365552631275*n^4 - 7741853138944/3172365552631275*n^5 + 588422053888/207443361495825*n^6 - 1226503094272/2473631344223325*n^7 - 47695532130304/17315419409563275*n^8 + 1124341091139584/271274904083157975*n^9 - 18477597873668096/5696772985746317475*n^10 + 2032671912361984/1257729100749186975*n^11 - 901293789562273792/1710930820052477348325*n^12 + 42334411434754048/394830189242879388075*n^13 - 163252679692255232/13931865248998744122075*n^14 + 744321399983177728/1917953449278827107472325*n^15 + 4148491175365443584/350985481218025360667435475*n^16) * eps^13
+        + (3997696/2598169985775 - 903872512/12248515647225*n + 1463812096/5043506442975*n^2 - 330303537152/1057455184210425*n^3 - 644840685568/3172365552631275*n^4 + 33686114271232/130066987657882275*n^5 + 364877893861376/266327641394711325*n^6 - 3230396317696/1025652020775525*n^7 + 250926233288704/116260673178496275*n^8 + 8017412096/6166319734575*n^9 - 375725184457375744/96845140757687397075*n^10 + 1749781404081717248/466617496377948367725*n^11 - 3629731902618861568/1710930820052477348325*n^12 + 812820766249713664/1071681942230672624775*n^13 - 136540391127453270016/821980049690925903202425*n^14 + 18969171985216569344/983152608453852550889175*n^15) * eps^14
+        - (245137408/17147921906115 - 716701696/85739609530575*n - 136481603584/3172365552631275*n^2 - 391995981824/3172365552631275*n^3 + 66031785607168/130066987657882275*n^4 - 59127928193024/223715218771557513*n^5 - 115604364197888/243168716056040775*n^6 - 446272603947008/1632704236376273775*n^7 + 1557731995549696/601522613401785075*n^8 - 64333349912576/20742159082820175*n^9 + 1510914246311936/8926595582882490513*n^10 + 103393420971081728/31880698510294608975*n^11 - 17039762398700896256/4240132901869182993675*n^12 + 49758510742429499392/19243680093098599740525*n^13 - 2203163010064352018432/2180034044832455656319475*n^14) * eps^15
+        + (11272192/3175541093725 - 160750895104/3172365552631275*n + 391966097408/3172365552631275*n^2 - 1484783616/52937316914075*n^3 - 1645274464256/22643240766351975*n^4 - 271039707742208/798982924184133975*n^5 + 1203213663469568/1947150978196889465*n^6 + 14046369685700608/80002507582437414975*n^7 - 2400351256838144/6154039044802878075*n^8 - 555325673439232/330614651217870019*n^9 + 150633156104421376/44632977914412452565*n^10 - 1199924118397386752/848026580373836598735*n^11 - 22180222633385132032/9265475600380807282475*n^12 + 681703202986871750656/167694926525573512024575*n^13) * eps^16
+        - (645431296/109391915607975 + 2509766656/1057455184210425*n - 119882645504/43355662552627425*n^2 - 77087334989824/621431163254326425*n^3 + 989579437932544/5592880469288937825*n^4 + 18971230665703424/262865382056580077775*n^5 + 361546193567744/5841452934590668395*n^6 - 4303816224145408/6456342717179159805*n^7 + 24826556685746176/94225175597092955415*n^8 + 1074863049015296/1847552462688097165*n^9 + 74487682881814528/94225175597092955415*n^10 - 10560014891117707264/3335571216137090621691*n^11 + 8338801317940035584/3569646389199342595143*n^12) * eps^17
+        + (12517376/3528771471225 - 16569597952/498340948880775*n + 34373491490816/621431163254326425*n^2 + 14185784147968/1864293489762979275*n^3 + 9593926155501568/262865382056580077775*n^4 - 433933481381199872/1840057674396060544425*n^5 + 8370378225221632/122670511626404036295*n^6 + 745576811380867072/6501537116199413923635*n^7 + 3198014784708542464/6501537116199413923635*n^8 - 18857274447495168/31408391865697651805*n^9 - 7451675099423309824/16677856080685453108455*n^10 - 21739933006661943296/203469844184362527923151*n^11) * eps^18
+        - (1007255552/381428116298775 + 175928508416/60138499669773525*n + 2279485734912/207143721084775475*n^2 - 804978403311616/9735754890984447325*n^3 + 95773494987456512/1840057674396060544425*n^4 + 50744948926447616/1840057674396060544425*n^5 + 26469016886312960/144478602582209198303*n^6 - 307334446787854336/1413377633956394331225*n^7 - 1485100810906894336/10835895193665689872725*n^8 - 251158947597647872/1039541164920773499985*n^9 + 12178767189407432704/16148400332092264120885*n^10) * eps^19
+        + (804651008/260339825410275 - 10372513792/468611685738495*n + 1906369888256/71256541625529975*n^2 + 788413234020352/204450852710673393825*n^3 + 602924036128768/10514615282263203111*n^4 - 2206517246069571584/19504611348598241770905*n^5 - 240955790435811328/10835895193665689872725*n^6 - 1142671088526819328/13931865248998744122075*n^7 + 194173652701282304/654666099423880000275*n^8 + 789891485725097984/16269664915311980747575*n^9) * eps^20
+        - (2371059712/1963103007823425 + 6706906529792/3413836130604936075*n + 329029822447616/23896852914234552525*n^2 - 94227876046962688/1840057674396060544425*n^3 + 1433188842334060544/97523056742991208854525*n^4 - 137127157376221184/8865732431181018986775*n^5 + 1854149531196719104/13931865248998744122075*n^6 - 7709842757648384/231348170473100451225*n^7 - 12929216601344966656/2949457825361557652667525*n^8) * eps^21
+        + (6121127936/2365790804300025 - 9780355661824/645860889573906825*n + 337309337649152/23896852914234552525*n^2 - 6056167547600896/2955244143727006328925*n^3 + 254426069598208/5127664795362069975*n^4 - 4848317375375736832/97523056742991208854525*n^5 - 29396030701174784/3639380359162859786475*n^6 - 326650603128022368256/2949457825361557652667525*n^7) * eps^22
+        - (1494646784/2827408522212225 + 371029704704/347771248232103675*n + 180777085042688/14094964119524672475*n^2 - 1032434305585381376/32507685580997069618175*n^3 + 533652355533504512/97523056742991208854525*n^4 - 1457447658973560832/48351767628877994306025*n^5 + 528841186136871141376/6882068259176967856224225*n^6) * eps^23
+        + (13631488/6363259989975 - 165322686464/15501998449370475*n + 1654857408708608/202750637719316442525*n^2 - 1083196489859072/202750637719316442525*n^3 + 16533872472953454592/442604642141267794032075*n^4 - 11374232737209647104/509412890011647838414275*n^5) * eps^24
+        - (133758976/696989077568595 + 3012558848/6764893988165775*n + 10799600893952/989027501069836305*n^2 - 5380229842337792/265828613898659335755*n^3 + 2984159999753715712/729699545151819876647475*n^4) * eps^25
+        + (482213888/271875172101225 - 32879149056/4259377696252525*n + 11694399029248/2261729556710090775*n^2 - 13001758565466112/1977505542416856034275*n^3) * eps^26
+        - (92864512/4311163443319425 + 13999538176/254358643155846075*n + 6558828537577472/729246229927810697025*n^2) * eps^27
+        + (7357595648/4987424375604825 - 82988498944/14487280329137825*n) * eps^28
+        + 1104084992/17220729447843075 * eps^29;
+C4[10] = + (131072/468495027 - 1048576/1064761425*n + 2097152/1368978975*n^2 - 1048576/696498075*n^3 + 4194304/3810254175*n^4 - 1048576/1676511837*n^5 + 2097152/7522809525*n^6 - 1048576/10844569575*n^7 + 8388608/328951943775*n^8 - 1048576/214079836425*n^9 + 2097152/3313955867859*n^10 - 11534336/248546690089425*n^11 + 4194304/3893898144734325*n^12 + 1048576/44031002098149675*n^13 + 2097152/1390121637670154025*n^14 + 1048576/6876468367675028577*n^15 + 16777216/810440914761699796575*n^16 + 1048576/301928968244554826175*n^17 + 2097152/3058936920699883743975*n^18 + 1048576/6799013641555612046325*n^19) * eps^10
+        - (262144/3904125225 - 4194304/9582852825*n + 360710144/277902731925*n^2 - 960495616/410237366175*n^3 + 687865856/237505843575*n^4 - 255852544/97796523825*n^5 + 6450839552/3618471381525*n^6 - 205520896/221539064175*n^7 + 14864613376/40461089084325*n^8 - 7000293376/64438030763925*n^9 + 5729419264/248546690089425*n^10 - 37971034112/11681694434202975*n^11 + 1694498816/6579345141102825*n^12 - 532676608/83169670629838275*n^13 - 8388608/55688924260406775*n^14 - 19079888896/1891028801110632858675*n^15 - 115628572672/107788641663306072944475*n^16 - 281018368/1842807840665041525275*n^17 - 54769221632/2052546673789621992207225*n^18) * eps^11
+        - (262144/1527701175 - 2097152/3053876175*n + 9844031488/8614984689675*n^2 - 24006098944/31588277195475*n^3 - 67436019712/94764831586425*n^4 + 41307602944/16776549132525*n^5 - 4194304/1270084725*n^6 + 14032044032/4890900878325*n^7 - 4864671219712/2734013590983675*n^8 + 15122563072/18707815383075*n^9 - 21874415239168/81771861039420825*n^10 + 35727997927424/572403027275945775*n^11 - 55423533056/5802535160221275*n^12 + 148618870784/182819967237017775*n^13 - 1342592516096/62341608827823061275*n^14 - 2750890901504/5132792460157432044975*n^15 - 21836318375936/578139078012278027611275*n^16 - 212753973248/50597537673958335271575*n^17) * eps^12
+        - (262144/30878081325 + 306184192/8614984689675*n - 13480493056/31588277195475*n^2 + 42828038144/31588277195475*n^3 - 255500222464/120906854093025*n^4 + 5103004155904/3506298768697725*n^5 + 1764870848512/2522074552922925*n^6 - 2563134980096/911337863661225*n^7 + 65528014045184/19138095136885725*n^8 - 258819959554048/99943385714847675*n^9 + 775812835966976/572403027275945775*n^10 - 180518863765504/360401906062632525*n^11 + 21996665896435712/171911709191875714425*n^12 - 9225991050231808/436391261794761428925*n^13 + 29608309069709312/15398377380472296134925*n^14 - 114470959603253248/2119843286045019434574675*n^15 - 61008813821526016/43103480149582061836351725*n^16) * eps^13
+        - (10878976/319073507025 - 558891008/7289602429725*n - 1700790272/31588277195475*n^2 + 22818062336/106251477839325*n^3 + 174269136896/500899824099675*n^4 - 53224669184/29906022366675*n^5 + 20868585488384/8144406757857825*n^6 - 61644734464/51815196261675*n^7 - 5434802962432/3555298306061775*n^8 + 14461527130112/4345364596297725*n^9 - 476807490961408/150125338149511725*n^10 + 4796701484253184/2491474046259068325*n^11 - 5015812205182976/6324511040503788825*n^12 + 1694502243794944/7670151687419488575*n^13 - 570392634720256/14538161742456761325*n^14 + 21341862944190758912/5622193062988964587350225*n^15) * eps^14
+        + (524288/1858133952675 - 4924112896/94764831586425*n + 804786274304/3506298768697725*n^2 - 351306514432/1168766256232575*n^3 - 13920760758272/143758249516606725*n^4 + 88386392031232/247264189168563567*n^5 + 62856661827584/89588474336436075*n^6 - 4404285865459712/1804567840205355225*n^7 + 1625213007560704/664840783233551925*n^8 + 4974444544/549909663551325*n^9 - 650529587855360/240639932272827087*n^10 + 852519184033120256/246655930579647764175*n^11 - 3820296696273829888/1562154227004435839775*n^12 + 23851902951906869248/21269330629214241818475*n^13 - 22104299820019613696/65121927370528547343825*n^14) * eps^15
+        - (1164443648/94764831586425 - 5465178112/500899824099675*n - 138923737088/3506298768697725*n^2 - 981144174592/15973138835178525*n^3 + 7859572047872/19378071251454825*n^4 - 711065948127232/2060534909738029725*n^5 - 944472426807296/2767004021648211345*n^6 + 8403040600064/45934454114318133*n^7 + 823118570455040/505278995257499463*n^8 - 68153245696/23584672156045*n^9 + 9360719917088768/7047312302275650405*n^10 + 330730366828544000/187458507240532300773*n^11 - 63248384131625648128/18433419878652342909345*n^12 + 35425062558380326912/12356468270305416675495*n^13) * eps^16
+        + (6815744/3100175745975 - 134544883712/3506298768697725*n + 391362117632/3686108961964275*n^2 - 1431121690624/32706903329175075*n^3 - 403223609344/4722387111699075*n^4 - 18764645921718272/96845140757687397075*n^5 + 78114179466133504/135583197060762355905*n^6 - 8136706490368/128840542027965495*n^7 - 56016360077000704/104143615133629055985*n^8 - 1141393774870528/1653073256089350095*n^9 + 1292681288351744/479924493703359705*n^10 - 276681095183859712/121539032166938524677*n^11 - 161296335454236311552/224887722519558583494009*n^12) * eps^17
+        - (602537984/113106411893475 + 649068544/1228702987321425*n - 111067267072/12798353476633725*n^2 - 8775330168832/98120709987525225*n^3 + 7115549582557184/41505060324723170175*n^4 + 3469524564180992/107039366100601859925*n^5 - 2252269552664576/45194399020254118635*n^6 - 56513104184344576/114062054670165156555*n^7 + 1109330446304411648/2395303148073468287655*n^8 + 22222807760896/49805650470410835*n^9 - 36414339734831104/877781898983444900445*n^10 - 22778537759673942016/10708939167598027785429*n^11) * eps^18
+        + (2883584/1180892000925 - 749643759616/28486657738313775*n + 2341788975104/46478231046722475*n^2 + 2676389576704/1257729100749186975*n^3 + 3670594293858304/677915985303811779525*n^4 - 35364246288072704/184886177810130485325*n^5 + 11426772662878208/93323499275589673545*n^6 + 315463962248347648/2199768197210328019275*n^7 + 117185833223585792/466617496377948367725*n^8 - 1011849117514596352/1519600921896071279265*n^9 - 142458605834042605568/1124438612597792917470045*n^10) * eps^19
+        - (5780537344/2293730882825265 + 11108614144/5352038726592285*n + 21118836539392/4611673369413685575*n^2 - 45338866405605376/677915985303811779525*n^3 + 24220595910606848/406749591182287067715*n^4 + 13456242259263488/378205760222126571735*n^5 + 3987380822507257856/35929547221102024314825*n^6 - 3711602295908073472/15398377380472296134925*n^7 - 1052474648635113472/12899654884655290676925*n^8 - 291969534449942528/29143664739406397455275*n^9) * eps^20
+        + (230948864/103321210938075 - 749090111488/41463596727995175*n + 14228899495936/561964066292189925*n^2 + 3116570150699008/677915985303811779525*n^3 + 3800113671217086464/107788641663306072944475*n^4 - 11642532714023747584/107788641663306072944475*n^5 - 4973179734851584/1159017652293613687575*n^6 - 23012225673330688/2137657095171448169319*n^7 + 241570468447970656256/912779579638208368299213*n^8) * eps^21
+        - (462553088/373545916468425 + 52551483392/31036793320485225*n + 5880600854528/677238746557254525*n^2 - 144514017752252416/3266322474645638574075*n^3 + 2057594272357548032/107788641663306072944475*n^4 + 22438675829751808/9798967423936915722225*n^5 + 1223011637475147776/11336060353181922110025*n^6 - 69134393521856315392/1086642356712152819403825*n^7) * eps^22
+        + (287309824/148810974853275 - 40835743744/3230073512991675*n + 171677157687296/12611283685890496425*n^2 + 4062868639055872/5132792460157432044975*n^3 + 3966011997937467392/107788641663306072944475*n^4 - 25918257887241568256/489194604471927561824925*n^5 - 239035500430102626304/18472920064106597929865025*n^6) * eps^23
+        - (2097152/3460720345425 + 3338665984/3086210217609225*n + 291547312553984/32013258587260490925*n^2 - 3969582603698176/138724120544795460675*n^3 + 5811037897687564288/908504265447865471960575*n^4 - 314980684348453289984/20417437965591502975113975*n^5) * eps^24
+        + (299892736/183418178307525 - 5670699008/626151712153275*n + 1229233061888/156162237011026785*n^2 - 25599716360192/11447165191808296755*n^3 + 388102326440689664/12801746406172278537675*n^4) * eps^25
+        - (1325662208/4764970121563575 + 131707437056/223953595713488025*n + 6957566001152/843399711516752775*n^2 - 648601731057319936/34658386611832266284925*n^3) * eps^26
+        + (729284608/529441124618175 - 622359216128/93711079057416975*n + 1318364018376704/268669663657614467325*n^2) * eps^27
+        - (1705508864/16537249245426525 + 4212251426816/17149127467507306425*n) * eps^28
+        + 7370964992/6344479270257975 * eps^29;
+C4[11] = + (262144/1166167275 - 8388608/10495505475*n + 16777216/13233463425*n^2 - 8388608/6511704225*n^3 + 33554432/33929406225*n^4 - 8388608/13970931975*n^5 + 16777216/57436053675*n^6 - 8388608/73846354725*n^7 + 67108864/1926718527825*n^8 - 25165824/3068477655425*n^9 + 16777216/11835556670925*n^10 - 92274688/556271163533475*n^11 + 33554432/3028587445904475*n^12 - 8388608/35644144555644975*n^13 - 16777216/3508402228405626825*n^14 - 8388608/30016330176359251725*n^15 - 134217728/5132792460157432044975*n^16 - 8388608/2544829875204104963475*n^17 - 50331648/97740317799505809152725*n^18) * eps^11
+        - (524288/10495505475 - 33554432/101456552925*n + 3154116608/3145153140675*n^2 - 8422162432/4512611027925*n^3 + 402653184/167133741775*n^4 - 2248146944/976412912475*n^5 + 67108864/39763421775*n^6 - 33554432/34801155675*n^7 + 130728067072/303779287887075*n^8 - 12314476544/82848896696475*n^9 + 50398756864/1297966048244775*n^10 - 66806874112/9085762337713425*n^11 + 432315301888/463373879223384675*n^12 - 14059307008/209904406827687075*n^13 + 6509559808/4288047168051321675*n^14 + 167872823296/5132792460157432044975*n^15 + 203474075648/100944918383096163551175*n^16 + 71705821184/362214118904050939801275*n^17) * eps^12
+        - (13893632/101456552925 - 209715200/377418376881*n + 100143202304/103790053642275*n^2 - 847249408/1116022082175*n^3 - 56807653376/166966608033225*n^4 + 303692775424/166966608033225*n^5 - 327877132288/120098788234425*n^6 + 340233551872/130191123380175*n^7 - 1644771147776/911337863661225*n^8 + 13324355895296/14277626530692525*n^9 - 9906258182144/27257287013140275*n^10 + 6952620916736/66196268460483525*n^11 - 177590824337408/8186271866279795925*n^12 + 61708773097472/20780536275941020425*n^13 - 167166217289728/733256065736776006425*n^14 + 553770928832512/100944918383096163551175*n^15 + 2304156941418496/18472920064106597929865025*n^16) * eps^13
+        - (23068672/3145153140675 + 268435456/14827150520325*n - 1073741824/3578967366975*n^2 + 120527519744/116370666204975*n^3 - 6792490778624/3840231984764175*n^4 + 930665725952/622330084487475*n^5 + 7516192768/74958525582525*n^6 - 268435456/133949591325*n^7 + 4294967296/1475520327675*n^8 - 36025917243392/14277626530692525*n^9 + 7782640727883776/5097112671457231425*n^10 - 969285803442176/1444636211696434575*n^11 + 19262771556253696/90048990529077755175*n^12 - 2707075742302208/56404312748982769725*n^13 + 676791282827264/95924851171773357825*n^14 - 507232968603860992/879662860195552282374525*n^15) * eps^14
+        - (195559424/6919336909485 - 7230980096/103790053642275*n - 3590324224/132421792578075*n^2 + 768782368768/3840231984764175*n^3 + 15233712128/112867033243965*n^4 - 751199846400/590006883585119*n^5 + 129850383794176/58872425992515135*n^6 - 40231411646464/26352419253792489*n^7 - 341315682304/557976209245455*n^8 + 8519923269632/3386785828210785*n^9 - 10523692446515200/3601959621163110207*n^10 + 599531481726976/285869811203421445*n^11 - 62880043025563648/60385793648910965235*n^12 + 189132496728752128/517666248118441864365*n^13 - 5202387650333376512/58644190679703485491635*n^14) * eps^15
+        - (1048576/2661283426725 + 10938744832/295402460366475*n - 19998441472/109720913850405*n^2 + 14616780341248/52483170458443725*n^3 + 278904438784/19854337211552025*n^4 - 2439370095198208/6770328989139240525*n^5 - 1901239885365248/7071232499767651215*n^6 + 13414323716096/7492854217229199*n^7 - 46041636559388672/19369028151537479415*n^8 + 1655979603132416/2001088678423950115*n^9 + 88115990755278848/54029394317446653105*n^10 - 3016160029834215424/1026558492031486408995*n^11 + 440601082733789184/172555416039480621455*n^12 - 408103109306259341312/284198770217024583536385*n^13) * eps^16
+        - (447217664/42200351480925 - 15720251392/1280077328254725*n - 1793585053696/52483170458443725*n^2 - 48544689946624/2256776329713080175*n^3 + 193959179583488/615484453558112775*n^4 - 17041511862501376/45457923212792043525*n^5 - 1340168745254912/7071232499767651215*n^6 + 1915907735552/5005422944521545*n^7 + 1984009542303744/2236510875885591305*n^8 - 91383922335678464/38020684890055052185*n^9 + 217388623232761856/114062054670165156555*n^10 + 1205183727169175552/2243220408513248078915*n^11 - 1073322175445659025408/410509334757924398441445*n^12) * eps^17
+        + (165675008/123878451121425 - 4622190116864/157449511375331175*n + 614939458797568/6770328989139240525*n^2 - 11825387143168/218397709327072275*n^3 - 5151446051848192/63641092497908860935*n^4 - 4826842355728384/54327761888458783725*n^5 + 121985894142967808/247493137491867792525*n^6 - 9299663088083009536/39351408861206979011475*n^7 - 3754773200299360256/7870281772241395802295*n^8 - 315887059992576/5431526412865007455*n^9 + 38068651355990392832/20188983676619232710235*n^10 - 3051858507355257831424/1231528004273773195324335*n^11) * eps^18
+        - (68442914816/14313591943211925 - 84196458496/98120709987525225*n - 25683753435136/2256776329713080175*n^2 - 604695332651008/9642589772410433475*n^3 + 353014314325508096/2227438237426810132725*n^4 - 80709003771904/11911434424742300175*n^5 - 124062850418212864/1192466935188090273075*n^6 - 1194565469995008/3677358084403978975*n^7 + 7413082615709696/13706516496414830725*n^8 + 360655275281088512/1779105841234645028105*n^9 - 6125829954174189568/14155494301997393049705*n^10) * eps^19
+        + (1985478656/1172351340110691 - 369199415296/17585270101660365*n + 2067731675348992/45457923212792043525*n^2 - 2675726071365632/742479412475603377575*n^3 - 135473603280896/10264692338372396925*n^4 - 3462210456242880512/23610845316724187406885*n^5 + 40055605280374784/257198750726843000075*n^6 + 2039759270643236864/16864889511945848147775*n^7 + 935494308843225088/14128193445098651693775*n^8 - 72049578521657344/120450007009226799905*n^9) * eps^20
+        - (61731504128/26140266367332975 + 5430390554624/4132538473890185775*n + 2777619103744/5785553863446260085*n^2 - 39529633695137792/742479412475603377575*n^3 + 85969920990380032/1356945133145068241775*n^4 + 1267388178910674944/39351408861206979011475*n^5 + 178954570188193792/3372977902389169629555*n^6 - 4539444203519737856/19510362376564804719975*n^7 - 13768334851964928/4265706469428147268525*n^8) * eps^21
+        + (51497664512/31502372288837175 - 11603927891968/781831603168413525*n + 687018673700864/28927769317231300425*n^2 + 451808010960896/123358648467733476525*n^3 + 315883222439297024/16864889511945848147775*n^4 - 11534590875170504704/118054226583620937034425*n^5 + 39818830423294738432/2321733122811211761677025*n^6 + 9511520652935299072/296081645626795646262645*n^7) * eps^22
+        - (15328083968/12549725545959525 + 575324291072/420986247859914975*n + 1473387591368704/290059524775481417775*n^2 - 1484013735931543552/39351408861206979011475*n^3 + 2722552774796509184/118054226583620937034425*n^4 + 2014794043929657344/169882911425210616708075*n^5 + 1634232174940323315712/20232245784497702494614075*n^6) * eps^23
+        + (348127232/238789703834325 - 213943058432/20155619816238025*n + 213938226593792/16362332166822028695*n^2 + 6461637905088512/3190654772530295595525*n^3 + 60410836325136072704/2321733122811211761677025*n^4 - 7569155107689462759424/141625720491483917462298525*n^5) * eps^24
+        - (20004732928/31217773947940755 + 5140337655808/5150932701410224575*n + 1398502957514752/221490106160639656725*n^2 - 137966723012755456/5411965321238255854725*n^3 + 692499587030337978368/84975432294890350477379115*n^4) * eps^25
+        + (5125439488/4059048622072675 - 4424890056704/572325855712247175*n + 51535312584704/6753445097404516665*n^2 - 10447444596752384/29523810817486745353825*n^3) * eps^26
+        - (573046784/1739592266602575 + 2801795072/4462432336067475*n + 1814487552229376/294257250672625368975*n^2) * eps^27
+        + (70254592/64918370480425 - 5136982212608/894398938214666775*n) * eps^28
+        - 133782044672/854691993121895775 * eps^29;
+C4[12] = + (2097152/11408158125 - 16777216/25448968125*n + 33554432/31556720475*n^2 - 16777216/15092344575*n^3 + 67108864/75461722875*n^4 - 16777216/29390355225*n^5 + 33554432/112374887625*n^6 - 16777216/131639154075*n^7 + 134217728/3047952721275*n^8 - 16777216/1385433055125*n^9 + 33554432/13023070718175*n^10 - 184549376/455807475136125*n^11 + 67108864/1549745415462825*n^12 - 218103808/82136507019529725*n^13 + 33554432/645358269439162125*n^14 + 16777216/17166529967081712525*n^15 + 268435456/5064126340289105194875*n^16 + 16777216/3634255373619240198675*n^17) * eps^12
+        - (4194304/110278861875 - 67108864/262972670625*n + 134217728/170158786875*n^2 - 872415232/578539875375*n^3 + 268435456/132956368875*n^4 - 4898947072/2419805913525*n^5 + 41204842496/26108432224875*n^6 - 9193914368/9434139375375*n^7 + 31675383808/66038975627625*n^8 - 1543503872/8232975741375*n^9 + 1744830464/30387165009075*n^10 - 738197504/54955511186625*n^11 + 314337918976/136894178365882875*n^12 - 398693761024/1505835962024711625*n^13 + 71001178112/4087269039781360125*n^14 - 7180648448/19859318981525902725*n^15 - 13958643712/1942840923003996332625*n^16) * eps^13
+        - (67108864/603290244375 - 3959422976/8678098130625*n + 7113539584/8678098130625*n^2 - 4093640704/5633151418125*n^3 - 27111981056/278277680055375*n^4 + 132405788672/99212042454525*n^5 - 47840969621504/21330589127722875*n^6 + 12952010752/5530357564875*n^7 - 5504537460736/3103831854498375*n^8 + 3169350320128/3103831854498375*n^9 - 858590806016/1894133285565675*n^10 + 2349682655232/15210464262875875*n^11 - 322390982656/8139653848782225*n^12 + 41969279565824/5722176655693904175*n^13 - 218880525991936/241148873347100247375*n^14 + 1306280681537536/20594113783842361125825*n^15) * eps^14
+        - (54525952/8678098130625 + 67108864/8678098130625*n - 9797894144/45869947261875*n^2 + 3333095948288/4174165200830625*n^3 - 204279382016/138575524885875*n^4 + 424884404486144/294362129962575675*n^5 - 18405142822912/63991767383168625*n^6 - 20177018159104/14815827916300125*n^7 + 533664182042624/221613594411183975*n^8 - 201738439098368/85235997850455375*n^9 + 2721633399734272/1677931500541821525*n^10 - 3710043685912576/4517507886074134875*n^11 + 621105152786432/1996108135707175875*n^12 - 441490659916906496/5064126340289105194875*n^13 + 768849625137283072/44130243822519345269625*n^14) * eps^15
+        - (29360128/1239728304375 - 20166213632/321089630833125*n - 34158411776/4174165200830625*n^2 + 20367540224/115713842619375*n^3 + 145894670336/19624141997505045*n^4 - 48704828473344/54511505548625125*n^5 + 14158386065047552/7686122282356142625*n^6 - 675825217175552/412809636648283875*n^7 + 270735679422464/7017763823020825875*n^8 + 19077338759168/10714760539858375*n^9 - 117763506962432/46060864720755885*n^10 + 795676952773001216/371941482620103771375*n^11 - 3778958784987136/3041517321494958075*n^12 + 3591058194887081984/6864704594614120375275*n^13) * eps^16
+        - (4194304/5633151418125 + 111199387648/4174165200830625*n - 1310099243008/9007409117581875*n^2 + 9516238241792/37738734610586625*n^3 - 335643372683264/7359053249064391875*n^4 - 22046090417143808/69175100541205283625*n^5 - 136217706364928/38430611411780713125*n^6 + 201471972012457984/161408567929478995125*n^7 - 791337814187835392/371941482620103771375*n^8 + 53952165240111104/41326831402233752375*n^9 + 4257445253742592/5722176655693904175*n^10 - 1374618086908362752/593095877691516824625*n^11 + 1102596198475294048256/446205798649917824392875*n^12) * eps^17
+        - (38319161344/4174165200830625 - 733969645568/57046924411351875*n - 201192374272/7110196375907625*n^2 + 77779173376/22783446591530625*n^3 + 1923744574472192/8043616342000614375*n^4 - 5134140219326464/13835020108241056725*n^5 - 73618021154816/1325193496957955625*n^6 + 12436689368645632/28920399257141266875*n^7 + 11914712262377472/32776452491426769125*n^8 - 2836087701504/1540608812758015*n^9 + 6146994640781312/2967484445515364775*n^10 - 1130662023437221888/3077281369999433271675*n^11) * eps^18
+        + (809500672/1037216807479125 - 33355856871424/1471810649812878375*n + 65364033536/843057996226875*n^2 - 364693793275904/6067991275544323125*n^3 - 165619962893828096/2421128518942184926875*n^4 - 449830111412224/25485563357286157125*n^5 + 5641720934655066112/14257756833770644569375*n^6 - 499918004516028416/1474940362114204610625*n^7 - 486984838402801664/1474940362114204610625*n^8 + 786107394424832/2750797577516613625*n^9 + 10606783160177917952/9231844109998299815025*n^10) * eps^19
+        - (10592714752/2473631344223325 - 2744769314816/1471810649812878375*n - 145531712045056/11926741472621600625*n^2 - 62140576694272/1464687549269319375*n^3 + 12704342603726848/89671426627488330625*n^4 - 7144092454617088/182013917026859292375*n^5 - 1709258891583291392/14257756833770644569375*n^6 - 35423917799636992/197111845628165593125*n^7 + 87349623902961664/165126150597225943125*n^8 - 7274724790894592/223837670809572945125*n^9) * eps^20
+        + (117440512/99695905291125 - 166726067027968/9882157220172183375*n + 43686796722176/1070821989801939375*n^2 - 163178960912384/18768438131334766875*n^3 - 174335826732253184/7548224206113870654375*n^4 - 2725675759334064128/25663962300787160224875*n^5 + 750779530699866112/4424821086342613831875*n^6 + 81652953558166798336/1081552696961744609476875*n^7 - 18791673242996178944/346453864668165752623125*n^8) * eps^21
+        - (224948912128/102725127028816875 + 1906697043968/2845039387711145625*n - 994752543588352/484225703788436985375*n^2 - 3193548971180032/76517478535441741875*n^3 + 2736885148577431552/42773270501311933708125*n^4 + 39548874636918784/1710930820052477348325*n^5 + 2478501459553943552/229420269052491280798125*n^6 - 4479132491550602297344/21991571504888807059363125*n^7) * eps^22
+        + (2902458368/2407236357920625 - 663840882688/54123991660344375*n + 3649770329473024/165147762553327929375*n^2 + 16748683190075392/8554654100262386741625*n^3 + 5156555989188608/750408254408981293125*n^4 - 14223212158493130752/168241530638493605918625*n^5 + 5623976056189811163136/153941000534221649415541875*n^6) * eps^23
+        - (124436611072/105638488544098125 + 10877407330304/10467396321391288125*n + 584845428260864/229552435606325225625*n^2 - 214471771993145344/6753674289680831638125*n^3 + 3034186506932584448/116474905826649419482125*n^4 + 1440843898823037157376/92364600320532989649325125*n^5) * eps^24
+        + (20954742784/18851312770495625 - 16716281151488/1866279964279066875*n + 1001681399578624/80250038463999875625*n^2 + 48918012396306432/21569427004935077681875*n^3 + 233305107083558912/13509521766934765196625*n^4) * eps^25
+        - (8589934592/13236028115454375 + 539823702016/622093321426355625*n + 22135724572672/5243357994879283125*n^2 - 721163988242530304/32091098714659505819375*n^3) * eps^26
+        + (16777216/17034785219375 - 5177851510784/780925658811808125*n + 570623449366528/77203926338394961875*n^2) * eps^27
+        - (96162807808/269058420262891875 + 169771903483904/279013581812618874375*n) * eps^28
+        + 17725128704/20644734133379125 * eps^29;
+C4[13] = + (4194304/27484885575 - 67108864/121718778975*n + 134217728/148767396525*n^2 - 67108864/69424785045*n^3 + 268435456/335050049565*n^4 - 67108864/124447161267*n^5 + 134217728/447573123855*n^6 - 469762048/3396290175135*n^7 + 536870912/10188870525405*n^8 - 67108864/4092965082855*n^9 + 134217728/32818138209801*n^10 - 738197504/929847249277695*n^11 + 268435456/2346757343415135*n^12 - 872415232/77442992332699455*n^13 + 134217728/210202407760184235*n^14 - 67108864/5787572960330405937*n^15 - 1073741824/5295629258702321432355*n^16) * eps^13
+        - (8388608/284010484275 - 268435456/1338906568725*n + 536870912/852031452825*n^2 - 15837691904/12843585233325*n^3 + 56908316672/33393321606645*n^4 - 21206401024/11905445094543*n^5 + 535260299264/365667242189535*n^6 - 167235289088/173210798931885*n^7 + 49392123904/95775382938807*n^8 - 52881784832/237019887070785*n^9 + 476204498944/6136991845232787*n^10 - 3156532527104/147845712635153505*n^11 + 817117528064/180700315442965395*n^12 - 3489660928/4954265502765285*n^13 + 102542344192/1377993561983429985*n^14 - 1586721980416/353041950580154762157*n^15) * eps^14
+        - (171966464/1874469196215 - 3556769792/9372345981075*n + 243068305408/346776801299775*n^2 - 32950452224/48474176525775*n^3 + 19058917376/315952196739795*n^4 + 34250552246272/35323455595509081*n^5 - 14085747900416/7679012085980235*n^6 + 64179360759808/30935448689234661*n^7 - 679288269438976/398904469940131155*n^8 + 3663003123712/3409439914018215*n^9 - 2248062789484544/4228387381365390243*n^10 + 336487132430336/1626302838986688555*n^11 - 645641764077568/10299917980249027515*n^12 + 8774655565365248/607695160834692623385*n^13 - 1832502691889152/756518465528903061765*n^14) * eps^15
+        - (16777216/3124115327025 + 536870912/346776801299775*n - 46170898432/300539894459805*n^2 + 5905580032/9509288217975*n^3 - 9754744755060736/7947777508989543225*n^4 + 3564488385101824/2649259169663181075*n^5 - 257937482186752/488294827349684355*n^6 - 2181820300918784/2526394976287497315*n^7 + 1340283199422464/689016811714771995*n^8 - 1013098496393216/469820820151710027*n^9 + 34875738960166912/21141936906826951215*n^10 - 274679801577472/291718809898120605*n^11 + 249518931822247936/607695160834692623385*n^12 - 15207870067304824832/111208214432748750079455*n^13) * eps^16
+        - (6949961728/346776801299775 - 28252831744/500899824099675*n + 131130720256/26404576441825725*n^2 + 2771797409792/18526287899742525*n^3 - 525786406715392/7947777508989543225*n^4 - 1127691377967104/1840125827204475525*n^5 + 431369469558784/286241795342918415*n^6 - 9685634637627392/6011077702201286715*n^7 + 39917962919936/83949174760650381*n^8 + 253937189912576/219866886277893855*n^9 - 761094108872704/355169585525828535*n^10 + 339072536111218688/163449043258986291807*n^11 - 3279870352129261568/2373902771142419952435*n^12) * eps^17
+        - (1367343104/1502699472299025 + 3567238774784/184832035092780075*n - 132465918214144/1135396786998506175*n^2 + 16112301375488/71601599180085975*n^3 - 6424649378299904/74709108584501706315*n^4 - 97291441461526528/373545542922508531575*n^5 + 12455942029312/84188763336152475*n^6 + 27848647672594432/33892246618794488925*n^7 - 30246214112903168/16767743064035168205*n^8 + 66986725867520/43973377255578771*n^9 + 52142753567473664/817245216294931459035*n^10 - 260303992792285184/154340427845172814245*n^11) * eps^18
+        - (1476978016256/184832035092780075 - 34286388379648/2649259169663181075*n - 180670617878528/7947777508989543225*n^2 + 61736732327936/3365275161464040825*n^3 + 66288410624524288/373545542922508531575*n^4 - 129772872452276224/373545542922508531575*n^5 + 385471838420992/7884473825126623725*n^6 + 882496258441216/2234131263791502075*n^7 + 35024921427968/1557121789915289325*n^8 - 88175242312155136/67371469443668184795*n^9 + 353258965091483648/178680853741902577065*n^10) * eps^19
+        + (6308233216/15138623826646749 - 28033251540992/1589555501797908645*n + 2745111167369216/41505060324723170175*n^2 - 1883871440273408/30055388511006433575*n^3 - 138534565269471232/2614818800457559721025*n^4 + 36477384878194688/1319860918326196811565*n^5 + 20047764876427264/66659642339706909675*n^6 - 81615489704394752/212880793278418840575*n^7 - 806526138712064/4835272926579056325*n^8 + 40776148925284352/95573479908459517965*n^9) * eps^20
+        - (117658615808/30686399648608275 - 137275476279296/53363648988929790225*n - 113666846359552/9508432001663853531*n^2 - 23743407872540672/871606266819186573675*n^3 + 5706074921671589888/46195132141416888404775*n^4 - 94257108270186496/1490165552948931884025*n^5 - 49559085925793792/439953639442065603855*n^6 - 26648109036760727552/389358970906228059411675*n^7 + 355114185834643849216/766157975009029407229425*n^8) * eps^21
+        + (1778384896/2175355631198475 - 56733296754688/4157104611220285725*n + 95240944885956608/2614818800457559721025*n^2 - 27553288945664/2149710649235277975*n^3 - 24604832551665664/905786904733664478525*n^4 - 3321420989153148928/46195132141416888404775*n^5 + 153260985824307052544/908504265447865471960575*n^6 + 39586202742075424768/1583393148351994108274145*n^7) * eps^22
+        - (582454607872/288579494587524525 + 29103503704064/201139907727504593925*n - 512589851262976/144812326462121907225*n^2 - 495843902356455424/15398377380472296134925*n^3 + 2873676414538743808/46195132141416888404775*n^4 + 3616386677989179392/302834755149288490653525*n^5 - 954646975949855260672/55418760192319793789595075*n^6) * eps^23
+        + (11341398016/12676618625291775 - 28490665558016/2795807791649027925*n + 2074293110308864/101527762948168985505*n^2 + 487478788096/45156531907543390425*n^3 - 263322391923392512/209654830487968955067825*n^4 - 21704426226697895936/308453210717920930183275*n^5) * eps^24
+        - (1957280350208/1746838046565206595 + 1484716507136/2015582361421392225*n + 9798431014912/12381434505874266525*n^2 - 168009336415584256/6353176681453604699025*n^3 + 928284064644245487616/33251256115391876273757045*n^4) * eps^25
+        + (2785017856/3260242714754025 - 5101347405824/671860787140464075*n + 281627448049664/23783871864772428255*n^2 + 200888040405598208/103975159835496798854775*n^3) * eps^26
+        - (24041750528/37532941992020475 + 24928795492352/34579388172186863775*n + 9096895888621568/3418589858264128911825*n^2) * eps^27
+        + (75027709952/96861031294641075 - 245770913579008/43047809765375483475*n) * eps^28
+        - 5320214577152/14381121797311898475 * eps^29;
+C4[14] = + (16777216/130734984825 - 134217728/287616966615*n + 268435456/347123925225*n^2 - 402653184/475688341975*n^3 + 536870912/742073813481*n^4 - 671088640/1322827232727*n^5 + 805306368/2708646238441*n^6 - 939524096/6415214775255*n^7 + 1073741824/17736182025705*n^8 - 402653184/19312731539101*n^9 + 1342177280/227295994267881*n^10 - 1476395008/1095153426927063*n^11 + 1610612736/6692604275665385*n^12 - 1744830464/54496920530418135*n^13 + 268435456/91866237465561999*n^14 - 2013265920/13075627799264991191*n^15) * eps^14
+        - (33554432/1438084833075 - 536870912/3355531277175*n + 63350767616/124154657255475*n^2 - 170188079104/166966608033225*n^3 + 19327352832/13344309803825*n^4 - 40265318400/25652473199353*n^5 + 1073741824/795175736355*n^6 - 1800128167936/1909595598100905*n^7 + 2658584756224/4924746542470755*n^8 - 1252519837696/4924746542470755*n^9 + 5127117209600/52202313350190003*n^10 - 617938419712/20077812826996155*n^11 + 517543559168/67319725361104755*n^12 - 272193552384/182985594951729185*n^13 + 1987496116224/9339734142332136565*n^14) * eps^15
+        - (33554432/437677992675 - 118916907008/372463971766425*n + 2921114632192/4842031632963525*n^2 - 41529917833216/66174432317168175*n^3 + 15828028227584/98120709987525225*n^4 + 688000073728/991118282702275*n^5 - 41783052468224/27949535572204155*n^6 + 511575970545664/280710552920833035*n^7 - 451179871993856/280710552920833035*n^8 + 3293434609664/3000132951160345*n^9 - 466469418696704/783034700252850045*n^10 + 3850775604232192/14877659304804150855*n^11 - 2019084526944256/22507228179062689755*n^12 + 33587298968797184/1372940918922824075055*n^13) * eps^16
+        - (33554432/7303215132675 - 536870912/254843770155975*n - 185757335552/1668262999592475*n^2 + 1385680466870272/2845500589638231525*n^3 - 8731481681690624/8536501768914694575*n^4 + 220686693957632/179675585821312425*n^5 - 18664854126592/27949535572204155*n^6 - 3126150465323008/6456342717179159805*n^7 + 22847709891264512/14877659304804150855*n^8 - 8552890499072/4455723062235445*n^9 + 24140837571002368/14877659304804150855*n^10 - 902189565035413504/877781898983444900445*n^11 + 1286177449842835456/2549747420856673282245*n^12) * eps^17
+        - (7532969984/440184693905775 - 3347792789504/66174432317168175*n + 628407402496/45166676026003675*n^2 + 1061963278843904/8536501768914694575*n^3 - 42469753851215872/401215583138990645025*n^4 - 5274287887876096/12942438165773891775*n^5 + 211258703872/173992581377615*n^6 - 1850811063730176/1226473706130808135*n^7 + 2759545478709248/3679421118392424405*n^8 + 14770795184128/22853547319207605*n^9 - 561234382422016/325466035959749685*n^10 + 370678562706948096/191916472537599064255*n^11) * eps^18
+        - (64156073984/66174432317168175 + 119902602002432/8536501768914694575*n - 803081574940672/8536501768914694575*n^2 + 26611905128824832/133738527712996881675*n^3 - 1091076312006656/9785745930219284025*n^4 - 80232536004886528/401215583138990645025*n^5 + 40295383171072/179333130140134971*n^6 + 27565954804219904/55191316775886366075*n^7 - 7369373605953536/5017392434171487825*n^8 + 113261581835436032/72361948661717679965*n^9 - 730314374996033536/1727248252838391578295*n^10) * eps^19
+        - (11934908809216/1707300353782938915 - 21674552459264/1707300353782938915*n - 7136169766682624/401215583138990645025*n^2 + 2271120724066304/85106335817361651975*n^3 + 2672234162290688/20803770977577292705*n^4 - 444331359809306624/1417628393757766945755*n^5 + 15332470606004224/124353367873488328575*n^6 + 1711864442519552/5317435835550513675*n^7 - 53216998439518208/296026153616117781675*n^8 - 18886946599852834816/22070394341823892389325*n^9) * eps^20
+        + (268435456/1507949438070075 - 2452426326016/177450501167178525*n + 9324812086280192/165206416586643206775*n^2 - 8403666155339776/133738527712996881675*n^3 - 797421959095779328/21264425906366504186325*n^4 + 8042800387494772736/148850981344565529304275*n^5 + 4598266951456784384/21264425906366504186325*n^6 - 19374719994788052992/50184045139024949879727*n^7 - 2122206253634551808/98749250112274901376237*n^8) * eps^21
+        - (201259483136/58563068623411275 - 503944082096128/165206416586643206775*n - 31263441683480576/2808509081972934515175*n^2 - 4250309836668928/265331517548245150275*n^3 + 127802792763981824/1210170580037118124425*n^4 - 3927713021463363584/49616993781521843101425*n^5 - 7376736415775719424/79118990084048344404975*n^6 + 247806897622756622336/25510222945671016188861225*n^7) * eps^22
+        + (58116276224/103318584481953225 - 799750827802624/72013053383921397825*n + 1608466708345913344/49616993781521843101425*n^2 - 790392194996371456/49616993781521843101425*n^3 - 454932135812268032/16538997927173947700475*n^4 - 624347071410864128/14142041705844390062725*n^5 + 28145849041027147497472/178571560619697113322028575*n^6) * eps^23
+        - (2953729540096/1593028407244999725 - 993263800549376/3630511740111354373275*n - 92005258259070976/21264425906366504186325*n^2 - 330227400669396992/13531907394960502664025*n^3 + 516170577441955250176/8782207899329366228952225*n^4 + 64371065618968870912/76530668837013048566583675*n^5) * eps^24
+        + (109655883776/164581882229990225 - 12603581530112/1481236940069912025*n + 129935645605888/6915260457354960711*n^2 - 11155084482183168/5913944713353108571685*n^3 - 1162207852366183530496/178571560619697113322028575*n^4) * eps^25
+        - (455065206784/430714287538059525 + 180582436831232/384627858771487155825*n - 9176950320922624/22693043667517742193675*n^2 - 432325319462741868544/19841284513299679258003175*n^3) * eps^26
+        + (36775657472/55670554171585925 - 3120779071848448/482830716330164727525*n + 15460645461047640064/1384275663718582273814175*n^2) * eps^27
+        - (15502416019456/24924034576467086775 + 14832869272715264/25846223855796368985675*n) * eps^28
+        + 11005853696/17940058163291825 * eps^29;
+C4[15] = + (33554432/307452619485 - 4294967296/10760841681975*n + 8589934592/12843585233325*n^2 - 4294967296/5757469242525*n^3 + 17179869184/26228470993725*n^4 - 21474836480/45112970109207*n^5 + 8589934592/29421502245135*n^6 - 30064771072/197544372217335*n^7 + 34359738368/509456538876285*n^8 - 4294967296/169818846292095*n^9 + 42949672960/5400239312088621*n^10 - 4294967296/2077015120034085*n^11 + 17179869184/39463287280647615*n^12 - 55834574848/776111316519403095*n^13 + 8589934592/966179394034358955*n^14) * eps^15
+        - (67108864/3586947227325 - 17179869184/132717047411025*n + 34359738368/82158172206825*n^2 - 1941325217792/2281876976454075*n^3 + 4191888080896/3383472758190525*n^4 - 17179869184/12393673106925*n^5 + 13159779794944/10601547975663645*n^6 - 51539607552/56606282097365*n^7 + 137438953472/248196775349985*n^8 - 17179869184/61227203084905*n^9 + 34359738368/290335446886485*n^10 - 2353642078208/57002526072046555*n^11 + 68719476736/5835423432476715*n^12 - 127526168952832/47342790307683588795*n^13) * eps^16
+        - (25803358208/398151142233075 - 468151435264/1725321616343325*n + 2843268349952/5441398943852025*n^2 - 1749413194104832/3041742009613281975*n^3 + 2869038153728/12798353476633725*n^4 + 7477538062336/15389343835640775*n^5 - 12876311953408/10601547975663645*n^6 + 3191160700928/2005698265666095*n^7 - 256083130056704/171007578216139665*n^8 + 62521838927872/57002526072046555*n^9 - 2688649527296/4170916541857065*n^10 + 238675627606016/776111316519403095*n^11 - 73356546767060992/615456273999886654335*n^12) * eps^17
+        - (1073741824/272419202580525 - 68719476736/16324196831556075*n - 740383642353664/9125226028839845925*n^2 + 184786672943104/480275054149465575*n^3 - 366345454624964608/428885623355472758475*n^4 + 15312142525792256/13835020108241056725*n^5 - 137438953472/185992069748485*n^6 - 2361269940125696/11799522896913636885*n^7 + 13962148405313536/11799522896913636885*n^8 - 6665789243392/3976920423631155*n^9 + 47061983886835712/30268341344256720705*n^10 - 1994417129603989504/1846368821999659963005*n^11) * eps^18
+        - (164550934528/11169187305801525 - 481036337152/10598404214680425*n + 60335700574208/3041742009613281975*n^2 + 2078970329694208/20423124921689178975*n^3 - 8688615760592896/69818589848565332775*n^4 - 70574146693627904/272927214862573573575*n^5 + 10019162269155328/10369277697287741505*n^6 - 26920099097083904/19665871494856061475*n^7 + 17804941544390656/19665871494856061475*n^8 + 19171565778239488/77352427879767175135*n^9 - 43066633509404672/32392435473678244965*n^10) * eps^19
+        - (9126805504/9417157924499325 + 1099511627776/107355600339292305*n - 1923595592794112/25228566079733691675*n^2 + 18691697672192/106836033005526825*n^3 - 75660693642149888/600439872697661861865*n^4 - 4587735356639543296/31823313252976078678845*n^5 + 4633891755261952/18245220303277192225*n^6 + 5232575836585984/19817731506399351525*n^7 - 12071927388468936704/10442577763768568643225*n^8 + 35301152318329716736/23592490503328988416175*n^9) * eps^20
+        - (3298803318784/536778001696461525 - 23776938950656/1940658929210283975*n - 31061203484672/2293506007248517425*n^2 + 30755676691103744/1000733121162769769775*n^3 + 4781985526162915328/53038855421626797798075*n^4 - 14610072603059027968/53038855421626797798075*n^5 + 1187972560910811136/6918111576733930147575*n^6 + 105931591945715449856/447041781410854438583775*n^7 - 581521673484192710656/2052546673789621992207225*n^8) * eps^21
+        + (13958643712/646886309736761325 - 46935402610688/4307316159954532725*n + 484197433081856/10040800546783643175*n^2 - 112187225831112704/1828926049021613717175*n^3 - 3719479336609251328/159116566264880393394225*n^4 + 10694315528765308928/159116566264880393394225*n^5 + 64983725589372338176/447041781410854438583775*n^6 - 1741649722614854189056/4812273294010962485931225*n^7) * eps^22
+        - (1476797661184/478590684439392525 - 10072883720093696/3002199363488309309325*n - 714923076222976/71256859052790144825*n^2 - 31964572545974272/4079911955509753676775*n^3 + 14137901009686495232/159116566264880393394225*n^4 - 828273098770840813568/9387877409627943210259275*n^5 - 13142314124239393783808/190886840662434845275271925*n^6) * eps^23
+        + (34091302912/89625917648992725 - 206227149684736/22695274035783824475*n + 3494935147839488/121370378539191756975*n^2 - 221792729640730624/12239735866529261030325*n^3 - 1863430041644302336/72774243485487931862475*n^4 - 4307536620664800673792/190886840662434845275271925*n^5) * eps^24
+        - (22080561086464/12983807936750746095 - 8985071583232/14981316850097014725*n - 148111053849362432/31823313252976078678845*n^2 - 3775266271680004096/208619497991732071339095*n^3 + 31015178546408587264/570947678950453176296925*n^4) * eps^25
+        + (76235669504/153472907053791325 - 2934527815057408/411153917997106959675*n + 1924007909654528/111788392450826316225*n^2 - 76026719619927506944/21209648962492760586141325*n^3) * eps^26
+        - (262261440512/264716463890811075 + 410392715067392/1707197201241669978225*n - 2623596372082819072/2194101616809595922704275*n^2) * eps^27
+        + (4558570913792/8880977837591720575 - 152607815888797696/27628722052747842708825*n) * eps^28
+        - 54965112406016/91993525147884048975 * eps^29;
+C4[16] = + (1073741824/11455089532425 - 8589934592/24931665452925*n + 17179869184/29464695535275*n^2 - 8589934592/12989812010175*n^3 + 34359738368/57782267217675*n^4 - 8589934592/19260755739225*n^5 + 17179869184/60350367982905*n^6 - 8589934592/55102509897435*n^7 + 68719476736/936742668256395*n^8 - 8589934592/290335446886485*n^9 + 17179869184/1690777014221295*n^10 - 8589934592/2920433024564055*n^11 + 34359738368/48599000844668505*n^12 - 111669149696/808510650415848765*n^13) * eps^16
+        - (2147483648/141279437566575 - 34359738368/324111650888025*n + 4604204941312/13288577686409025*n^2 - 652835028992/911337863661225*n^3 + 137438953472/128898903793275*n^4 - 3332894621696/2715766559230725*n^5 + 68719476736/60350367982905*n^6 - 18794776887296/21545081369897085*n^7 + 27762668601344/49647361417588935*n^8 - 34359738368/113846357221905*n^9 + 74972949118976/546120975593478285*n^10 - 9036611190784/172305548449279245*n^11 + 643351741202432/38539007669822124465*n^12) * eps^17
+        - (304942678016/5509898065096425 - 68719476736/295301726364645*n + 86723979640832/190469613505196025*n^2 - 6665789243392/12697974233679735*n^3 + 57999238365184/221952194249856525*n^4 + 180938382245888/551300611523837175*n^5 - 35321811042304/35908468949828475*n^6 + 239212498518016/173013532212809925*n^7 - 91809220919296/66459166342063495*n^8 + 21784074125312/20226702799758455*n^9 - 2430333014245376/3580126395557246535*n^10 + 20911817807101952/59560284580634192355*n^11) * eps^18
+        - (2147483648/632789413638525 - 3058016714752/571408840515588075*n - 1168231104512/19703753121227175*n^2 + 2740292214063104/8952071834744213175*n^3 - 471827927269376/659626345717994655*n^4 + 287384886069690368/290535422273062191225*n^5 - 126580520233467904/165573950327659098225*n^6 + 73426760892416/8191814633902174275*n^7 + 7949743946727424/8971987456178571825*n^8 - 118514262413934592/82342907097816670305*n^9 + 2867242032764551168/1965489391160928347715*n^10) * eps^19
+        - (292057776128/22856353620623523 - 7765300871168/190469613505196025*n + 7284264534016/308692132232559075*n^2 + 68719476736/835916799082365*n^3 - 59394793498738688/456555663571954871925*n^4 - 20119482240335872/132848746027604123517*n^5 + 42939215642347175936/56460717061731752494725*n^6 - 948135883385602048/780562908687535748775*n^7 + 986509869987135488/1010572041655022771925*n^8 - 270217970507055104/5022917332966816888605*n^9) * eps^20
+        - (178241142784/190469613505196025 + 28621662060544/3836602214890377075*n - 238250425843712/3836602214890377075*n^2 + 373730874228736/2437749538523023725*n^3 - 22471975741209706496/169382151185195257484175*n^4 - 16232352634898481152/169382151185195257484175*n^5 + 70734537952329728/278131611141535726575*n^6 + 139064563512243126272/1427649559989502884509475*n^7 - 26056261464529829888/29571009561752012208855*n^8) * eps^21
+        - (313532612608/57755302159640085 - 44873818308608/3836602214890377075*n - 217016107532288/21740745884378803425*n^2 + 1808506343460438016/56460717061731752494725*n^3 + 209591930143637504/3456778595616229744575*n^4 - 40204026742784917504/169382151185195257484175*n^5 + 17961121261241237504/90031954233572253978075*n^6 + 121171809712218308608/784564172606843927523225*n^7) * eps^22
+        - (2147483648/26814079094227425 + 1452764097937408/168204718158088637025*n - 122625576908357632/2971616687459565920775*n^2 + 10274283326537728/174800981615268583575*n^3 + 270955536650862592/24197450169313608212025*n^4 - 714492347456237338624/9993546919926520191566325*n^5 - 17971202853986776383488/203202120705172577228515275*n^6) * eps^23
+        - (1206885810176/434637514620384075 - 31478708665581568/8914850062378697762325*n - 1921327850061824/217435367375090189325*n^2 - 2008361067347968/1026558492031486408995*n^3 + 43335953522509217792/587855701172148246562725*n^4 - 56042554411652231462912/609606362115517731685545825*n^5) * eps^24
+        + (229780750336/921431530995214239 - 309821760864256/41464418894784640755*n + 4327713982090575872/169382151185195257484175*n^2 - 2828328495191425024/144834013332268408573425*n^3 - 1522125277009729814528/67734040235057525742838425*n^4) * eps^25
+        - (98573794410496/63225886967224806825 - 47942074225393664/56460717061731752494725*n - 46815176099431972864/9993546919926520191566325*n^2 - 530028984910848458752/40640424141034515445703055*n^3) * eps^26
+        + (1007169830912/2724017805844152675 - 20291933767204864/3375058061440905164325*n + 5244397854327308288/333665222832795693314475*n^2) * eps^27
+        - (15753940041728/17017099469449942005 + 4223018003857408/88233660749097949295925*n) * eps^28
+        + 1187558457344/2967533069286582225 * eps^29;
+C4[17] = + (2147483648/26442675480375 - 34359738368/114584927081625*n + 68719476736/134228057438475*n^2 - 34359738368/58301075453075*n^3 + 137438953472/253891780198875*n^4 - 34359738368/82295956340325*n^5 + 206158430208/746759603828875*n^6 - 34359738368/217627084544415*n^7 + 274877906944/3510419494172955*n^8 - 309237645312/9193955818072025*n^9 + 68719476736/5516373490843215*n^10 - 34359738368/8702300426731275*n^11 + 412316860416/389282905755779035*n^12) * eps^17
+        - (4294967296/343754781244875 - 137438953472/1565994003448875*n + 19516331393024/67337742148301625*n^2 - 52639119179776/86577097047816375*n^3 + 549755813888/595684901368375*n^4 - 14156212207616/12993617106622425*n^5 + 357616156934144/342762658157453625*n^6 - 11407433138176/13731232715302375*n^7 + 825733232459776/1480226886709596025*n^8 - 20478404067328/64357690726504175*n^9 + 16767552323584/108488678653249895*n^10 - 192002218000384/3008095180840110725*n^11) * eps^18
+        - (672162381824/14093946031039875 - 446676598784/2219925565328625*n + 1168231104512/2927727919491375*n^2 - 504504038457344/1054957960323392125*n^3 + 56045268763672576/199387054501121111625*n^4 + 299170241970176/1433226184574654925*n^5 - 2212698431422464/2787440241206382125*n^6 + 277867204182016/232091323700110875*n^7 - 4011293296033792/3171914757234848625*n^8 + 91101719546560512/87333386315866165475*n^9 - 97236616472428544/138973997354813115495*n^10) * eps^19
+        - (8589934592/2927727919491375 - 274877906944/46618436871901125*n - 246840360435712/5696772985746317475*n^2 + 5429663295864832/22154117166791234625*n^3 - 2036694657362034688/3389579926519058897625*n^4 + 1858884660575076352/2113502777711883783225*n^5 - 15175708525948043264/19960859567278902397125*n^6 + 132330897327259648/827869751638295491125*n^7 + 7537479862869557248/11790007152641932339125*n^8 - 6483944038931103744/5327336565267836093975*n^9) * eps^20
+        - (6762426007552/606039679334714625 - 1044982722985984/28483864928731587375*n + 9552007266304/369920323749760875*n^2 + 222305823613779968/3389579926519058897625*n^3 - 34475324527869952/269336935690419972375*n^4 - 470625336426496/6264960282668182095*n^5 + 3519193123127296/5942893780988789625*n^6 - 43409782051822370816/40923615560714660899125*n^7 + 557434867142939901952/563689801433069683997625*n^8) * eps^21
+        - (442381631488/499716928574238375 + 8108898254848/1499150785722715125*n - 184992831373312/3640794765326593875*n^2 + 14573614309310464/108679816155783497625*n^3 - 34212953565691904/255544432582517953875*n^4 - 399858431600623616/7185909444220404862965*n^5 + 528521220698669056/2220661309496144389875*n^6 - 1001307509790605312/60886354858624251581625*n^7) * eps^22
+        - (2407329169408/499716928574238375 - 282471409123328/25485563357286157125*n - 34565896798208/4911763119767877555*n^2 + 119606249259008/3783571030633519125*n^3 + 14237438629117952/373488016851372394125*n^4 - 322117427598983168/1599881725316995799679*n^5 + 501588313596791619584/2368323085141871529469875*n^6) * eps^23
+        - (17179869184/118537503987377475 + 59923383713792/8714418438297847275*n - 975266813837312/27566017508901353625*n^2 + 46008514308472832/827869751638295491125*n^3 + 98201781523185664/89069045632143673721625*n^4 - 170579883200610304/2434995583254800593335*n^5) * eps^24
+        - (6444598427648/2572828300830793005 - 139397458558976/38592424512461895075*n - 196192800411222016/25663962300787160224875*n^2 + 367602162055774208/168241530638493605918625*n^3 + 18650877066060234752/308911706757635416887375*n^4) * eps^25
+        + (4294967296/27767187952228725 - 1173316345790464/190103424450275260925*n + 11436993233410850816/504724591915480817755875*n^2 - 5081081138781356032/250310569974344145391125*n^3) * eps^26
+        - (5310727061504/3714569735242026375 - 11122006791553024/10738821104584698250125*n - 22042390638362624/4867699621635467175195*n^2) * eps^27
+        + (1176821039104/4297247340770187375 - 175646982537216/34544538700609955875*n) * eps^28
+        - 602006238527488/697370271282346822875 * eps^29;
+C4[18] = + (8589934592/121132637200575 - 68719476736/261391480274925*n + 137438953472/303779287887075*n^2 - 68719476736/130191123380175*n^3 + 274877906944/556271163533475*n^4 - 68719476736/175853464600905*n^5 + 137438953472/515432568657825*n^6 - 68719476736/433617875220075*n^7 + 549755813888/6677715278389155*n^8 - 68719476736/1838791163614405*n^9 + 137438953472/9299029598849991*n^10 - 68719476736/13570354199278695*n^11) * eps^18
+        - (17179869184/1655479375074525 - 274877906944/3746611217273925*n + 549755813888/2247966730364355*n^2 - 824633720832/1586402947854725*n^3 + 80264348827648/99943385714847675*n^4 - 29961691856896/30891591948225645*n^5 + 1649267441664/1725969189601475*n^6 - 274877906944/349009509323475*n^7 + 2199023255552/3989829883314275*n^8 - 22265110462464/67438908352020205*n^9 + 224850127880192/1323561879569648719*n^10) * eps^19
+        - (1769526525952/42711367876922745 - 137438953472/784174440824775*n + 557177517375488/1584816544906870275*n^2 - 9758165696512/22411547099693115*n^3 + 210556476719104/728158953065318775*n^4 + 6389949263773696/54029394317446653105*n^5 - 1126174784749568/1765666480962308925*n^6 + 24452176529063936/23653421475379871175*n^7 - 35240447181848576/30623395201667356725*n^8 + 6613974757933056/6617809397848243595*n^9) * eps^20
+        - (17179869184/6743900191093065 - 274877906944/45280472711624865*n - 549755813888/17415566427548025*n^2 + 37220942501380096/188593168843917562725*n^3 - 5061923935373754368/9995437948727630824425*n^4 + 210619973515608064/270146971587233265525*n^5 - 540556749854212096/733256065736776006425*n^6 + 62215590579798016/233849231775512347995*n^7 + 37208280525474627584/85128663889892156358825*n^8) * eps^21
+        - (575525617664/58696909070624825 - 7490422964224/226402363558124325*n + 20753281974272/769768036097622705*n^2 + 15646943816450048/302892059052352449225*n^3 - 173465276589801472/1427919706961090117775*n^4 - 312763435504893952/14608717001986537358775*n^5 + 95646928817094656/209864695183152107175*n^6 - 266525260705169408/291246946317918204075*n^7) * eps^22
+        - (3058016714752/3697905271449363975 + 549755813888/141480246694611825*n - 11279889789353984/270146971587233265525*n^2 + 390507497523249152/3331812649575876941475*n^3 - 1085215777591656448/8257100914166303724525*n^4 - 259937076091977465856/11204885940523674154180425*n^5 + 3732761141304157536256/17525590830049849318077075*n^6) * eps^23
+        - (809755954118656/188593168843917562725 - 104456628295696384/9995437948727630824425*n - 9252940103548928/1999087589745526164885*n^2 + 520739427153084416/17264847365984089605825*n^3 + 236963197894260686848/11204885940523674154180425*n^4 - 2173497279199697698816/12896189478715926856698225*n^5) * eps^24
+        - (8211977469952/44424168661011692553 + 549755813888/100049426442396585*n - 5772652649614671872/189913321025824985664075*n^2 + 64786503302480134144/1244987326724852683797825*n^3 - 281804537728895811584/40205767198349654317941525*n^4) * eps^25
+        - (481783661461504/212668892526119804775 - 20856155030945792/5754949121994696535275*n - 324453099534024704/49799493068994107351913*n^2 + 20093572867302621184/3997064575274527037456175*n^3) * eps^26
+        + (7095285972992/82463448122372985525 - 496704377847808/97029641238005820575*n + 218039311403828903936/10849175275745144815952475*n^2) * eps^27
+        - (410444254674944/312819619211135826075 - 102777261723222016/87729180127319230317675*n) * eps^28
+        + 601295421440/2991617395646009559 * eps^29;
+C4[19] = + (17179869184/275520749478975 - 549755813888/2369478445519185*n + 1099511627776/2734013590983675*n^2 - 549755813888/1157645394380475*n^3 + 2199023255552/4862110656397995*n^4 - 549755813888/1502834202886653*n^5 + 1099511627776/4282269502849065*n^6 - 549755813888/3480662403793575*n^7 + 4398046511104/51436455522727275*n^8 - 549755813888/13487781670404041*n^9 + 5497558138880/321947484219644283*n^10) * eps^19
+        - (34359738368/3949130742531975 - 2199023255552/35542176682787775*n + 347445674377216/1670482304091025425*n^2 - 134140418588672/299830157144543025*n^3 + 8796093022208/12523618357388775*n^4 - 10995116277760/12697860004100271*n^5 + 6390361580634112/7301269502357655825*n^6 - 129742372077568/174349544044569075*n^7 + 14759844091265024/27312757882568183025*n^8 - 6955510557310976/20568867047366162525*n^9) * eps^20
+        - (17179869184/473895689103837 - 256735965085696/1670482304091025425*n + 1099511627776/3531675061503225*n^2 - 26276678636404736/66262464728944008525*n^3 + 234554417506942976/810440914761699796575*n^4 + 1092364802195456/21903808507072967475*n^5 - 70701896200880128/138724120544795460675*n^6 + 3123725178895335424/3507738476632685219925*n^7 - 50355798566745669632/48316268694263115771225*n^8) * eps^21
+        - (137438953472/61869714966334275 - 70368744177664/11693376128637177975*n - 35184372088832/1540987551835907175*n^2 + 4714705859903488/29511854038941449175*n^3 - 121949033659891712/284749510591948577175*n^4 + 10624202627199533056/15398377380472296134925*n^5 - 5751835595965988864/8184723112142932179825*n^6 + 455215406085308416/1345736145123231436575*n^7) * eps^22
+        - (33775622815744/3897792042879059325 - 5945059371384832/198787394186832025575*n + 6597069766656/241318671795096025*n^2 + 140795762471600128/3511910630634032451825*n^3 - 609362538252992512/5410240701247022966325*n^4 + 4538644361482600448/288062328068835393548475*n^5 + 155909009391241658368/450559025953819461704025*n^6) * eps^23
+        - (50783693307904/66262464728944008525 + 998356558020608/363301099720761977775*n - 362953186375368704/10535731891902097355475*n^2 + 6835782537139191808/66726301982046616584675*n^3 - 8847585350760005632/69884943495989651689275*n^4 + 1707339911901640392704/720443882500157319264735975*n^5) * eps^24
+        - (8097250303541248/2107146378380419471095 - 103462944662093824/10535731891902097355475*n - 535446769564123136/200178905946139849754025*n^2 + 12306584060557262848/437427979660083375388425*n^3 + 557162471658373513216/65494898409105210842248725*n^4) * eps^25
+        - (15530601742336/74721502779447498975 + 881509258313596928/200178905946139849754025*n - 14719628353967489024/562407402420107196927975*n^2 + 203822997141859598336/4213122119883960931372725*n^3) * eps^26
+        - (8392074038607872/4085283794819180607225 - 14119724364492439552/3936851816940750378495825*n - 438401893076171751424/80049320277795257696081775*n^2) * eps^27
+        + (240518168576/6628488955650844425 - 2724235770884784128/639258103371923087191425*n) * eps^28
+        - 1197385342517248/993297829878681822495 * eps^29;
+C4[20] = + (137438953472/2490990160674015 - 1099511627776/5337836058587175*n + 2199023255552/6118982798868225*n^2 - 1099511627776/2562650915765325*n^3 + 4398046511104/10596907840867425*n^4 - 1099511627776/3209349231805563*n^5 + 2199023255552/8914858977237675*n^6 - 1099511627776/7025073203261025*n^7 + 8796093022208/100046732170579425*n^8 - 9895604649984/226031506015012775*n^9) * eps^20
+        - (274877906944/37364852410110225 - 4398046511104/83626098251199075*n + 730075720843264/4097678814308754675*n^2 - 1974722883485696/5097112671457231425*n^3 + 474989023199232/769649491701519275*n^4 - 4398046511104/5673092076423975*n^5 + 1222656930086912/1524440885107642425*n^6 - 3003865767084032/4282952962921471575*n^7 + 31067800554438656/58994223069918334275*n^8) * eps^21
+        - (18691697672192/585382687758393525 - 1666859627708416/12293036442926264025*n + 57887088179150848/208981619529746488425*n^2 - 1334644388399153152/3692008611692187962175*n^3 + 4521191813414912/15890998328660780325*n^4 - 655308930154496/394830189242879388075*n^5 - 7714173580476416/19078608653013827925*n^6 + 600012291370385408/783780392214629298225*n^7) * eps^22
+        - (274877906944/141299269458922575 - 1218258883575808/208981619529746488425*n - 180610178024996864/11076025835076563886525*n^2 + 479664146640535552/3692008611692187962175*n^3 - 2637051095871913984/7256706581601886684275*n^4 + 184775141265151885312/302834755149288490653525*n^5 - 11443717021892608/17286398928081978975*n^6) * eps^23
+        - (536286796447744/69660539843248829475 - 300168873406103552/11076025835076563886525*n + 43017292925108224/1582289405010937698075*n^2 + 6426889555932086272/210444490866454713843975*n^3 - 425316984525521158144/4138741653706942705598175*n^4 + 30568622275428352/748214369811373640175*n^5) * eps^24
+        - (237219633692672/335637146517471632925 + 1614083069575168/852001987313581837425*n - 857627865758302208/30063498695207816263425*n^2 + 370804592201131098112/4138741653706942705598175*n^3 - 3142647162680895340544/26116886987185190176705725*n^4) * eps^25
+        - (38242113925677056/11076025835076563886525 - 215297570858074112/23382721207383857093775*n - 4560536737503248384/4138741653706942705598175*n^2 + 6519761472431813820416/252463240876123505041488675*n^3) * eps^26
+        - (40956808134656/186729805560296995425 + 146855171052273664/41525835990370662597975*n - 743768959490749104128/32929987940363935440194175*n^2) * eps^27
+        - (8472149408874496/4536435864494274065325 - 1836887006316068864/522698221275618022860225*n) * eps^28
+        + 549755813888/1740393633548117723175 * eps^29;
+C4[21] = + (274877906944/5598218305347525 - 4398046511104/23919660031939425*n + 8796093022208/27257287013140275*n^2 - 4398046511104/11301801932277675*n^3 + 17592186044416/46076577108516675*n^4 - 4398046511104/13698441843072525*n^5 + 8796093022208/37181485002625425*n^6 - 4398046511104/28489709287725975*n^7 + 35184372088832/392422769866419075*n^8) * eps^21
+        - (549755813888/87705420117111225 - 17592186044416/390687780521677275*n + 35184372088832/229023871340293575*n^2 - 2761973208973312/8186271866279795925*n^3 + 70368744177664/129195108363095775*n^4 - 2234207627640832/3210001538559995025*n^5 + 3764727813505024/5118651102028100175*n^6 - 4204532464615424/6372198310688043075*n^7) * eps^22
+        - (364762982514688/12892696757215350075 - 479387069710336/3985015361321108205*n + 261411088526999552/1056029070750093674325*n^2 - 1277645705615245312/3872106592750343472525*n^3 + 228698418577408/827736245792199975*n^4 - 3003865767084032/74608217578045944975*n^5 - 333714973169549312/1050254139752492917725*n^6) * eps^23
+        - (1099511627776/642744413116307775 - 5875790138834944/1056029070750093674325*n - 18929192183791616/1659474254035861488225*n^2 + 4683145478139805696/44142015157353915586785*n^3 - 4028567116287362203648/13021894471419405098101575*n^4 + 109531870615417389056/202999121583588988240275*n^5) * eps^24
+        - (1451630226571264/211205814150018734865 - 285991770477559808/11616319778251030417575*n + 841091210876551168/31530010826681368276275*n^2 + 8952412789352169472/394602862770285002972775*n^3 - 629287817602805006336/6789192844073365051146975*n^4) * eps^25
+        - (109401406963712/168352460554362759675 + 12015463068336128/9596090251598677301475*n - 13419213961564258304/566169324844321960787025*n^2 + 180572689076536213504/2302421921033575973867235*n^3) * eps^26
+        - (29879503362719744/9596090251598677301475 - 36156340367785984/4193846850698681191015*n + 1788694312159019008/11512109605167879869336175*n^2) * eps^27
+        - (2476100185751552/11101359310672979623275 + 14029979476654292992/4933761259357662801144075*n) * eps^28
+        - 1109241755926003712/651628845575540369962425 * eps^29;
+C4[22] = + (1099511627776/25032202359006375 - 8796093022208/53329474590926625*n + 17592186044416/60440071203050175*n^2 - 8796093022208/24831967238462475*n^3 + 35184372088832/99933526691373375*n^4 - 8796093022208/29211338571324525*n^5 + 17592186044416/77633737644511125*n^6 - 8796093022208/57987648934471575*n^7) * eps^22
+        - (2199023255552/408859305197104125 - 35184372088832/906601068045752625*n + 70368744177664/528020402268405375*n^2 - 35184372088832/119122926001954875*n^3 + 12525636463624192/25949405764193286375*n^4 - 35184372088832/56153124521819325*n^5 + 118289858962653184/175219345863661609125*n^6) * eps^23
+        - (525566558076928/20851824565052310375 - 5154510511013888/48049856606424889125*n + 2498090418307072/11245711120652633625*n^2 - 1009738702391345152/3347473343580933942375*n^3 + 52541456158950424576/197500927271275102600125*n^4 - 3862311669493399552/56035146807198982598175*n^5) * eps^24
+        - (24189255811072/16016618868808296375 - 2779565395017728/528548422670673780375*n - 25825329113202688/3347473343580933942375*n^2 + 1561165773953564672/17954629751934100236375*n^3 - 9549604208874704863232/36142669690643343775822875*n^4) * eps^25
+        - (3257852953100288/528548422670673780375 - 202310139510784/9022839201026776125*n + 15361127418077118464/592502781813825307800375*n^2 + 27973484562807259136/1721079509078254465515375*n^3) * eps^26
+        - (1996713116041216/3347473343580933942375 + 8584986789675008/11179297770072175618875*n - 713879932158309564416/36142669690643343775822875*n^2) * eps^27
+        - (1669577620452278272/592502781813825307800375 - 97178602390656385024/12047556563547781258607625*n) * eps^28
+        - 2014305302085632/9092495519658702836685 * eps^29;
+C4[23] = + (2199023255552/55699673461634475 - 140737488355328/946894448847786075*n + 281474976710656/1067774591253886425*n^2 - 140737488355328/435019277918250025*n^3 + 562949953421312/1729960384279552425*n^4 - 140737488355328/497891037426798015*n^5 + 281474976710656/1297921080471567475*n^6) * eps^23
+        - (4398046511104/946894448847786075 - 562949953421312/16728468596310887325*n + 21392098230009856/184013154559419760575*n^2 - 57983845202395136/223164889572062262825*n^3 + 6755399441055744/15730858404721234775*n^4 - 78250043525562368/138358387178269092835*n^5) * eps^24
+        - (226499395321856/10037081157786532395 - 140737488355328/1464295659624029925*n + 2098958901331361792/10488749809886926352775*n^2 - 56978557323073028096/206278746261109551604575*n^3 + 22721223070037573632/89241159729983564878575*n^4) * eps^25
+        - (35184372088832/26287593508488537225 - 51791395714760704/10488749809886926352775*n - 3048936947729825792/618836238783328654813725*n^2 + 21939285584735371264/306902524925065430436075*n^3) * eps^26
+        - (58221339713994752/10488749809886926352775 - 324822123124097024/15867595866239196277275*n + 314868042047701385216/12583003521927682647879075*n^2) * eps^27
+        - (22570774694985728/41255749252221910320915 + 434597364041252864/1078543159022372798389635*n) * eps^28
+        - 19316123519745523712/7549802113156609588727445 * eps^29;
+C4[24] = + (35184372088832/987187829649819525 - 281474976710656/2092838198857617393*n + 562949953421312/2349104100758550135*n^2 - 281474976710656/949637827966222395*n^3 + 1125899906842624/3735242123333808087*n^4 - 1407374883553280/5298831849380518449*n^5) * eps^24
+        - (70368744177664/17440318323813478275 - 1125899906842624/38368700312389652205*n + 2251799813685248/22091069876830405815*n^2 - 201536083324829696/877781898983444900445*n^3 + 436849163854938112/1139248847616811466535*n^4) * eps^25
+        - (11681211533492224/575530504685844783075 - 9007199254740992/104143615133629055985*n + 864691128455135232/4779034783354311124645*n^2 - 21446141425538301952/84635164389081187336455*n^3) * eps^26
+        - (70368744177664/59108538319086761505 - 595601050719748096/129033939150566400365415*n - 22195990763495489536/7871070288184550422290315*n^2) * eps^27
+        - (15058911254020096/3000789282571311636405 - 49153412233028435968/2623690096061516807430105*n) * eps^28
+        - 101260622871658496/201822315081655139033085 * eps^29;
+C4[25] = + (70368744177664/2178260166157928307 - 1125899906842624/9215716087591235145*n + 2251799813685248/10299917980249027515*n^2 - 1125899906842624/4133980685950289955*n^3 + 4503599627370496/16096137564444745995*n^4) * eps^25
+        - (140737488355328/39934769712895352295 - 4503599627370496/175098605664233467755*n + 927741523238322176/10330817734189774597545*n^2 - 58546795155816448/287359727216405038965*n^3) * eps^26
+        - (41728665297354752/2276281873635035080815 - 269090077735387136/3443605911396591532515*n + 34481810546962202624/210059960595192083483415*n^2) * eps^27
+        - (3659174697238528/3443605911396591532515 - 9007199254740992/2093620869719522426745*n) * eps^28
+        - 260856934666600448/57289080162325113677295 * eps^29;
+C4[26] = + (281474976710656/9577116718477165935 - 2251799813685248/20218357516785128085*n + 4503599627370496/22507228179062689755*n^2 - 6755399441055744/26920410174957334805*n^3) * eps^26
+        - (562949953421312/181965217651066152765 - 9007199254740992/397627697830107519005*n + 1927540640514572288/24255289567636558659305*n^2) * eps^27
+        - (178455135234555904/10735947841412903013135 - 1031324314667843584/14553173740581935195583*n) * eps^28
+        - 562949953421312/591592428478940455105 * eps^29;
+C4[27] = + (562949953421312/20981314404210981975 - 18014398509481984/176842507121206848075*n + 36028797018963968/196134416988974867865*n^2) * eps^27
+        - (1125899906842624/412632516616149312175 - 72057594037927936/3595797644797872577525*n) * eps^28
+        - 1142225455491842048/75511750540755324128025 * eps^29;
+C4[28] = + (4503599627370496/183273143743796188005 - 36028797018963968/385505578219709223045*n) * eps^28
+        - 9007199254740992/3726553922790522489435 * eps^29;
+C4[29] = + 9007199254740992/399032089736190248415 * eps^29;
+    
+ + diff --git a/gtsam/3rdparty/GeographicLib/doc/index.html.in b/gtsam/3rdparty/GeographicLib/doc/index.html.in new file mode 100644 index 000000000..828a35895 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/index.html.in @@ -0,0 +1,24 @@ + + + GeographicLib-@PROJECT_VERSION@ documentation + + + +

+
+ + Online documentation for GeographicLib version + @PROJECT_VERSION@ is available at +
+ + http://geographiclib.sourceforge.net/@PROJECT_VERSION@/index.html. +
+
+ You will be redirected there. Click on the link to go there + directly. +
+
+

+ + diff --git a/gtsam/3rdparty/GeographicLib/doc/meridian-measures.png b/gtsam/3rdparty/GeographicLib/doc/meridian-measures.png new file mode 100644 index 000000000..f18deae35 Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/meridian-measures.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/DMS.js b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/DMS.js new file mode 100644 index 000000000..e2f339f01 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/DMS.js @@ -0,0 +1,364 @@ +/** + * DMS.js + * Transcription of DMS.[ch]pp into JavaScript. + * + * See the documentation for the C++ class. The conversion is a literal + * conversion from C++. + * + * Copyright (c) Charles Karney (2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +GeographicLib.DMS = {}; + +(function() { + var d = GeographicLib.DMS; + var m = GeographicLib.Math; + d.lookup = function(s, c) { + return s.indexOf(c.toUpperCase()); + } + d.zerofill = function(s, n) { + return String("0000").substr(0, Math.max(0, Math.min(4, n-s.length))) + + s; + } + d.hemispheres_ = "SNWE"; + d.signs_ = "-+"; + d.digits_ = "0123456789"; + d.dmsindicators_ = "D'\":"; + // d.dmsindicatorsu_ = "\u00b0\u2032\u2033"; // Unicode variants + d.dmsindicatorsu_ = "\u00b0'\""; // Use degree symbol + d.components_ = ["degrees", "minutes", "seconds"]; + d.NONE = 0; + d.LATITUDE = 1; + d.LONGITUDE = 2; + d.AZIMUTH = 3; + d.NUMBER = 4; + d.DEGREE = 0; + d.MINUTE = 1; + d.SECOND = 2; + + // return val, ind + d.Decode = function(dms) { + var vals = {}; + var errormsg = new String(""); + var dmsa = dms; + dmsa = dmsa.replace(/\u00b0/g, 'd'); + dmsa = dmsa.replace(/\u00ba/g, 'd'); + dmsa = dmsa.replace(/\u2070/g, 'd'); + dmsa = dmsa.replace(/\u02da/g, 'd'); + dmsa = dmsa.replace(/\u2032/g, '\''); + dmsa = dmsa.replace(/\u00b4/g, '\''); + dmsa = dmsa.replace(/\u2019/g, '\''); + dmsa = dmsa.replace(/\u2033/g, '"'); + dmsa = dmsa.replace(/\u201d/g, '"'); + dmsa = dmsa.replace(/''/g, '"'); + dmsa = dmsa.replace(/^\s+/, ""); + dmsa = dmsa.replace(/\s+$/, ""); + do { // Executed once (provides the ability to break) + var sign = 1; + var beg = 0, end = dmsa.length; + var ind1 = d.NONE; + var k = -1; + if (end > beg && (k = d.lookup(d.hemispheres_, dmsa.charAt(beg))) >= 0) { + ind1 = (k & 2) ? d.LONGITUDE : d.LATITUDE; + sign = (k & 1) ? 1 : -1; + ++beg; + } + if (end > beg && + (k = d.lookup(d.hemispheres_, dmsa.charAt(end-1))) >= 0) { + if (k >= 0) { + if (ind1 != d.NONE) { + if (dmsa.charAt(beg - 1).toUpperCase() == + dmsa.charAt(end - 1).toUpperCase()) + errormsg = "Repeated hemisphere indicators " + + dmsa.charAt(beg - 1) + " in " + + dmsa.substr(beg - 1, end - beg + 1); + else + errormsg = "Contradictory hemisphere indicators " + + dmsa.charAt(beg - 1) + " and " + dmsa.charAt(end - 1) + " in " + + dmsa.substr(beg - 1, end - beg + 1); + break; + } + ind1 = (k & 2) ? d.LONGITUDE : d.LATITUDE; + sign = (k & 1) ? 1 : -1; + --end; + } + } + if (end > beg && (k = d.lookup(d.signs_, dmsa.charAt(beg))) >= 0) { + if (k >= 0) { + sign *= k ? 1 : -1; + ++beg; + } + } + if (end == beg) { + errormsg = "Empty or incomplete DMS string " + dmsa; + break; + } + var ipieces = [0, 0, 0]; + var fpieces = [0, 0, 0]; + var npiece = 0; + var icurrent = 0; + var fcurrent = 0; + var ncurrent = 0, p = beg; + var pointseen = false; + var digcount = 0; + var intcount = 0; + while (p < end) { + var x = dmsa.charAt(p++); + if ((k = d.lookup(d.digits_, x)) >= 0) { + ++ncurrent; + if (digcount > 0) + ++digcount; // Count of decimal digits + else { + icurrent = 10 * icurrent + k; + ++intcount; + } + } else if (x == '.') { + if (pointseen) { + errormsg = "Multiple decimal points in " + + dmsa.substr(beg, end - beg); + break; + } + pointseen = true; + digcount = 1; + } else if ((k = d.lookup(d.dmsindicators_, x)) >= 0) { + if (k >= 3) { + if (p == end) { + errormsg = "Illegal for : to appear at the end of " + + dmsa.substr(beg, end - beg); + break; + } + k = npiece; + } + if (k == npiece - 1) { + errormsg = "Repeated " + d.components_[k] + + " component in " + dmsa.substr(beg, end - beg); + break; + } else if (k < npiece) { + errormsg = d.components_[k] + " component follows " + + d.components_[npiece - 1] + " component in " + + dmsa.substr(beg, end - beg); + break; + } + if (ncurrent == 0) { + errormsg = "Missing numbers in " + d.components_[k] + + " component of " + dmsa.substr(beg, end - beg); + break; + } + if (digcount > 1) { + fcurrent = parseFloat(dmsa.substr(p - intcount - digcount - 1, + intcount + digcount)); + icurrent = 0; + } + ipieces[k] = icurrent; + fpieces[k] = icurrent + fcurrent; + if (p < end) { + npiece = k + 1; + icurrent = fcurrent = 0; + ncurrent = digcount = intcount = 0; + } + } else if (d.lookup(d.signs_, x) >= 0) { + errormsg = "Internal sign in DMS string " + + dmsa.substr(beg, end - beg); + break; + } else { + errormsg = "Illegal character " + x + " in DMS string " + + dmsa.substr(beg, end - beg); + break; + } + } + if (errormsg.length) + break; + if (d.lookup(d.dmsindicators_, dmsa.charAt(p - 1)) < 0) { + if (npiece >= 3) { + errormsg = "Extra text following seconds in DMS string " + + dmsa.substr(beg, end - beg); + break; + } + if (ncurrent == 0) { + errormsg = "Missing numbers in trailing component of " + + dmsa.substr(beg, end - beg); + break; + } + if (digcount > 1) { + fcurrent = parseFloat(dmsa.substr(p - intcount - digcount, + intcount + digcount)); + icurrent = 0; + } + ipieces[npiece] = icurrent; + fpieces[npiece] = icurrent + fcurrent; + } + if (pointseen && digcount == 0) { + errormsg = "Decimal point in non-terminal component of " + + dmsa.substr(beg, end - beg); + break; + } + // Note that we accept 59.999999... even though it rounds to 60. + if (ipieces[1] >= 60) { + errormsg = "Minutes " + fpieces[1] + " not in range [0, 60)"; + break; + } + if (ipieces[2] >= 60) { + errormsg = "Seconds " + fpieces[2] + " not in range [0, 60)"; + break; + } + vals.ind = ind1; + // Assume check on range of result is made by calling routine (which + // might be able to offer a better diagnostic). + vals.val = sign * (fpieces[0] + (fpieces[1] + fpieces[2] / 60) / 60); + return vals; + } while (false); + vals.val = d.NumMatch(dmsa); + if (vals.val == 0) + throw new Error(errormsg); + else + vals.ind = d.NONE; + return vals; + } + + d.NumMatch = function(s) { + if (s.length < 3) + return 0; + var t = s.toUpperCase().replace(/0+$/,""); + var sign = t.charAt(0) == '-' ? -1 : 1; + var p0 = t.charAt(0) == '-' || t.charAt(0) == '+' ? 1 : 0; + var p1 = t.length - 1; + if (p1 + 1 < p0 + 3) + return 0; + // Strip off sign and trailing 0s + t = t.substr(p0, p1 + 1 - p0); // Length at least 3 + if (t == "NAN" || t == "1.#QNAN" || t == "1.#SNAN" || t == "1.#IND" || + t == "1.#R") + return sign * Number.NaN; + else if (t == "INF" || t == "1.#INF") + return sign * Number.POSITIVE_INFINITY; + return 0; + } + + // return lat, lon + d.DecodeLatLon = function(stra, strb, swaplatlong) { + var vals = {}; + if (!swaplatlong) swaplatlong = false; + var valsa = d.Decode(stra); + var valsb = d.Decode(strb); + var a = valsa.val, ia = valsa.ind; + var b = valsb.val, ib = valsb.ind; + if (ia == d.NONE && ib == d.NONE) { + // Default to lat, long unless swaplatlong + ia = swaplatlong ? d.LONGITUDE : d.LATITUDE; + ib = swaplatlong ? d.LATITUDE : d.LONGITUDE; + } else if (ia == d.NONE) + ia = d.LATITUDE + d.LONGITUDE - ib; + else if (ib == d.NONE) + ib = d.LATITUDE + d.LONGITUDE - ia; + if (ia == ib) + throw new Error("Both " + stra + " and " + + strb + " interpreted as " + + (ia == d.LATITUDE ? "latitudes" : "longitudes")); + var lat = ia == d.LATITUDE ? a : b, lon = ia == d.LATITUDE ? b : a; + if (Math.abs(lat) > 90) + throw new Error("Latitude " + lat + "d not in [-90d, 90d]"); + if (lon < -540 || lon >= 540) + throw new Error("Latitude " + lon + "d not in [-540d, 540d)"); + lon = m.AngNormalize(lon); + vals.lat = lat; + vals.lon = lon; + return vals; + } + + d.DecodeAngle = function(angstr) { + var vals = d.Decode(angstr); + var ang = vals.val, ind = vals.ind; + if (ind != d.NONE) + throw new Error("Arc angle " + angstr + + " includes a hemisphere, N/E/W/S"); + return ang; + } + + d.DecodeAzimuth = function(azistr) { + var vals = d.Decode(azistr); + var azi = vals.val, ind = vals.ind; + if (ind == d.LATITUDE) + throw new Error("Azimuth " + azistr + + " has a latitude hemisphere, N/S"); + if (azi < -540 || azi >= 540) + throw new Error("Azimuth " + azistr + " not in range [-540d, 540d)"); + azi = m.AngNormalize(azi); + return azi; + } + + d.Encode = function(angle, trailing, prec, ind) { + // Assume check on range of input angle has been made by calling + // routine (which might be able to offer a better diagnostic). + if (!ind) ind = d.NONE; + if (!isFinite(angle)) + return angle < 0 ? String("-inf") : + (angle > 0 ? String("inf") : String("nan")); + + // 15 - 2 * trailing = ceiling(log10(2^53/90/60^trailing)). + // This suffices to give full real precision for numbers in [-90,90] + prec = Math.min(15 - 2 * trailing, prec); + var scale = 1, i; + for (i = 0; i < trailing; ++i) + scale *= 60; + for (i = 0; i < prec; ++i) + scale *= 10; + if (ind == d.AZIMUTH) + angle -= Math.floor(angle/360) * 360; + var sign = angle < 0 ? -1 : 1; + angle *= sign; + + // Break off integer part to preserve precision in manipulation of + // fractional part. + var + idegree = Math.floor(angle), + fdegree = Math.floor((angle - idegree) * scale + 0.5) / scale; + if (fdegree >= 1) { + idegree += 1; + fdegree -= 1; + } + var pieces = [fdegree, 0, 0]; + for (i = 1; i <= trailing; ++i) { + var + ip = Math.floor(pieces[i - 1]), + fp = pieces[i - 1] - ip; + pieces[i] = fp * 60; + pieces[i - 1] = ip; + } + pieces[0] += idegree; + var s = new String(""); + if (ind == d.NONE && sign < 0) + s += '-'; + switch (trailing) { + case d.DEGREE: + s += d.zerofill(pieces[0].toFixed(prec), + ind == d.NONE ? 0 : + 1 + Math.min(ind, 2) + prec + (prec ? 1 : 0)) + + d.dmsindicatorsu_.charAt(0); + break; + default: + s += d.zerofill(pieces[0].toFixed(0), + ind == d.NONE ? 0 : 1 + Math.min(ind, 2)) + + d.dmsindicatorsu_.charAt(0); + switch (trailing) { + case d.MINUTE: + s += d.zerofill(pieces[1].toFixed(prec), 2 + prec + (prec ? 1 : 0)) + + d.dmsindicatorsu_.charAt(1); + break; + case d.SECOND: + s += d.zerofill(pieces[1].toFixed(0), 2) + d.dmsindicatorsu_.charAt(1); + s += d.zerofill(pieces[2].toFixed(prec), 2 + prec + (prec ? 1 : 0)) + + d.dmsindicatorsu_.charAt(2); + break; + default: + break; + } + } + if (ind != d.NONE && ind != d.AZIMUTH) + s += d.hemispheres_.charAt((ind == d.LATITUDE ? 0 : 2) + + (sign < 0 ? 0 : 1)); + return s; + } + +})(); diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Geodesic.js b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Geodesic.js new file mode 100644 index 000000000..09d22593a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Geodesic.js @@ -0,0 +1,1019 @@ +/** + * Geodesic.js + * Transcription of Geodesic.[ch]pp into JavaScript. + * + * See the documentation for the C++ class. The conversion is a literal + * conversion from C++. + * + * The algorithms are derived in + * + * Charles F. F. Karney, + * Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); + * http://dx.doi.org/10.1007/s00190-012-0578-z + * Addenda: http://geographiclib.sf.net/geod-addenda.html + * + * Copyright (c) Charles Karney (2011-2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +// Load AFTER Math.js + +GeographicLib.Geodesic = {}; +GeographicLib.GeodesicLine = {}; + +(function() { + var m = GeographicLib.Math; + var g = GeographicLib.Geodesic; + var l = GeographicLib.GeodesicLine; + g.GEOGRAPHICLIB_GEODESIC_ORDER = 6; + g.nA1_ = g.GEOGRAPHICLIB_GEODESIC_ORDER; + g.nC1_ = g.GEOGRAPHICLIB_GEODESIC_ORDER; + g.nC1p_ = g.GEOGRAPHICLIB_GEODESIC_ORDER; + g.nA2_ = g.GEOGRAPHICLIB_GEODESIC_ORDER; + g.nC2_ = g.GEOGRAPHICLIB_GEODESIC_ORDER; + g.nA3_ = g.GEOGRAPHICLIB_GEODESIC_ORDER; + g.nA3x_ = g.nA3_; + g.nC3_ = g.GEOGRAPHICLIB_GEODESIC_ORDER; + g.nC3x_ = (g.nC3_ * (g.nC3_ - 1)) / 2; + g.nC4_ = g.GEOGRAPHICLIB_GEODESIC_ORDER; + g.nC4x_ = (g.nC4_ * (g.nC4_ + 1)) / 2; + g.maxit1_ = 20; + g.maxit2_ = g.maxit1_ + m.digits + 10; + g.tiny_ = Math.sqrt(Number.MIN_VALUE); + g.tol0_ = m.epsilon; + g.tol1_ = 200 * g.tol0_; + g.tol2_ = Math.sqrt(g.tol0_); + g.tolb_ = g.tol0_ * g.tol1_; + g.xthresh_ = 1000 * g.tol2_; + + g.CAP_NONE = 0; + g.CAP_C1 = 1<<0; + g.CAP_C1p = 1<<1; + g.CAP_C2 = 1<<2; + g.CAP_C3 = 1<<3; + g.CAP_C4 = 1<<4; + g.CAP_ALL = 0x1F; + g.OUT_ALL = 0x7F80; + g.NONE = 0; + g.LATITUDE = 1<<7 | g.CAP_NONE; + g.LONGITUDE = 1<<8 | g.CAP_C3; + g.AZIMUTH = 1<<9 | g.CAP_NONE; + g.DISTANCE = 1<<10 | g.CAP_C1; + g.DISTANCE_IN = 1<<11 | g.CAP_C1 | g.CAP_C1p; + g.REDUCEDLENGTH = 1<<12 | g.CAP_C1 | g.CAP_C2; + g.GEODESICSCALE = 1<<13 | g.CAP_C1 | g.CAP_C2; + g.AREA = 1<<14 | g.CAP_C4; + g.ALL = g.OUT_ALL| g.CAP_ALL; + + g.SinCosSeries = function(sinp, sinx, cosx, c, n) { + // Evaluate + // y = sinp ? sum(c[i] * sin( 2*i * x), i, 1, n) : + // sum(c[i] * cos((2*i+1) * x), i, 0, n-1) + // using Clenshaw summation. N.B. c[0] is unused for sin series + // Approx operation count = (n + 5) mult and (2 * n + 2) add + var k = n + (sinp ? 1 : 0); // Point to one beyond last element + var + ar = 2 * (cosx - sinx) * (cosx + sinx), // 2 * cos(2 * x) + y0 = n & 1 ? c[--k] : 0, y1 = 0; // accumulators for sum + // Now n is even + n = Math.floor(n/2); + while (n--) { + // Unroll loop x 2, so accumulators return to their original role + y1 = ar * y0 - y1 + c[--k]; + y0 = ar * y1 - y0 + c[--k]; + } + return (sinp + ? 2 * sinx * cosx * y0 // sin(2 * x) * y0 + : cosx * (y0 - y1)); // cos(x) * (y0 - y1) + } + + g.AngRound = function(x) { + // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^57 + // for reals = 0.7 pm on the earth if x is an angle in degrees. (This + // is about 1000 times more resolution than we get with angles around 90 + // degrees.) We use this to avoid having to deal with near singular + // cases when x is non-zero but tiny (e.g., 1.0e-200). + var z = 1/16; + var y = Math.abs(x); + // The compiler mustn't "simplify" z - (z - y) to y + y = y < z ? z - (z - y) : y; + return x < 0 ? -y : y; + } + g.Astroid = function(x, y) { + // Solve k^4+2*k^3-(x^2+y^2-1)*k^2-2*y^2*k-y^2 = 0 for positive + // root k. This solution is adapted from Geocentric::Reverse. + var k; + var + p = m.sq(x), + q = m.sq(y), + r = (p + q - 1) / 6; + if ( !(q == 0 && r <= 0) ) { + var + // Avoid possible division by zero when r = 0 by multiplying + // equations for s and t by r^3 and r, resp. + S = p * q / 4, // S = r^3 * s + r2 = m.sq(r), + r3 = r * r2, + // The discrimant of the quadratic equation for T3. This is + // zero on the evolute curve p^(1/3)+q^(1/3) = 1 + disc = S * (S + 2 * r3); + var u = r; + if (disc >= 0) { + var T3 = S + r3; + // Pick the sign on the sqrt to maximize abs(T3). This + // minimizes loss of precision due to cancellation. The + // result is unchanged because of the way the T is used + // in definition of u. + T3 += T3 < 0 ? -Math.sqrt(disc) + : Math.sqrt(disc); // T3 = (r * t)^3 + // N.B. cbrt always returns the real root. cbrt(-8) = -2. + var T = m.cbrt(T3); // T = r * t + // T can be zero; but then r2 / T -> 0. + u += T + (T != 0 ? r2 / T : 0); + } else { + // T is complex, but the way u is defined the result is real. + var ang = Math.atan2(Math.sqrt(-disc), -(S + r3)); + // There are three possible cube roots. We choose the + // root which avoids cancellation. Note that disc < 0 + // implies that r < 0. + u += 2 * r * Math.cos(ang / 3); + } + var + v = Math.sqrt(m.sq(u) + q), // guaranteed positive + // Avoid loss of accuracy when u < 0. + uv = u < 0 ? q / (v - u) : u + v, // u+v, guaranteed positive + w = (uv - q) / (2 * v); // positive? + // Rearrange expression for k to avoid loss of accuracy due to + // subtraction. Division by 0 not possible because uv > 0, w >= 0. + k = uv / (Math.sqrt(uv + m.sq(w)) + w); // guaranteed positive + } else { // q == 0 && r <= 0 + // y = 0 with |x| <= 1. Handle this case directly. + // for y small, positive root is k = abs(y)/sqrt(1-x^2) + k = 0; + } + return k; + } + + g.A1m1f = function(eps) { + var + eps2 = m.sq(eps), + t = eps2*(eps2*(eps2+4)+64)/256; + return (t + eps) / (1 - eps); + } + + g.C1f = function(eps, c) { + var + eps2 = m.sq(eps), + d = eps; + c[1] = d*((6-eps2)*eps2-16)/32; + d *= eps; + c[2] = d*((64-9*eps2)*eps2-128)/2048; + d *= eps; + c[3] = d*(9*eps2-16)/768; + d *= eps; + c[4] = d*(3*eps2-5)/512; + d *= eps; + c[5] = -7*d/1280; + d *= eps; + c[6] = -7*d/2048; + } + + g.C1pf = function(eps, c) { + var + eps2 = m.sq(eps), + d = eps; + c[1] = d*(eps2*(205*eps2-432)+768)/1536; + d *= eps; + c[2] = d*(eps2*(4005*eps2-4736)+3840)/12288; + d *= eps; + c[3] = d*(116-225*eps2)/384; + d *= eps; + c[4] = d*(2695-7173*eps2)/7680; + d *= eps; + c[5] = 3467*d/7680; + d *= eps; + c[6] = 38081*d/61440; + } + + g.A2m1f = function(eps) { + var + eps2 = m.sq(eps), + t = eps2*(eps2*(25*eps2+36)+64)/256; + return t * (1 - eps) - eps; + } + + g.C2f = function(eps, c) { + var + eps2 = m.sq(eps), + d = eps; + c[1] = d*(eps2*(eps2+2)+16)/32; + d *= eps; + c[2] = d*(eps2*(35*eps2+64)+384)/2048; + d *= eps; + c[3] = d*(15*eps2+80)/768; + d *= eps; + c[4] = d*(7*eps2+35)/512; + d *= eps; + c[5] = 63*d/1280; + d *= eps; + c[6] = 77*d/2048; + } + + g.Geodesic = function(a, f) { + this._a = a; + this._f = f <= 1 ? f : 1/f; + this._f1 = 1 - this._f; + this._e2 = this._f * (2 - this._f); + this._ep2 = this._e2 / m.sq(this._f1); // e2 / (1 - e2) + this._n = this._f / ( 2 - this._f); + this._b = this._a * this._f1; + // authalic radius squared + this._c2 = (m.sq(this._a) + m.sq(this._b) * + (this._e2 == 0 ? 1 : + (this._e2 > 0 ? m.atanh(Math.sqrt(this._e2)) : + Math.atan(Math.sqrt(-this._e2))) / + Math.sqrt(Math.abs(this._e2))))/2; + // The sig12 threshold for "really short". Using the auxiliary sphere + // solution with dnm computed at (bet1 + bet2) / 2, the relative error in + // the azimuth consistency check is sig12^2 * abs(f) * min(1, 1-f/2) / 2. + // (Error measured for 1/100 < b/a < 100 and abs(f) >= 1/1000. For a given + // f and sig12, the max error occurs for lines near the pole. If the old + // rule for computing dnm = (dn1 + dn2)/2 is used, then the error increases + // by a factor of 2.) Setting this equal to epsilon gives sig12 = etol2. + // Here 0.1 is a safety factor (error decreased by 100) and max(0.001, + // abs(f)) stops etol2 getting too large in the nearly spherical case. + this._etol2 = 0.1 * g.tol2_ / + Math.sqrt( Math.max(0.001, Math.abs(this._f)) * + Math.min(1.0, 1 - this._f/2) / 2 ); + if (!(isFinite(this._a) && this._a > 0)) + throw new Error("Major radius is not positive"); + if (!(isFinite(this._b) && this._b > 0)) + throw new Error("Minor radius is not positive"); + this._A3x = new Array(g.nA3x_); + this._C3x = new Array(g.nC3x_); + this._C4x = new Array(g.nC4x_); + this.A3coeff(); + this.C3coeff(); + this.C4coeff(); + } + + g.Geodesic.prototype.A3coeff = function() { + var _n = this._n; + this._A3x[0] = 1; + this._A3x[1] = (_n-1)/2; + this._A3x[2] = (_n*(3*_n-1)-2)/8; + this._A3x[3] = ((-_n-3)*_n-1)/16; + this._A3x[4] = (-2*_n-3)/64; + this._A3x[5] = -3/128; + } + + g.Geodesic.prototype.C3coeff = function() { + var _n = this._n; + this._C3x[0] = (1-_n)/4; + this._C3x[1] = (1-_n*_n)/8; + this._C3x[2] = ((3-_n)*_n+3)/64; + this._C3x[3] = (2*_n+5)/128; + this._C3x[4] = 3/128; + this._C3x[5] = ((_n-3)*_n+2)/32; + this._C3x[6] = ((-3*_n-2)*_n+3)/64; + this._C3x[7] = (_n+3)/128; + this._C3x[8] = 5/256; + this._C3x[9] = (_n*(5*_n-9)+5)/192; + this._C3x[10] = (9-10*_n)/384; + this._C3x[11] = 7/512; + this._C3x[12] = (7-14*_n)/512; + this._C3x[13] = 7/512; + this._C3x[14] = 21/2560; + } + + g.Geodesic.prototype.C4coeff = function() { + var _n = this._n; + this._C4x[0] = (_n*(_n*(_n*(_n*(100*_n+208)+572)+3432)-12012)+30030)/45045; + this._C4x[1] = (_n*(_n*(_n*(64*_n+624)-4576)+6864)-3003)/15015; + this._C4x[2] = (_n*((14144-10656*_n)*_n-4576)-858)/45045; + this._C4x[3] = ((-224*_n-4784)*_n+1573)/45045; + this._C4x[4] = (1088*_n+156)/45045; + this._C4x[5] = 97/15015.0; + this._C4x[6] = (_n*(_n*((-64*_n-624)*_n+4576)-6864)+3003)/135135; + this._C4x[7] = (_n*(_n*(5952*_n-11648)+9152)-2574)/135135; + this._C4x[8] = (_n*(5792*_n+1040)-1287)/135135; + this._C4x[9] = (468-2944*_n)/135135; + this._C4x[10] = 1/9009.0; + this._C4x[11] = (_n*((4160-1440*_n)*_n-4576)+1716)/225225; + this._C4x[12] = ((4992-8448*_n)*_n-1144)/225225; + this._C4x[13] = (1856*_n-936)/225225; + this._C4x[14] = 8/10725.0; + this._C4x[15] = (_n*(3584*_n-3328)+1144)/315315; + this._C4x[16] = (1024*_n-208)/105105; + this._C4x[17] = -136/63063.0; + this._C4x[18] = (832-2560*_n)/405405; + this._C4x[19] = -128/135135.0; + this._C4x[20] = 128/99099.0; + } + + g.Geodesic.prototype.A3f = function(eps) { + // Evaluate sum(_A3x[k] * eps^k, k, 0, nA3x_-1) by Horner's method + var v = 0; + for (var i = g.nA3x_; i; ) + v = eps * v + this._A3x[--i]; + return v; + } + + g.Geodesic.prototype.C3f = function(eps, c) { + // Evaluate C3 coeffs by Horner's method + // Elements c[1] thru c[nC3_ - 1] are set + for (var j = g.nC3x_, k = g.nC3_ - 1; k; ) { + var t = 0; + for (var i = g.nC3_ - k; i; --i) + t = eps * t + this._C3x[--j]; + c[k--] = t; + } + + var mult = 1; + for (var k = 1; k < g.nC3_; ) { + mult *= eps; + c[k++] *= mult; + } + } + + g.Geodesic.prototype.C4f = function(eps, c) { + // Evaluate C4 coeffs by Horner's method + // Elements c[0] thru c[nC4_ - 1] are set + for (var j = g.nC4x_, k = g.nC4_; k; ) { + var t = 0; + for (var i = g.nC4_ - k + 1; i; --i) + t = eps * t + this._C4x[--j]; + c[--k] = t; + } + + var mult = 1; + for (var k = 1; k < g.nC4_; ) { + mult *= eps; + c[k++] *= mult; + } + } + + // return s12b, m12b, m0, M12, M21 + g.Geodesic.prototype.Lengths = function(eps, sig12, + ssig1, csig1, dn1, ssig2, csig2, dn2, + cbet1, cbet2, scalep, + C1a, C2a) { + var vals = {}; + // Return m12b = (reduced length)/_b; also calculate s12b = + // distance/_b, and m0 = coefficient of secular term in + // expression for reduced length. + g.C1f(eps, C1a); + g.C2f(eps, C2a); + var + A1m1 = g.A1m1f(eps), + AB1 = (1 + A1m1) * (g.SinCosSeries(true, ssig2, csig2, C1a, g.nC1_) - + g.SinCosSeries(true, ssig1, csig1, C1a, g.nC1_)), + A2m1 = g.A2m1f(eps), + AB2 = (1 + A2m1) * (g.SinCosSeries(true, ssig2, csig2, C2a, g.nC2_) - + g.SinCosSeries(true, ssig1, csig1, C2a, g.nC2_)); + vals.m0 = A1m1 - A2m1; + var J12 = vals.m0 * sig12 + (AB1 - AB2); + // Missing a factor of _b. + // Add parens around (csig1 * ssig2) and (ssig1 * csig2) to + // ensure accurate cancellation in the case of coincident + // points. + vals.m12b = dn2 * (csig1 * ssig2) - dn1 * (ssig1 * csig2) + - csig1 * csig2 * J12; + // Missing a factor of _b + vals.s12b = (1 + A1m1) * sig12 + AB1; + if (scalep) { + var csig12 = csig1 * csig2 + ssig1 * ssig2; + var t = this._ep2 * (cbet1 - cbet2) * (cbet1 + cbet2) / (dn1 + dn2); + vals.M12 = csig12 + (t * ssig2 - csig2 * J12) * ssig1 / dn1; + vals.M21 = csig12 - (t * ssig1 - csig1 * J12) * ssig2 / dn2; + } + return vals; + } + + // return sig12, salp1, calp1, salp2, calp2, dnm + g.Geodesic.prototype.InverseStart = function(sbet1, cbet1, dn1, + sbet2, cbet2, dn2, lam12, + C1a, C2a) { + // Return a starting point for Newton's method in salp1 and calp1 + // (function value is -1). If Newton's method doesn't need to be + // used, return also salp2 and calp2 and function value is sig12. + // salp2, calp2 only updated if return val >= 0. + var + vals = {}, + // bet12 = bet2 - bet1 in [0, pi); bet12a = bet2 + bet1 in (-pi, 0] + sbet12 = sbet2 * cbet1 - cbet2 * sbet1, + cbet12 = cbet2 * cbet1 + sbet2 * sbet1; + vals.sig12 = -1; // Return value + // Volatile declaration needed to fix inverse cases + // 88.202499451857 0 -88.202499451857 179.981022032992859592 + // 89.262080389218 0 -89.262080389218 179.992207982775375662 + // 89.333123580033 0 -89.333123580032997687 179.99295812360148422 + // which otherwise fail with g++ 4.4.4 x86 -O3 + var sbet12a = sbet2 * cbet1; + sbet12a += cbet2 * sbet1; + + var shortline = cbet12 >= 0 && sbet12 < 0.5 && cbet2 * lam12 < 0.5; + var omg12 = lam12; + if (shortline) { + var sbetm2 = m.sq(sbet1 + sbet2); + // sin((bet1+bet2)/2)^2 + // = (sbet1 + sbet2)^2 / ((sbet1 + sbet2)^2 + (cbet1 + cbet2)^2) + sbetm2 /= sbetm2 + m.sq(cbet1 + cbet2); + vals.dnm = Math.sqrt(1 + this._ep2 * sbetm2); + omg12 /= this._f1 * vals.dnm; + } + var somg12 = Math.sin(omg12), comg12 = Math.cos(omg12); + + vals.salp1 = cbet2 * somg12; + vals.calp1 = comg12 >= 0 ? + sbet12 + cbet2 * sbet1 * m.sq(somg12) / (1 + comg12) : + sbet12a - cbet2 * sbet1 * m.sq(somg12) / (1 - comg12); + + var + ssig12 = m.hypot(vals.salp1, vals.calp1), + csig12 = sbet1 * sbet2 + cbet1 * cbet2 * comg12; + + if (shortline && ssig12 < this._etol2) { + // really short lines + vals.salp2 = cbet1 * somg12; + vals.calp2 = sbet12 - cbet1 * sbet2 * + (comg12 >= 0 ? m.sq(somg12) / (1 + comg12) : 1 - comg12); + // SinCosNorm(vals.salp2, vals.calp2); + var t = m.hypot(vals.salp2, vals.calp2); vals.salp2 /= t; vals.calp2 /= t; + // Set return value + vals.sig12 = Math.atan2(ssig12, csig12); + } else if (Math.abs(this._n) > 0.1 || // Skip astroid calc if too eccentric + csig12 >= 0 || + ssig12 >= 6 * Math.abs(this._n) * Math.PI * m.sq(cbet1)) { + // Nothing to do, zeroth order spherical approximation is OK + } else { + // Scale lam12 and bet2 to x, y coordinate system where antipodal + // point is at origin and singular point is at y = 0, x = -1. + var y, lamscale, betscale; + // Volatile declaration needed to fix inverse case + // 56.320923501171 0 -56.320923501171 179.664747671772880215 + // which otherwise fails with g++ 4.4.4 x86 -O3 + var x; + if (this._f >= 0) { // In fact f == 0 does not get here + // x = dlong, y = dlat + { + var + k2 = m.sq(sbet1) * this._ep2, + eps = k2 / (2 * (1 + Math.sqrt(1 + k2)) + k2); + lamscale = this._f * cbet1 * this.A3f(eps) * Math.PI; + } + betscale = lamscale * cbet1; + + x = (lam12 - Math.PI) / lamscale; + y = sbet12a / betscale; + } else { // _f < 0 + // x = dlat, y = dlong + var + cbet12a = cbet2 * cbet1 - sbet2 * sbet1, + bet12a = Math.atan2(sbet12a, cbet12a); + var m12b, m0; + // In the case of lon12 = 180, this repeats a calculation made + // in Inverse. + var nvals = this.Lengths(this._n, Math.PI + bet12a, + sbet1, -cbet1, dn1, sbet2, cbet2, dn2, + cbet1, cbet2, false, C1a, C2a); + m12b = nvals.m12b; m0 = nvals.m0; + x = -1 + m12b / (cbet1 * cbet2 * m0 * Math.PI); + betscale = x < -0.01 ? sbet12a / x : + -this._f * m.sq(cbet1) * Math.PI; + lamscale = betscale / cbet1; + y = (lam12 - Math.PI) / lamscale; + } + + if (y > -g.tol1_ && x > -1 - g.xthresh_) { + // strip near cut + if (this._f >= 0) { + vals.salp1 = Math.min(1, -x); + vals.calp1 = - Math.sqrt(1 - m.sq(vals.salp1)); + } else { + vals.calp1 = Math.max(x > -g.tol1_ ? 0 : -1, x); + vals.salp1 = Math.sqrt(1 - m.sq(vals.calp1)); + } + } else { + // Estimate alp1, by solving the astroid problem. + // + // Could estimate alpha1 = theta + pi/2, directly, i.e., + // calp1 = y/k; salp1 = -x/(1+k); for _f >= 0 + // calp1 = x/(1+k); salp1 = -y/k; for _f < 0 (need to check) + // + // However, it's better to estimate omg12 from astroid and use + // spherical formula to compute alp1. This reduces the mean number of + // Newton iterations for astroid cases from 2.24 (min 0, max 6) to 2.12 + // (min 0 max 5). The changes in the number of iterations are as + // follows: + // + // change percent + // 1 5 + // 0 78 + // -1 16 + // -2 0.6 + // -3 0.04 + // -4 0.002 + // + // The histogram of iterations is (m = number of iterations estimating + // alp1 directly, n = number of iterations estimating via omg12, total + // number of trials = 148605): + // + // iter m n + // 0 148 186 + // 1 13046 13845 + // 2 93315 102225 + // 3 36189 32341 + // 4 5396 7 + // 5 455 1 + // 6 56 0 + // + // Because omg12 is near pi, estimate work with omg12a = pi - omg12 + var k = g.Astroid(x, y); + var + omg12a = lamscale * ( this._f >= 0 ? -x * k/(1 + k) : -y * (1 + k)/k ); + somg12 = Math.sin(omg12a); comg12 = -Math.cos(omg12a); + // Update spherical estimate of alp1 using omg12 instead of + // lam12 + vals.salp1 = cbet2 * somg12; + vals.calp1 = sbet12a - + cbet2 * sbet1 * m.sq(somg12) / (1 - comg12); + } + } + if (vals.salp1 > 0) { // Sanity check on starting guess + // SinCosNorm(vals.salp1, vals.calp1); + var t = m.hypot(vals.salp1, vals.calp1); vals.salp1 /= t; vals.calp1 /= t; + } else { + vals.salp1 = 1; vals.calp1 = 0; + } + return vals; + } + + // return lam12, salp2, calp2, sig12, ssig1, csig1, ssig2, csig2, eps, + // domg12, dlam12, + g.Geodesic.prototype.Lambda12 = function(sbet1, cbet1, dn1, sbet2, cbet2, dn2, + salp1, calp1, diffp, + C1a, C2a, C3a) { + var vals = {}; + if (sbet1 == 0 && calp1 == 0) + // Break degeneracy of equatorial line. This case has already been + // handled. + calp1 = -g.tiny_; + + var + // sin(alp1) * cos(bet1) = sin(alp0) + salp0 = salp1 * cbet1, + calp0 = m.hypot(calp1, salp1 * sbet1); // calp0 > 0 + + var somg1, comg1, somg2, comg2, omg12; + // tan(bet1) = tan(sig1) * cos(alp1) + // tan(omg1) = sin(alp0) * tan(sig1) = tan(omg1)=tan(alp1)*sin(bet1) + vals.ssig1 = sbet1; somg1 = salp0 * sbet1; + vals.csig1 = comg1 = calp1 * cbet1; + // SinCosNorm(vals.ssig1, vals.csig1); + var t = m.hypot(vals.ssig1, vals.csig1); vals.ssig1 /= t; vals.csig1 /= t; + // SinCosNorm(somg1, comg1); -- don't need to normalize! + + // Enforce symmetries in the case abs(bet2) = -bet1. Need to be careful + // about this case, since this can yield singularities in the Newton + // iteration. + // sin(alp2) * cos(bet2) = sin(alp0) + vals.salp2 = cbet2 != cbet1 ? salp0 / cbet2 : salp1; + // calp2 = sqrt(1 - sq(salp2)) + // = sqrt(sq(calp0) - sq(sbet2)) / cbet2 + // and subst for calp0 and rearrange to give (choose positive sqrt + // to give alp2 in [0, pi/2]). + vals.calp2 = cbet2 != cbet1 || Math.abs(sbet2) != -sbet1 ? + Math.sqrt(m.sq(calp1 * cbet1) + (cbet1 < -sbet1 ? + (cbet2 - cbet1) * (cbet1 + cbet2) : + (sbet1 - sbet2) * (sbet1 + sbet2))) + / cbet2 : Math.abs(calp1); + // tan(bet2) = tan(sig2) * cos(alp2) + // tan(omg2) = sin(alp0) * tan(sig2). + vals.ssig2 = sbet2; somg2 = salp0 * sbet2; + vals.csig2 = comg2 = vals.calp2 * cbet2; + // SinCosNorm(vals.ssig2, vals.csig2); + var t = m.hypot(vals.ssig2, vals.csig2); vals.ssig2 /= t; vals.csig2 /= t; + // SinCosNorm(somg2, comg2); -- don't need to normalize! + + // sig12 = sig2 - sig1, limit to [0, pi] + vals.sig12 = Math.atan2(Math.max(vals.csig1 * vals.ssig2 - + vals.ssig1 * vals.csig2, 0), + vals.csig1 * vals.csig2 + vals.ssig1 * vals.ssig2); + + // omg12 = omg2 - omg1, limit to [0, pi] + omg12 = Math.atan2(Math.max(comg1 * somg2 - somg1 * comg2, 0), + comg1 * comg2 + somg1 * somg2); + var B312, h0; + var k2 = m.sq(calp0) * this._ep2; + vals.eps = k2 / (2 * (1 + Math.sqrt(1 + k2)) + k2); + this.C3f(vals.eps, C3a); + B312 = (g.SinCosSeries(true, vals.ssig2, vals.csig2, C3a, g.nC3_-1) - + g.SinCosSeries(true, vals.ssig1, vals.csig1, C3a, g.nC3_-1)); + h0 = -this._f * this.A3f(vals.eps); + vals.domg12 = salp0 * h0 * (vals.sig12 + B312); + vals.lam12 = omg12 + vals.domg12; + + if (diffp) { + if (vals.calp2 == 0) + vals.dlam12 = - 2 * this._f1 * dn1 / sbet1; + else { + var nvals = this.Lengths(vals.eps, vals.sig12, + vals.ssig1, vals.csig1, dn1, + vals.ssig2, vals.csig2, dn2, + cbet1, cbet2, false, C1a, C2a); + vals.dlam12 = nvals.m12b; + vals.dlam12 *= this._f1 / (vals.calp2 * cbet2); + } + } + return vals; + } + + // return a12, s12, azi1, azi2, m12, M12, M21, S12 + g.Geodesic.prototype.GenInverse = function(lat1, lon1, lat2, lon2, outmask) { + var vals = {}; + outmask &= g.OUT_ALL; + // Compute longitude difference (AngDiff does this carefully). Result is + // in [-180, 180] but -180 is only for west-going geodesics. 180 is for + // east-going and meridional geodesics. + var lon12 = m.AngDiff(m.AngNormalize(lon1), m.AngNormalize(lon2)); + // If very close to being on the same half-meridian, then make it so. + lon12 = g.AngRound(lon12); + // Make longitude difference positive. + var lonsign = lon12 >= 0 ? 1 : -1; + lon12 *= lonsign; + // If really close to the equator, treat as on equator. + lat1 = g.AngRound(lat1); + lat2 = g.AngRound(lat2); + // Swap points so that point with higher (abs) latitude is point 1 + var swapp = Math.abs(lat1) >= Math.abs(lat2) ? 1 : -1; + if (swapp < 0) { + lonsign *= -1; + var t = lat1; + lat1 = lat2; + lat2 = t; + // swap(lat1, lat2); + } + // Make lat1 <= 0 + var latsign = lat1 < 0 ? 1 : -1; + lat1 *= latsign; + lat2 *= latsign; + // Now we have + // + // 0 <= lon12 <= 180 + // -90 <= lat1 <= 0 + // lat1 <= lat2 <= -lat1 + // + // longsign, swapp, latsign register the transformation to bring the + // coordinates to this canonical form. In all cases, 1 means no change was + // made. We make these transformations so that there are few cases to + // check, e.g., on verifying quadrants in atan2. In addition, this + // enforces some symmetries in the results returned. + + var phi, sbet1, cbet1, sbet2, cbet2, s12x, m12x; + + phi = lat1 * m.degree; + // Ensure cbet1 = +epsilon at poles + sbet1 = this._f1 * Math.sin(phi); + cbet1 = lat1 == -90 ? g.tiny_ : Math.cos(phi); + // SinCosNorm(sbet1, cbet1); + var t = m.hypot(sbet1, cbet1); sbet1 /= t; cbet1 /= t; + + phi = lat2 * m.degree; + // Ensure cbet2 = +epsilon at poles + sbet2 = this._f1 * Math.sin(phi); + cbet2 = Math.abs(lat2) == 90 ? g.tiny_ : Math.cos(phi); + // SinCosNorm(sbet2, cbet2); + var t = m.hypot(sbet2, cbet2); sbet2 /= t; cbet2 /= t; + + // If cbet1 < -sbet1, then cbet2 - cbet1 is a sensitive measure of the + // |bet1| - |bet2|. Alternatively (cbet1 >= -sbet1), abs(sbet2) + sbet1 is + // a better measure. This logic is used in assigning calp2 in Lambda12. + // Sometimes these quantities vanish and in that case we force bet2 = +/- + // bet1 exactly. An example where is is necessary is the inverse problem + // 48.522876735459 0 -48.52287673545898293 179.599720456223079643 + // which failed with Visual Studio 10 (Release and Debug) + + if (cbet1 < -sbet1) { + if (cbet2 == cbet1) + sbet2 = sbet2 < 0 ? sbet1 : -sbet1; + } else { + if (Math.abs(sbet2) == -sbet1) + cbet2 = cbet1; + } + + var + dn1 = Math.sqrt(1 + this._ep2 * m.sq(sbet1)), + dn2 = Math.sqrt(1 + this._ep2 * m.sq(sbet2)); + + var + lam12 = lon12 * m.degree, + slam12 = lon12 == 180 ? 0 : Math.sin(lam12), + clam12 = Math.cos(lam12); // lon12 == 90 isn't interesting + + var sig12, calp1, salp1, calp2, salp2; + // index zero elements of these arrays are unused + var + C1a = new Array(g.nC1_ + 1), + C2a = new Array(g.nC2_ + 1), + C3a = new Array(g.nC3_); + + var meridian = lat1 == -90 || slam12 == 0; + + if (meridian) { + + // Endpoints are on a single full meridian, so the geodesic might + // lie on a meridian. + + calp1 = clam12; salp1 = slam12; // Head to the target longitude + calp2 = 1; salp2 = 0; // At the target we're heading north + + var + // tan(bet) = tan(sig) * cos(alp) + ssig1 = sbet1, csig1 = calp1 * cbet1, + ssig2 = sbet2, csig2 = calp2 * cbet2; + + // sig12 = sig2 - sig1 + sig12 = Math.atan2(Math.max(csig1 * ssig2 - ssig1 * csig2, 0), + csig1 * csig2 + ssig1 * ssig2); + { + var nvals = this.Lengths(this._n, sig12, + ssig1, csig1, dn1, ssig2, csig2, dn2, + cbet1, cbet2, (outmask & g.GEODESICSCALE) != 0, + C1a, C2a); + s12x = nvals.s12b; + m12x = nvals.m12b; + // Ignore m0 + if ((outmask & g.GEODESICSCALE) != 0) { + vals.M12 = nvals.M12; + vals.M21 = nvals.M21; + } + } + // Add the check for sig12 since zero length geodesics might yield + // m12 < 0. Test case was + // + // echo 20.001 0 20.001 0 | Geod -i + // + // In fact, we will have sig12 > pi/2 for meridional geodesic + // which is not a shortest path. + if (sig12 < 1 || m12x >= 0) { + m12x *= this._b; + s12x *= this._b; + vals.a12 = sig12 / m.degree; + } else + // m12 < 0, i.e., prolate and too close to anti-podal + meridian = false; + } + + var omg12; + if (!meridian && + sbet1 == 0 && // and sbet2 == 0 + // Mimic the way Lambda12 works with calp1 = 0 + (this._f <= 0 || lam12 <= Math.PI - this._f * Math.PI)) { + + // Geodesic runs along equator + calp1 = calp2 = 0; salp1 = salp2 = 1; + s12x = this._a * lam12; + sig12 = omg12 = lam12 / this._f1; + m12x = this._b * Math.sin(sig12); + if (outmask & g.GEODESICSCALE) + vals.M12 = vals.M21 = Math.cos(sig12); + vals.a12 = lon12 / this._f1; + + } else if (!meridian) { + + // Now point1 and point2 belong within a hemisphere bounded by a + // meridian and geodesic is neither meridional or equatorial. + + // Figure a starting point for Newton's method + var nvals = this.InverseStart(sbet1, cbet1, dn1, sbet2, cbet2, dn2, lam12, + C1a, C2a); + sig12 = nvals.sig12; + salp1 = nvals.salp1; + calp1 = nvals.calp1; + + if (sig12 >= 0) { + salp2 = nvals.salp2; + calp2 = nvals.calp2; + // Short lines (InverseStart sets salp2, calp2, dnm) + + var dnm = nvals.dnm; + s12x = sig12 * this._b * dnm; + m12x = m.sq(dnm) * this._b * Math.sin(sig12 / dnm); + if (outmask & g.GEODESICSCALE) + vals.M12 = vals.M21 = Math.cos(sig12 / dnm); + vals.a12 = sig12 / m.degree; + omg12 = lam12 / (this._f1 * dnm); + } else { + + // Newton's method. This is a straightforward solution of f(alp1) = + // lambda12(alp1) - lam12 = 0 with one wrinkle. f(alp) has exactly one + // root in the interval (0, pi) and its derivative is positive at the + // root. Thus f(alp) is positive for alp > alp1 and negative for alp < + // alp1. During the course of the iteration, a range (alp1a, alp1b) is + // maintained which brackets the root and with each evaluation of + // f(alp) the range is shrunk if possible. Newton's method is + // restarted whenever the derivative of f is negative (because the new + // value of alp1 is then further from the solution) or if the new + // estimate of alp1 lies outside (0,pi); in this case, the new starting + // guess is taken to be (alp1a + alp1b) / 2. + var ssig1, csig1, ssig2, csig2, eps; + var numit = 0; + // Bracketing range + var salp1a = g.tiny_, calp1a = 1, salp1b = g.tiny_, calp1b = -1; + for (var tripn = false, tripb = false; numit < g.maxit2_; ++numit) { + // the WGS84 test set: mean = 1.47, sd = 1.25, max = 16 + // WGS84 and random input: mean = 2.85, sd = 0.60 + var dv; + var nvals = this.Lambda12(sbet1, cbet1, dn1, sbet2, cbet2, dn2, + salp1, calp1, numit < g.maxit1_, + C1a, C2a, C3a); + var v = nvals.lam12 - lam12; + salp2 = nvals.salp2; + calp2 = nvals.calp2; + sig12 = nvals.sig12; + ssig1 = nvals.ssig1; + csig1 = nvals.csig1; + ssig2 = nvals.ssig2; + csig2 = nvals.csig2; + eps = nvals.eps; + omg12 = nvals.domg12; + dv = nvals.dlam12; + + // 2 * tol0 is approximately 1 ulp for a number in [0, pi]. + // Reversed test to allow escape with NaNs + if (tripb || !(Math.abs(v) >= (tripn ? 8 : 2) * g.tol0_)) + break; + // Update bracketing values + if (v > 0 && (numit < g.maxit1_ || calp1/salp1 > calp1b/salp1b)) { + salp1b = salp1; calp1b = calp1; + } else if (v < 0 && + (numit < g.maxit1_ || calp1/salp1 < calp1a/salp1a)) { + salp1a = salp1; calp1a = calp1; + } + if (numit < g.maxit1_ && dv > 0) { + var + dalp1 = -v/dv; + var + sdalp1 = Math.sin(dalp1), cdalp1 = Math.cos(dalp1), + nsalp1 = salp1 * cdalp1 + calp1 * sdalp1; + if (nsalp1 > 0 && Math.abs(dalp1) < Math.PI) { + calp1 = calp1 * cdalp1 - salp1 * sdalp1; + salp1 = Math.max(0, nsalp1); + // SinCosNorm(salp1, calp1); + var t = m.hypot(salp1, calp1); salp1 /= t; calp1 /= t; + // In some regimes we don't get quadratic convergence because + // slope -> 0. So use convergence conditions based on epsilon + // instead of sqrt(epsilon). + tripn = Math.abs(v) <= 16 * g.tol0_; + continue; + } + } + // Either dv was not postive or updated value was outside legal + // range. Use the midpoint of the bracket as the next estimate. + // This mechanism is not needed for the WGS84 ellipsoid, but it does + // catch problems with more eccentric ellipsoids. Its efficacy is + // such for the WGS84 test set with the starting guess set to alp1 = + // 90deg: + // the WGS84 test set: mean = 5.21, sd = 3.93, max = 24 + // WGS84 and random input: mean = 4.74, sd = 0.99 + salp1 = (salp1a + salp1b)/2; + calp1 = (calp1a + calp1b)/2; + // SinCosNorm(salp1, calp1); + var t = m.hypot(salp1, calp1); salp1 /= t; calp1 /= t; + tripn = false; + tripb = (Math.abs(salp1a - salp1) + (calp1a - calp1) < g.tolb_ || + Math.abs(salp1 - salp1b) + (calp1 - calp1b) < g.tolb_); + } + { + var nvals = this.Lengths(eps, sig12, + ssig1, csig1, dn1, ssig2, csig2, dn2, + cbet1, cbet2, + (outmask & g.GEODESICSCALE) != 0, + C1a, C2a); + s12x = nvals.s12b; + m12x = nvals.m12b; + // Ignore m0 + if ((outmask & g.GEODESICSCALE) != 0) { + vals.M12 = nvals.M12; + vals.M21 = nvals.M21; + } + } + m12x *= this._b; + s12x *= this._b; + vals.a12 = sig12 / m.degree; + omg12 = lam12 - omg12; + } + } + + if (outmask & g.DISTANCE) + vals.s12 = 0 + s12x; // Convert -0 to 0 + + if (outmask & g.REDUCEDLENGTH) + vals.m12 = 0 + m12x; // Convert -0 to 0 + + if (outmask & g.AREA) { + var + // From Lambda12: sin(alp1) * cos(bet1) = sin(alp0) + salp0 = salp1 * cbet1, + calp0 = m.hypot(calp1, salp1 * sbet1); // calp0 > 0 + var alp12; + if (calp0 != 0 && salp0 != 0) { + var + // From Lambda12: tan(bet) = tan(sig) * cos(alp) + ssig1 = sbet1, csig1 = calp1 * cbet1, + ssig2 = sbet2, csig2 = calp2 * cbet2, + k2 = m.sq(calp0) * this._ep2, + eps = k2 / (2 * (1 + Math.sqrt(1 + k2)) + k2); + // Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0). + A4 = m.sq(this._a) * calp0 * salp0 * this._e2; + // SinCosNorm(ssig1, csig1); + var t = m.hypot(ssig1, csig1); ssig1 /= t; csig1 /= t; + // SinCosNorm(ssig2, csig2); + var t = m.hypot(ssig2, csig2); ssig2 /= t; csig2 /= t; + var C4a = new Array(g.nC4_); + this.C4f(eps, C4a); + var + B41 = g.SinCosSeries(false, ssig1, csig1, C4a, g.nC4_), + B42 = g.SinCosSeries(false, ssig2, csig2, C4a, g.nC4_); + vals.S12 = A4 * (B42 - B41); + } else + // Avoid problems with indeterminate sig1, sig2 on equator + vals.S12 = 0; + if (!meridian && + omg12 < 0.75 * Math.PI && // Long difference too big + sbet2 - sbet1 < 1.75) { // Lat difference too big + // Use tan(Gamma/2) = tan(omg12/2) + // * (tan(bet1/2)+tan(bet2/2))/(1+tan(bet1/2)*tan(bet2/2)) + // with tan(x/2) = sin(x)/(1+cos(x)) + var + somg12 = Math.sin(omg12), domg12 = 1 + Math.cos(omg12), + dbet1 = 1 + cbet1, dbet2 = 1 + cbet2; + alp12 = 2 * Math.atan2( somg12 * (sbet1*dbet2 + sbet2*dbet1), + domg12 * (sbet1*sbet2 + dbet1*dbet2) ); + } else { + // alp12 = alp2 - alp1, used in atan2 so no need to normalize + var + salp12 = salp2 * calp1 - calp2 * salp1, + calp12 = calp2 * calp1 + salp2 * salp1; + // The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz + // salp12 = -0 and alp12 = -180. However this depends on the sign + // being attached to 0 correctly. The following ensures the correct + // behavior. + if (salp12 == 0 && calp12 < 0) { + salp12 = g.tiny_ * calp1; + calp12 = -1; + } + alp12 = Math.atan2(salp12, calp12); + } + vals.S12 += this._c2 * alp12; + vals.S12 *= swapp * lonsign * latsign; + // Convert -0 to 0 + vals.S12 += 0; + } + + // Convert calp, salp to azimuth accounting for lonsign, swapp, latsign. + if (swapp < 0) { + var t = salp1; + salp1 = salp2; + salp2 = t; + // swap(salp1, salp2); + var t = calp1; + calp1 = calp2; + calp2 = t; + // swap(calp1, calp2); + if (outmask & g.GEODESICSCALE) { + var t = vals.M12; + vals.M12 = vals.M21; + vals.M21 = t; + // swap(vals.M12, vals.M21); + } + } + + salp1 *= swapp * lonsign; calp1 *= swapp * latsign; + salp2 *= swapp * lonsign; calp2 *= swapp * latsign; + + if (outmask & g.AZIMUTH) { + // minus signs give range [-180, 180). 0- converts -0 to +0. + vals.azi1 = 0 - Math.atan2(-salp1, calp1) / m.degree; + vals.azi2 = 0 - Math.atan2(-salp2, calp2) / m.degree; + } + + // Returned value in [0, 180] + return vals; + } + + // return a12, lat2, lon2, azi2, s12, m12, M12, M21, S12 + g.Geodesic.prototype.GenDirect = function (lat1, lon1, azi1, + arcmode, s12_a12, outmask) { + var line = new l.GeodesicLine + (this, lat1, lon1, azi1, + // Automatically supply DISTANCE_IN if necessary + outmask | (arcmode ? g.NONE : g.DISTANCE_IN)); + return line.GenPosition(arcmode, s12_a12, outmask); + } + + g.WGS84 = new g.Geodesic(GeographicLib.Constants.WGS84.a, + GeographicLib.Constants.WGS84.f); +})(); diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/GeodesicLine.js b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/GeodesicLine.js new file mode 100644 index 000000000..b2df9c1f6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/GeodesicLine.js @@ -0,0 +1,294 @@ +/** + * GeodesicLine.js + * Transcription of GeodesicLine.[ch]pp into JavaScript. + * + * See the documentation for the C++ class. The conversion is a literal + * conversion from C++. + * + * The algorithms are derived in + * + * Charles F. F. Karney, + * Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); + * http://dx.doi.org/10.1007/s00190-012-0578-z + * Addenda: http://geographiclib.sf.net/geod-addenda.html + * + * Copyright (c) Charles Karney (2011-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +// Load AFTER GeographicLib/Math.js and GeographicLib/Geodesic.js + +(function() { + var g = GeographicLib.Geodesic; + var l = GeographicLib.GeodesicLine; + var m = GeographicLib.Math; + + l.GeodesicLine = function(geod, lat1, lon1, azi1, caps) { + this._a = geod._a; + this._f = geod._f; + this._b = geod._b; + this._c2 = geod._c2; + this._f1 = geod._f1; + this._caps = !caps ? g.ALL : (caps | g.LATITUDE | g.AZIMUTH); + + azi1 = g.AngRound(m.AngNormalize(azi1)); + lon1 = m.AngNormalize(lon1); + this._lat1 = lat1; + this._lon1 = lon1; + this._azi1 = azi1; + // alp1 is in [0, pi] + var alp1 = azi1 * m.degree; + // Enforce sin(pi) == 0 and cos(pi/2) == 0. Better to face the ensuing + // problems directly than to skirt them. + this._salp1 = azi1 == -180 ? 0 : Math.sin(alp1); + this._calp1 = Math.abs(azi1) == 90 ? 0 : Math.cos(alp1); + var cbet1, sbet1, phi; + phi = lat1 * m.degree; + // Ensure cbet1 = +epsilon at poles + sbet1 = this._f1 * Math.sin(phi); + cbet1 = Math.abs(lat1) == 90 ? g.tiny_ : Math.cos(phi); + // SinCosNorm(sbet1, cbet1); + var t = m.hypot(sbet1, cbet1); sbet1 /= t; cbet1 /= t; + this._dn1 = Math.sqrt(1 + geod._ep2 * m.sq(sbet1)); + + // Evaluate alp0 from sin(alp1) * cos(bet1) = sin(alp0), + this._salp0 = this._salp1 * cbet1; // alp0 in [0, pi/2 - |bet1|] + // Alt: calp0 = hypot(sbet1, calp1 * cbet1). The following + // is slightly better (consider the case salp1 = 0). + this._calp0 = m.hypot(this._calp1, this._salp1 * sbet1); + // Evaluate sig with tan(bet1) = tan(sig1) * cos(alp1). + // sig = 0 is nearest northward crossing of equator. + // With bet1 = 0, alp1 = pi/2, we have sig1 = 0 (equatorial line). + // With bet1 = pi/2, alp1 = -pi, sig1 = pi/2 + // With bet1 = -pi/2, alp1 = 0 , sig1 = -pi/2 + // Evaluate omg1 with tan(omg1) = sin(alp0) * tan(sig1). + // With alp0 in (0, pi/2], quadrants for sig and omg coincide. + // No atan2(0,0) ambiguity at poles since cbet1 = +epsilon. + // With alp0 = 0, omg1 = 0 for alp1 = 0, omg1 = pi for alp1 = pi. + this._ssig1 = sbet1; this._somg1 = this._salp0 * sbet1; + this._csig1 = this._comg1 = + sbet1 != 0 || this._calp1 != 0 ? cbet1 * this._calp1 : 1; + // SinCosNorm(this._ssig1, this._csig1); // sig1 in (-pi, pi] + var t = m.hypot(this._ssig1, this._csig1); + this._ssig1 /= t; this._csig1 /= t; + // SinCosNorm(this._somg1, this._comg1); -- don't need to normalize! + + this._k2 = m.sq(this._calp0) * geod._ep2; + var eps = this._k2 / (2 * (1 + Math.sqrt(1 + this._k2)) + this._k2); + + if (this._caps & g.CAP_C1) { + this._A1m1 = g.A1m1f(eps); + this._C1a = new Array(g.nC1_ + 1); + g.C1f(eps, this._C1a); + this._B11 = g.SinCosSeries(true, this._ssig1, this._csig1, + this._C1a, g.nC1_); + var s = Math.sin(this._B11), c = Math.cos(this._B11); + // tau1 = sig1 + B11 + this._stau1 = this._ssig1 * c + this._csig1 * s; + this._ctau1 = this._csig1 * c - this._ssig1 * s; + // Not necessary because C1pa reverts C1a + // _B11 = -SinCosSeries(true, _stau1, _ctau1, _C1pa, nC1p_); + } + + if (this._caps & g.CAP_C1p) { + this._C1pa = new Array(g.nC1p_ + 1), + g.C1pf(eps, this._C1pa); + } + + if (this._caps & g.CAP_C2) { + this._A2m1 = g.A2m1f(eps); + this._C2a = new Array(g.nC2_ + 1); + g.C2f(eps, this._C2a); + this._B21 = g.SinCosSeries(true, this._ssig1, this._csig1, + this._C2a, g.nC2_); + } + + if (this._caps & g.CAP_C3) { + this._C3a = new Array(g.nC3_); + geod.C3f(eps, this._C3a); + this._A3c = -this._f * this._salp0 * geod.A3f(eps); + this._B31 = g.SinCosSeries(true, this._ssig1, this._csig1, + this._C3a, g.nC3_-1); + } + + if (this._caps & g.CAP_C4) { + this._C4a = new Array(g.nC4_); // all the elements of _C4a are used + geod.C4f(eps, this._C4a); + // Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0) + this._A4 = m.sq(this._a) * this._calp0 * this._salp0 * geod._e2; + this._B41 = g.SinCosSeries(false, this._ssig1, this._csig1, + this._C4a, g.nC4_); + } + } + + // return a12, lat2, lon2, azi2, s12, m12, M12, M21, S12 + l.GeodesicLine.prototype.GenPosition = function(arcmode, s12_a12, + outmask) { + var vals = {}; + outmask &= this._caps & g.OUT_ALL; + if (!( arcmode || (this._caps & g.DISTANCE_IN & g.OUT_ALL) )) { + // Uninitialized or impossible distance calculation requested + vals.a12 = Number.NaN; + return vals; + } + + // Avoid warning about uninitialized B12. + var sig12, ssig12, csig12, B12 = 0, AB1 = 0; + if (arcmode) { + // Interpret s12_a12 as spherical arc length + sig12 = s12_a12 * m.degree; + var s12a = Math.abs(s12_a12); + s12a -= 180 * Math.floor(s12a / 180); + ssig12 = s12a == 0 ? 0 : Math.sin(sig12); + csig12 = s12a == 90 ? 0 : Math.cos(sig12); + } else { + // Interpret s12_a12 as distance + var + tau12 = s12_a12 / (this._b * (1 + this._A1m1)), + s = Math.sin(tau12), + c = Math.cos(tau12); + // tau2 = tau1 + tau12 + B12 = - g.SinCosSeries(true, + this._stau1 * c + this._ctau1 * s, + this._ctau1 * c - this._stau1 * s, + this._C1pa, g.nC1p_); + sig12 = tau12 - (B12 - this._B11); + ssig12 = Math.sin(sig12); csig12 = Math.cos(sig12); + if (Math.abs(this._f) > 0.01) { + // Reverted distance series is inaccurate for |f| > 1/100, so correct + // sig12 with 1 Newton iteration. The following table shows the + // approximate maximum error for a = WGS_a() and various f relative to + // GeodesicExact. + // erri = the error in the inverse solution (nm) + // errd = the error in the direct solution (series only) (nm) + // errda = the error in the direct solution (series + 1 Newton) (nm) + // + // f erri errd errda + // -1/5 12e6 1.2e9 69e6 + // -1/10 123e3 12e6 765e3 + // -1/20 1110 108e3 7155 + // -1/50 18.63 200.9 27.12 + // -1/100 18.63 23.78 23.37 + // -1/150 18.63 21.05 20.26 + // 1/150 22.35 24.73 25.83 + // 1/100 22.35 25.03 25.31 + // 1/50 29.80 231.9 30.44 + // 1/20 5376 146e3 10e3 + // 1/10 829e3 22e6 1.5e6 + // 1/5 157e6 3.8e9 280e6 + var + ssig2 = this._ssig1 * csig12 + this._csig1 * ssig12, + csig2 = this._csig1 * csig12 - this._ssig1 * ssig12; + B12 = g.SinCosSeries(true, ssig2, csig2, this._C1a, g.nC1_); + var serr = (1 + this._A1m1) * (sig12 + (B12 - this._B11)) - + s12_a12 / this._b; + sig12 = sig12 - serr / Math.sqrt(1 + this._k2 * m.sq(ssig2)); + ssig12 = Math.sin(sig12); csig12 = Math.cos(sig12); + // Update B12 below + } + } + + var omg12, lam12, lon12; + var ssig2, csig2, sbet2, cbet2, somg2, comg2, salp2, calp2; + // sig2 = sig1 + sig12 + ssig2 = this._ssig1 * csig12 + this._csig1 * ssig12; + csig2 = this._csig1 * csig12 - this._ssig1 * ssig12; + var dn2 = Math.sqrt(1 + this._k2 * m.sq(ssig2)); + if (outmask & (g.DISTANCE | g.REDUCEDLENGTH | g.GEODESICSCALE)) { + if (arcmode || Math.abs(this._f) > 0.01) + B12 = g.SinCosSeries(true, ssig2, csig2, this._C1a, g.nC1_); + AB1 = (1 + this._A1m1) * (B12 - this._B11); + } + // sin(bet2) = cos(alp0) * sin(sig2) + sbet2 = this._calp0 * ssig2; + // Alt: cbet2 = hypot(csig2, salp0 * ssig2); + cbet2 = m.hypot(this._salp0, this._calp0 * csig2); + if (cbet2 == 0) + // I.e., salp0 = 0, csig2 = 0. Break the degeneracy in this case + cbet2 = csig2 = g.tiny_; + // tan(omg2) = sin(alp0) * tan(sig2) + somg2 = this._salp0 * ssig2; comg2 = csig2; // No need to normalize + // tan(alp0) = cos(sig2)*tan(alp2) + salp2 = this._salp0; calp2 = this._calp0 * csig2; // No need to normalize + // omg12 = omg2 - omg1 + omg12 = Math.atan2(somg2 * this._comg1 - comg2 * this._somg1, + comg2 * this._comg1 + somg2 * this._somg1); + + if (outmask & g.DISTANCE) + vals.s12 = arcmode ? this._b * ((1 + this._A1m1) * sig12 + AB1) : s12_a12; + + if (outmask & g.LONGITUDE) { + lam12 = omg12 + this._A3c * + ( sig12 + (g.SinCosSeries(true, ssig2, csig2, this._C3a, g.nC3_-1) + - this._B31)); + lon12 = lam12 / m.degree; + // Use AngNormalize2 because longitude might have wrapped multiple times. + lon12 = m.AngNormalize2(lon12); + vals.lon2 = m.AngNormalize(this._lon1 + lon12); + } + + if (outmask & g.LATITUDE) + vals.lat2 = Math.atan2(sbet2, this._f1 * cbet2) / m.degree; + + if (outmask & g.AZIMUTH) + // minus signs give range [-180, 180). 0- converts -0 to +0. + vals.azi2 = 0 - Math.atan2(-salp2, calp2) / m.degree; + + if (outmask & (g.REDUCEDLENGTH | g.GEODESICSCALE)) { + var + B22 = g.SinCosSeries(true, ssig2, csig2, this._C2a, g.nC2_), + AB2 = (1 + this._A2m1) * (B22 - this._B21), + J12 = (this._A1m1 - this._A2m1) * sig12 + (AB1 - AB2); + if (outmask & g.REDUCEDLENGTH) + // Add parens around (_csig1 * ssig2) and (_ssig1 * csig2) to ensure + // accurate cancellation in the case of coincident points. + vals.m12 = this._b * (( dn2 * (this._csig1 * ssig2) - + this._dn1 * (this._ssig1 * csig2)) + - this._csig1 * csig2 * J12); + if (outmask & g.GEODESICSCALE) { + var t = this._k2 * (ssig2 - this._ssig1) * (ssig2 + this._ssig1) / + (this._dn1 + dn2); + vals.M12 = csig12 + (t * ssig2 - csig2 * J12) * this._ssig1 / this._dn1; + vals.M21 = csig12 - (t * this._ssig1 - this._csig1 * J12) * ssig2 / dn2; + } + } + + if (outmask & g.AREA) { + var + B42 = g.SinCosSeries(false, ssig2, csig2, this._C4a, g.nC4_); + var salp12, calp12; + if (this._calp0 == 0 || this._salp0 == 0) { + // alp12 = alp2 - alp1, used in atan2 so no need to normalized + salp12 = salp2 * this._calp1 - calp2 * this._salp1; + calp12 = calp2 * this._calp1 + salp2 * this._salp1; + // The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz + // salp12 = -0 and alp12 = -180. However this depends on the sign being + // attached to 0 correctly. The following ensures the correct behavior. + if (salp12 == 0 && calp12 < 0) { + salp12 = g.tiny_ * this._calp1; + calp12 = -1; + } + } else { + // tan(alp) = tan(alp0) * sec(sig) + // tan(alp2-alp1) = (tan(alp2) -tan(alp1)) / (tan(alp2)*tan(alp1)+1) + // = calp0 * salp0 * (csig1-csig2) / (salp0^2 + calp0^2 * csig1*csig2) + // If csig12 > 0, write + // csig1 - csig2 = ssig12 * (csig1 * ssig12 / (1 + csig12) + ssig1) + // else + // csig1 - csig2 = csig1 * (1 - csig12) + ssig12 * ssig1 + // No need to normalize + salp12 = this._calp0 * this._salp0 * + (csig12 <= 0 ? this._csig1 * (1 - csig12) + ssig12 * this._ssig1 : + ssig12 * (this._csig1 * ssig12 / (1 + csig12) + this._ssig1)); + calp12 = m.sq(this._salp0) + m.sq(this._calp0) * this._csig1 * csig2; + } + vals.S12 = this._c2 * Math.atan2(salp12, calp12) + + this._A4 * (B42 - this._B41); + } + + vals.a12 = arcmode ? s12_a12 : sig12 / m.degree; + return vals; + } + +})(); diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Interface.js b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Interface.js new file mode 100644 index 000000000..55a230888 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Interface.js @@ -0,0 +1,257 @@ +/** + * Interface.js + * JavaScript interface routines for the geodesic routines GeographicLib. + * + * This provides JavaScript-style interfaces to Math.js, Geodesic.js, + * GeodesicLine.js, and PolygonArea.js which, in turn, are rather + * literal translations of the following classes from GeographicLib: + * Math, Accumulator, Geodesic, GeodesicLine, PolygonArea. See the + * documentation for the C++ class for more information at + * + * http://geographiclib.sourceforge.net/html/annotated.html + * + * The algorithms are derived in + * + * Charles F. F. Karney, + * Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); + * http://dx.doi.org/10.1007/s00190-012-0578-z + * Addenda: http://geographiclib.sf.net/geod-addenda.html + * + * Copyright (c) Charles Karney (2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + ********************************************************************** + * GeographicLib.Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2, outmask); + * GeographicLib.Geodesic.WGS84.Direct(lat1, lon1, azi1, s12, outmask); + * + * perform the basic geodesic calculations. These return an object with + * (some) of the following fields: + * + * lat1 latitude of point 1 + * lon1 longitude of point 1 + * azi1 azimuth of line at point 1 + * lat2 latitude of point 2 + * lon2 longitude of point 2 + * azi2 azimuth of line at point 2 + * s12 distance from 1 to 2 + * a12 arc length on auxiliary sphere from 1 to 2 + * m12 reduced length of geodesic + * M12 geodesic scale 2 relative to 1 + * M21 geodesic scale 1 relative to 2 + * S12 area between geodesic and equator + * + * outmask determines which fields get included and if outmask is + * omitted, then only the basic geodesic fields are computed. The mask + * is an or'ed combination of the following values + * + * GeographicLib.Geodesic.LATITUDE + * GeographicLib.Geodesic.LONGITUDE + * GeographicLib.Geodesic.AZIMUTH + * GeographicLib.Geodesic.DISTANCE + * GeographicLib.Geodesic.REDUCEDLENGTH + * GeographicLib.Geodesic.GEODESICSCALE + * GeographicLib.Geodesic.AREA + * GeographicLib.Geodesic.ALL + * + ********************************************************************** + * GeographicLib.Geodesic.WGS84.InversePath(lat1, lon1, lat2, lon2, ds12, maxk); + * GeographicLib.Geodesic.WGS84.DirectPath(lat1, lon1, azi1, s12, ds12, maxk); + * + * splits a geodesic line into k equal pieces which are no longer than + * about ds12 (but k cannot exceed maxk, default 20), and returns an + * array of length k + 1 of objects with fields + * + * lat, lon, azi + * + ********************************************************************** + * GeographicLib.Geodesic.Envelope(lat1, lon1, azi1, s12, k) + * + * return the geodesic circle of radius s12 centered on the point lat1, + * lon1. k equally spaced azimuths starting at azi1 are computed. This + * returns an array of k + 1 points with fields lat and lon (with the + * first and last points matching). + * + ********************************************************************** + * GeographicLib.Geodesic.Envelope(lat1, lon1, k, ord); + * + * returns the ord'th order envelope for geodesics emanating from lat1, + * lon1. This is located approximately circumference * ord/2 from the + * point. Thus odd numbered envelopes are centered at the antipodal + * point and even number envelopes are centered on the point itself. + * This returns an array of k + 1 points with fields lat and lon (with + * the first and last points matching). + * + ********************************************************************** + * GeographicLib.Geodesic.WGS84.Area(points, polyline); + * + * computes the area of a polygon with vertices given by an array + * points, each of whose elements contains lat and lon fields. The + * function returns an object with fields. + * + * number, perimeter, area + * + * There is no need to "close" the polygon. If polyline (default = + * false) is true, then the points denote a polyline and its length is + * returned as the perimeter (and the area is not calculated). + **********************************************************************/ + +(function() { + var m = GeographicLib.Math; + var g = GeographicLib.Geodesic; + var l = GeographicLib.GeodesicLine; + + g.Geodesic.CheckPosition = function(lat, lon) { + if (!(Math.abs(lat) <= 90)) + throw new Error("latitude " + lat + " not in [-90, 90]"); + if (!(lon >= -540 && lon < 540)) + throw new Error("longitude " + lon + " not in [-540, 540)"); + return m.AngNormalize(lon); + } + + g.Geodesic.CheckAzimuth = function(azi) { + if (!(azi >= -540 && azi < 540)) + throw new Error("longitude " + azi + " not in [-540, 540)"); + return m.AngNormalize(azi); + } + + g.Geodesic.CheckDistance = function(s) { + if (!(isFinite(s))) + throw new Error("distance " + s + " not a finite number"); + } + + g.Geodesic.prototype.Inverse = function(lat1, lon1, lat2, lon2, outmask) { + if (!outmask) outmask = g.DISTANCE | g.AZIMUTH; + lon1 = g.Geodesic.CheckPosition(lat1, lon1); + lon2 = g.Geodesic.CheckPosition(lat2, lon2); + + var result = this.GenInverse(lat1, lon1, lat2, lon2, outmask); + result.lat1 = lat1; result.lon1 = lon1; + result.lat2 = lat2; result.lon2 = lon2; + + return result; + } + + g.Geodesic.prototype.Direct = function(lat1, lon1, azi1, s12, outmask) { + if (!outmask) outmask = g.LATITUDE | g.LONGITUDE | g.AZIMUTH; + lon1 = g.Geodesic.CheckPosition(lat1, lon1); + azi1 = g.Geodesic.CheckAzimuth(azi1); + g.Geodesic.CheckDistance(s12); + + var result = this.GenDirect(lat1, lon1, azi1, false, s12, outmask); + result.lat1 = lat1; result.lon1 = lon1; + result.azi1 = azi1; result.s12 = s12; + + return result; + } + + g.Geodesic.prototype.InversePath = + function(lat1, lon1, lat2, lon2, ds12, maxk) { + var t = this.Inverse(lat1, lon1, lat2, lon2); + if (!maxk) maxk = 20; + if (!(ds12 > 0)) + throw new Error("ds12 must be a positive number") + var + k = Math.max(1, Math.min(maxk, Math.ceil(t.s12/ds12))), + points = new Array(k + 1); + points[0] = {lat: t.lat1, lon: t.lon1, azi: t.azi1}; + points[k] = {lat: t.lat2, lon: t.lon2, azi: t.azi2}; + if (k > 1) { + var line = new l.GeodesicLine(this, t.lat1, t.lon1, t.azi1, + g.LATITUDE | g.LONGITUDE | g.AZIMUTH), + da12 = t.a12/k; + var vals; + for (var i = 1; i < k; ++i) { + vals = + line.GenPosition(true, i * da12, g.LATITUDE | g.LONGITUDE | g.AZIMUTH); + points[i] = {lat: vals.lat2, lon: vals.lon2, azi: vals.azi2}; + } + } + return points; + } + + g.Geodesic.prototype.DirectPath = + function(lat1, lon1, azi1, s12, ds12, maxk) { + var t = this.Direct(lat1, lon1, azi1, s12); + if (!maxk) maxk = 20; + if (!(ds12 > 0)) + throw new Error("ds12 must be a positive number") + var + k = Math.max(1, Math.min(maxk, Math.ceil(Math.abs(t.s12)/ds12))), + points = new Array(k + 1); + points[0] = {lat: t.lat1, lon: t.lon1, azi: t.azi1}; + points[k] = {lat: t.lat2, lon: t.lon2, azi: t.azi2}; + if (k > 1) { + var line = new l.GeodesicLine(this, t.lat1, t.lon1, t.azi1, + g.LATITUDE | g.LONGITUDE | g.AZIMUTH), + da12 = t.a12/k; + var vals; + for (var i = 1; i < k; ++i) { + vals = + line.GenPosition(true, i * da12, g.LATITUDE | g.LONGITUDE | g.AZIMUTH); + points[i] = {lat: vals.lat2, lon: vals.lon2, azi: vals.azi2}; + } + } + return points; + } + + g.Geodesic.prototype.Circle = function(lat1, lon1, azi1, s12, k) { + if (!(Math.abs(lat1) <= 90)) + throw new Error("lat1 must be in [-90, 90]"); + if (!(lon1 >= -540 && lon1 < 540)) + throw new Error("lon1 must be in [-540, 540)"); + if (!(azi1 >= -540 && azi1 < 540)) + throw new Error("azi1 must be in [-540, 540)"); + if (!(isFinite(s12))) + throw new Error("s12 must be a finite number"); + lon1 = m.AngNormalize(lon1); + azi1 = m.AngNormalize(azi1); + if (!k || k < 4) k = 24; + var points = new Array(k + 1); + var vals; + for (var i = 0; i <= k; ++i) { + var azi1a = azi1 + (k - i) * 360 / k; // Traverse circle counter-clocwise + if (azi1a >= 180) azi1a -= 360; + vals = + this.GenDirect(lat1, lon1, azi1a, false, s12, g.LATITUDE | g.LONGITUDE); + points[i] = {lat: vals.lat2, lon: vals.lon2}; + } + return points; + } + + g.Geodesic.prototype.Envelope = function(lat1, lon1, k, ord) { + if (!(Math.abs(lat1) <= 90)) + throw new Error("lat1 must be in [-90, 90]"); + if (!(lon1 >= -540 && lon1 < 540)) + throw new Error("lon1 must be in [-540, 540)"); + lon1 = m.AngNormalize(lon1); + if (!k || k < 4) k = 24; + if (!ord) ord = 1; + var points = new Array(k + 1); + var vals, line, s12, j; + for (var i = 0; i <= k; ++i) { + var azi1 = -180 + i * 360 / k; + line = new l.GeodesicLine(this, lat1, lon1, azi1, + g.LATITUDE | g.LONGITUDE | g.DISTANCE_IN | + g.DISTANCE | g.REDUCEDLENGTH | g.GEODESICSCALE); + vals = line.GenPosition(true, 180 * ord, + g.DISTANCE | g.REDUCEDLENGTH | g.GEODESICSCALE); + j = 0; + while (true) { + // Solve m12(s12) = 0 by Newton's method using dm12/ds12 = M21 + s12 = vals.s12 - vals.m12/vals.M21; + if (Math.abs(vals.m12) < line._a * g.tol2_ * 0.1 || ++j > 10) + break; + vals = line.GenPosition(false, s12, + g.DISTANCE | g.REDUCEDLENGTH | g.GEODESICSCALE); + } + vals = line.GenPosition(false, s12, g.LATITUDE | g.LONGITUDE); + points[i] = {lat: vals.lat2, lon: vals.lon2}; + } + return points; + } + + g.Geodesic.prototype.Area = function(points, polyline) { + return GeographicLib.PolygonArea.Area(this, points, polyline); + } + +})(); diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Math.js b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Math.js new file mode 100644 index 000000000..c13dd2c93 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Math.js @@ -0,0 +1,172 @@ +/** + * Math.js + * Transcription of Math.hpp, Constants.hpp, and Accumulator.hpp into + * JavaScript. + * + * Copyright (c) Charles Karney (2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +var GeographicLib; if (!GeographicLib) GeographicLib = {}; + +GeographicLib.Math = {}; + +GeographicLib.Math.sq = function(x) { return x * x; } + +GeographicLib.Math.hypot = function(x, y) { + x = Math.abs(x); + y = Math.abs(y); + var a = Math.max(x, y), b = Math.min(x, y) / (a ? a : 1); + return a * Math.sqrt(1 + b * b); +} + +GeographicLib.Math.cbrt = function(x) { + var y = Math.pow(Math.abs(x), 1/3); + return x < 0 ? -y : y; +} + +GeographicLib.Math.log1p = function(x) { + var + y = 1 + x, + z = y - 1; + // Here's the explanation for this magic: y = 1 + z, exactly, and z + // approx x, thus log(y)/z (which is nearly constant near z = 0) returns + // a good approximation to the true log(1 + x)/x. The multiplication x * + // (log(y)/z) introduces little additional error. + return z == 0 ? x : x * Math.log(y) / z; +} + +GeographicLib.Math.atanh = function(x) { + var y = Math.abs(x); // Enforce odd parity + y = GeographicLib.Math.log1p(2 * y/(1 - y))/2; + return x < 0 ? -y : y; +} + +GeographicLib.Math.sum = function(u, v) { + var + s = u + v, + up = s - v, + vpp = s - up; + up -= u; + vpp -= v; + t = -(up + vpp); + // u + v = s + t + // = round(u + v) + t + return {s: s, t: t}; +} + +GeographicLib.Math.AngNormalize = function(x) { + // Place angle in [-180, 180). Assumes x is in [-540, 540). + return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); +} + +GeographicLib.Math.AngNormalize2 = function(x) { + // Place arbitrary angle in [-180, 180). + return GeographicLib.Math.AngNormalize(x % 360); +} + +GeographicLib.Math.AngDiff = function(x, y) { + // Compute y - x and reduce to [-180,180] accurately. + // This is the same logic as the Accumulator class uses. + var + d = y - x, + yp = d + x, + xpp = yp - d; + yp -= y; + xpp -= x; + var t = xpp - yp; + // y - x = d + t + // = round(y - x) + t + if ((d - 180) + t > 0) // y - x > 180 + d -= 360; // exact + else if ((d + 180) + t <= 0) // y - x <= -180 + d += 360; // exact + return d + t; +} + +GeographicLib.Math.epsilon = Math.pow(0.5, 52); +GeographicLib.Math.degree = Math.PI/180; +GeographicLib.Math.digits = 53; + +GeographicLib.Constants = {}; +GeographicLib.Constants.WGS84 = { a: 6378137, f: 1/298.257223563 }; + +GeographicLib.Accumulator = {}; +(function() { + a = GeographicLib.Accumulator; + var m = GeographicLib.Math; + + a.Accumulator = function(y) { + this.Set(y); + } + + a.Accumulator.prototype.Set = function(y) { + if (!y) y = 0; + if (y.constructor == a.Accumulator) { + this._s = y._s; + this._t = y._t; + } else { + this._s = y; + this._t = 0; + } + } + + a.Accumulator.prototype.Add = function(y) { + // Here's Shewchuk's solution... + // Accumulate starting at least significant end + var u = m.sum(y, this._t); + var v = m.sum(u.s, this._s); + u = u.t; + this._s = v.s; + this._t = v.t; + // Start is _s, _t decreasing and non-adjacent. Sum is now (s + t + u) + // exactly with s, t, u non-adjacent and in decreasing order (except + // for possible zeros). The following code tries to normalize the + // result. Ideally, we want _s = round(s+t+u) and _u = round(s+t+u - + // _s). The follow does an approximate job (and maintains the + // decreasing non-adjacent property). Here are two "failures" using + // 3-bit floats: + // + // Case 1: _s is not equal to round(s+t+u) -- off by 1 ulp + // [12, -1] - 8 -> [4, 0, -1] -> [4, -1] = 3 should be [3, 0] = 3 + // + // Case 2: _s+_t is not as close to s+t+u as it shold be + // [64, 5] + 4 -> [64, 8, 1] -> [64, 8] = 72 (off by 1) + // should be [80, -7] = 73 (exact) + // + // "Fixing" these problems is probably not worth the expense. The + // representation inevitably leads to small errors in the accumulated + // values. The additional errors illustrated here amount to 1 ulp of + // the less significant word during each addition to the Accumulator + // and an additional possible error of 1 ulp in the reported sum. + // + // Incidentally, the "ideal" representation described above is not + // canonical, because _s = round(_s + _t) may not be true. For + // example, with 3-bit floats: + // + // [128, 16] + 1 -> [160, -16] -- 160 = round(145). + // But [160, 0] - 16 -> [128, 16] -- 128 = round(144). + // + if (this._s == 0) // This implies t == 0, + this._s = u; // so result is u + else + this._t += u; // otherwise just accumulate u to t. + } + + a.Accumulator.prototype.Sum = function(y) { + if (!y) + return this._s; + else { + var b = new a.Accumulator(this); + b.Add(y); + return b._s; + } + } + + a.Accumulator.prototype.Negate = function() { + this._s *= -1; + this._t *= -1; + } + +})(); diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/PolygonArea.js b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/PolygonArea.js new file mode 100644 index 000000000..e1e07f608 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/PolygonArea.js @@ -0,0 +1,241 @@ +/** + * PolygonArea.js + * Transcription of PolygonArea.[ch]pp into JavaScript. + * + * See the documentation for the C++ class. The conversion is a literal + * conversion from C++. + * + * The algorithms are derived in + * + * Charles F. F. Karney, + * Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); + * http://dx.doi.org/10.1007/s00190-012-0578-z + * Addenda: http://geographiclib.sf.net/geod-addenda.html + * + * Copyright (c) Charles Karney (2011-2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +// Load AFTER GeographicLib/Math.js and GeographicLib/Geodesic.js + +GeographicLib.PolygonArea = {}; + +(function() { + var m = GeographicLib.Math; + var a = GeographicLib.Accumulator; + var g = GeographicLib.Geodesic; + var p = GeographicLib.PolygonArea; + + p.transit = function(lon1, lon2) { + // Return 1 or -1 if crossing prime meridian in east or west direction. + // Otherwise return zero. + // Compute lon12 the same way as Geodesic::Inverse. + lon1 = m.AngNormalize(lon1); + lon2 = m.AngNormalize(lon2); + var lon12 = m.AngDiff(lon1, lon2); + var cross = + lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 : + (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0); + return cross; + } + + p.PolygonArea = function(earth, polyline) { + this._earth = earth; + this._area0 = 4 * Math.PI * earth._c2; + this._polyline = !polyline ? false : polyline; + this._mask = g.LATITUDE | g.LONGITUDE | g.DISTANCE | + (this._polyline ? g.NONE : g.AREA); + if (!this._polyline) + this._areasum = new a.Accumulator(0); + this._perimetersum = new a.Accumulator(0); + this.Clear(); + } + + p.PolygonArea.prototype.Clear = function() { + this._num = 0; + this._crossings = 0; + if (!this._polyline) + this._areasum.Set(0); + this._perimetersum.Set(0); + this._lat0 = this._lon0 = this._lat1 = this._lon1 = Number.NaN; + } + + p.PolygonArea.prototype.AddPoint = function(lat, lon) { + if (this._num == 0) { + this._lat0 = this._lat1 = lat; + this._lon0 = this._lon1 = lon; + } else { + var t = this._earth.Inverse(this._lat1, this._lon1, lat, lon, this._mask); + this._perimetersum.Add(t.s12); + if (!this._polyline) { + this._areasum.Add(t.S12); + this._crossings += p.transit(this._lon1, lon); + } + this._lat1 = lat; + this._lon1 = lon; + } + ++this._num; + } + + p.PolygonArea.prototype.AddEdge = function(azi, s) { + if (this._num) { + var t = this._earth.Direct(this._lat1, this._lon1, azi, s, this._mask); + this._perimetersum.Add(s); + if (!this._polyline) { + this._areasum.Add(t.S12); + this._crossings += p.transit(this._lon1, t.lon2); + } + this._lat1 = t.lat2; + this._lon1 = t.lon2; + } + ++this._num; + } + + // return number, perimeter, area + p.PolygonArea.prototype.Compute = function(reverse, sign) { + var vals = {number: this._num}; + if (this._num < 2) { + vals.perimeter = 0; + if (!this._polyline) + vals.area = 0; + return vals; + } + if (this._polyline) { + vals.perimeter = this._perimetersum.Sum(); + return vals; + } + var t = this._earth.Inverse(this._lat1, this._lon1, this._lat0, this._lon0, + this._mask); + vals.perimeter = this._perimetersum.Sum(t.s12); + var tempsum = new a.Accumulator(this._areasum); + tempsum.Add(t.S12); + var crossings = this._crossings + p.transit(this._lon1, this._lon0); + if (crossings & 1) + tempsum.Add( (tempsum.Sum() < 0 ? 1 : -1) * this._area0/2 ); + // area is with the clockwise sense. If !reverse convert to + // counter-clockwise convention. + if (!reverse) + tempsum.Negate(); + // If sign put area in (-area0/2, area0/2], else put area in [0, area0) + if (sign) { + if (tempsum.Sum() > this._area0/2) + tempsum.Add( -this._area0 ); + else if (tempsum.Sum() <= -this._area0/2) + tempsum.Add( +this._area0 ); + } else { + if (tempsum.Sum() >= this._area0) + tempsum.Add( -this._area0 ); + else if (tempsum < 0) + tempsum.Add( -this._area0 ); + } + vals.area = tempsum.Sum(); + return vals; + } + + // return number, perimeter, area + p.PolygonArea.prototype.TestPoint = function(lat, lon, reverse, sign) { + var vals = {number: this._num + 1}; + if (this._num == 0) { + vals.perimeter = 0; + if (!this._polyline) + vals.area = 0; + return vals; + } + vals.perimeter = this._perimetersum.Sum(); + var tempsum = this._polyline ? 0 : this._areasum.Sum(); + var crossings = this._crossings; + var t; + for (var i = 0; i < (this._polyline ? 1 : 2); ++i) { + t = this._earth.Inverse + (i == 0 ? this._lat1 : lat, i == 0 ? this._lon1 : lon, + i != 0 ? this._lat0 : lat, i != 0 ? this._lon0 : lon, + this._mask); + vals.perimeter += t.s12; + if (!this._polyline) { + tempsum += t.S12; + crossings += p.transit(i == 0 ? this._lon1 : lon, + i != 0 ? this._lon0 : lon); + } + } + + if (this._polyline) + return vals; + + if (crossings & 1) + tempsum += (tempsum < 0 ? 1 : -1) * this._area0/2; + // area is with the clockwise sense. If !reverse convert to + // counter-clockwise convention. + if (!reverse) + tempsum *= -1; + // If sign put area in (-area0/2, area0/2], else put area in [0, area0) + if (sign) { + if (tempsum > this._area0/2) + tempsum -= this._area0; + else if (tempsum <= -this._area0/2) + tempsum += this._area0; + } else { + if (tempsum >= this._area0) + tempsum -= this._area0; + else if (tempsum < 0) + tempsum += this._area0; + } + vals.area = tempsum; + return vals; + } + + // return number, perimeter, area + p.PolygonArea.prototype.TestEdge = function(azi, s, reverse, sign) { + var vals = {number: this._num ? this._num + 1 : 0}; + if (this._num == 0) + return vals; + vals.perimeter = this._perimetersum.Sum() + s; + if (this._polyline) + return vals; + + var tempsum = this._areasum.Sum(); + var crossings = this._crossings; + var t; + t = this._earth.Direct(this._lat1, this._lon1, azi, s, this._mask); + tempsum += t.S12; + crossings += p.transit(this._lon1, t.lon2); + t = this._earth(t.lat2, t.lon2, this._lat0, this._lon0, this._mask); + perimeter += t.s12; + tempsum += t.S12; + crossings += p.transit(t.lon2, this._lon0); + + if (crossings & 1) + tempsum += (tempsum < 0 ? 1 : -1) * this._area0/2; + // area is with the clockwise sense. If !reverse convert to + // counter-clockwise convention. + if (!reverse) + tempsum *= -1; + // If sign put area in (-area0/2, area0/2], else put area in [0, area0) + if (sign) { + if (tempsum > this._area0/2) + tempsum -= this._area0; + else if (tempsum <= -this._area0/2) + tempsum += this._area0; + } else { + if (tempsum >= this._area0) + tempsum -= this._area0; + else if (tempsum < 0) + tempsum += this._area0; + } + vals.area = tempsum; + return vals; + } + + p.PolygonArea.prototype.CurrentPoint = function() { + var vals = {lat: this._lat1, lon: this._lon1}; + return vals; + } + + p.Area = function(earth, points, polyline) { + var poly = new p.PolygonArea(earth, polyline); + for (var i = 0; i < points.length; ++i) + poly.AddPoint(points[i].lat, points[i].lon); + return poly.Compute(false, true); + } + +})(); diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/geod-calc.html b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-calc.html new file mode 100644 index 000000000..a6e0b094b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-calc.html @@ -0,0 +1,471 @@ + + + + Geodesic calculations for an ellipsoid done right + + + + + + + +
+

Geodesic calculations for an ellipsoid done right

+
+

+ This page illustrates the geodesic routines available in + GeographicLib. + The C++ code has been converted to JavaScript so the calculations + are carried out on the client. The algorithms are considerably + more accurate than Vincenty's method, and offer more functionality + (an inverse method which never fails to converge, differential + properties of the geodesic, and the area under a geodesic). The + algorithms are derived in +

+ Charles F. F. Karney,
+ + Algorithms for geodesics,
+ J. Geodesy 87(1), 43–55 (Jan. 2013);
+ DOI: + + 10.1007/s00190-012-0578-z + (pdf); + addenda: + geod-addenda.html. +
+ This page just provides a basic interface. Enter latitudes, + longitudes, and azimuths as degrees and distances as meters using + spaces or commas as separators. (Angles may be entered as decimal + degrees or as degrees, minutes, and seconds, e.g. -20.51125, + 20°30′40.5″S, S20d30'40.5", or + -20:30:40.5.) The results are accurate to about + 15 nanometers (or 0.1 m2 per vertex for + areas). A slicker page where the geodesics are incorporated into + Google Maps is given here. +

+ Jump to: +

+

+
+
+

Inverse problem

+

+ Find the shortest path between two points on the earth. The + path is characterized by its length s12 and its azimuth + at the two ends azi1 and azi2. The sample + calculation finds the shortest path between Wellington, New + Zealand, and Salamanca, Spain. (For this example, the + NGS + + inverse geodesic calculator returns a result which is 1.2 km + too long with an azimuth which is off by 3 degrees.) To perform + the calculation, press the “COMPUTE” button. +

+

Enter “lat1 lon1 lat2 lon2”:

+

input: + +

+

+ Output format:    +
+ Output precision:   +

+

+ +

+

+ status: + +

+

+ lat1 lon1 azi1: + +

+

+ lat2 lon2 azi2: + +

+

+ s12: + +

+
+
+
+

Direct problem

+

+ Find the destination traveling a given distance along a geodesic + with a given azimuth at the starting point. The destination is + characterized by its position lat2, lon2 and its azimuth + at the destination azi2. The sample calculation shows + the result of travelling 10000 km NE from JFK airport. To perform + the calculation, press the “COMPUTE” button. +

+

Enter “lat1 lon1 azi1 s12”:

+

input: + +

+

+ Output format:    +
+ Output precision:   +

+

+ +

+

+ status: + +

+

+ lat1 lon1 azi1: + +

+

+ lat2 lon2 azi2: + +

+

+ s12: + +

+ +
+
+

Geodesic path

+

+ Find intermediate points along a geodesic. In addition to + specifying the endpoints, give ds12, the maximum distance + between the intermediate points and maxk, the maximum + number of intervals the geodesic is broken into. The output + gives a sequence of positions lat, lon together with the + corresponding azimuths azi. The sample shows the path + from JFK to Singapore's Changi Airport at about 1000 km + intervals. (In this example, the path taken by Google Earth + deviates from the shortest path by about 2.9 km.) To perform + the calculation, press the “COMPUTE” button. +

+

Enter “lat1 lon1 lat2 lon2 ds12 maxk”:

+

input: + +

+

+ Output format:    +
+ Output precision:   +

+

+ +

+

+ status: + +

+

+ points (lat lon azi):
+ +

+ +
+
+

Polygon area

+

+ Find the perimeter and area of a polygon whose sides are + geodesics. The polygon must be simple (i.e., must not intersect + itself). (There's no need to ensure that the polygon is + closed.) Counter-clockwise traversal of the polygon results in + a positive area. The polygon can encircle one or both poles. + The sample gives the approximate perimeter (in m) and area (in + m2) of Antarctica. (For this example, Google Earth + Pro returns an area which is 30 times too large! However this + is a little unfair, since Google Earth has no concept of + polygons which encircle a pole.) If the polyline option + is selected then just the length of the line joining the points + is is returned. To perform the calculation, press the + “COMPUTE” button. +

+

Enter points, one per line, as “lat lon”:

+

points (lat lon):
+ +

+

+ Treat points as:    + +

+

+ +

+

+ status: + +

+

+ number perimeter area: + +

+ +
+
Charles Karney + <charles@karney.com> + (2011-08-04)
+
+ + SourceForge.net + + + diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google-instructions.html b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google-instructions.html new file mode 100644 index 000000000..8d6f25c56 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google-instructions.html @@ -0,0 +1,118 @@ + + + + + Geodesic lines, circles, envelopes in Google Maps (instructions) + + + + + + +

+ Geodesic lines, circles, envelopes in Google Maps (instructions) +

+

+ The page allows you to draw + accurate ellipsoidal geodesics on Google Maps. You can specify the + geodesic in one of two forms: +

    +
  • + The direct problem: specify a starting point, an + azimuth and a distance as lat1 lon1 azi1 s12 as degrees + and meters. +
  • + The inverse problem: specify the two end points + as lat1 lon1 lat2 lon2 as degrees; this finds the + shortest path between the two points. +
+ (Angles may be entered as decimal degrees or as degrees, minutes, + and seconds, e.g. -20.51125, 20°30′40.5″S, + S20d30'40.5", or -20:30:40.5.) Click on the + corresponding "compute" button. The display then shows +
    +
  • The requested geodesic as a blue + line; the WGS84 ellipsoid model is used. +
  • The geodesic circle as a green + curve; this shows the locus of points a + distance s12 from lat1, lon1. +
  • The geodesic envelopes as red + curves; all the geodesics emanating from lat1, + lon1 are tangent to the envelopes (providing they are + extended far enough). The number of solutions to the inverse + problem changes depending on whether lat2, lon2 lies + inside the envelopes. For example, there are four (resp. two) + approximately hemispheroidal geodesics if this point lies + inside (resp. outside) the inner envelope (only one of which + is a shortest path). +
+

+

+ The sample data has lat1, lon1 in Wellington, New + Zealand, lat2, lon2 in Salamanca, Spain, and s12 + about 1.5 times the earth's circumference. Try clicking on the + "compute" button next to the "Direct:" input box when the page + first loads. You can navigate around the map using the normal + Google Map controls. +

+

+ The precision of output for the geodesic is 0.1" or 1 m. + A text-only geodesic calculator based + on the same JavaScript library is also available; this calculator + solves the inverse and direct geodesic problems, computes + intermediate points on a geodesic, and finds the area of a + geodesic polygon; it allows you to specify the precision of the + output and choose between decimal degrees and degress, minutes, + and seconds. +

+ The Javascipt code for computing the geodesic lines, circles, and + envelopes is part of + GeographicLib. + The algorithms are derived in +

+ Charles F. F. Karney,
+ + Algorithms for geodesics,
+ J. Geodesy 87(1), 43–55 (Jan. 2013);
+ DOI: + + 10.1007/s00190-012-0578-z + (pdf);
+ addenda: + geod-addenda.html. +
+ In putting together this Google Maps demonstration, I started with + the sample code + + geometry-headings.html. +

+
+
Charles Karney + <charles@karney.com> + (2011-08-02)
+
+ + SourceForge.net + + + diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google.html b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google.html new file mode 100644 index 000000000..35576cf87 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google.html @@ -0,0 +1,221 @@ + + + + + + Geodesic lines, circles, envelopes in Google Maps + + + + + + + + + +
+
+
+

+  Direct:   + + +

+

+  Inverse: + + +

+

+  lat1 lon1 azi1: +

+

+  lat2 lon2 azi2: +

+

+  s12: +    status: +    + INSTRUCTIONS HERE +

+
+ + diff --git a/gtsam/3rdparty/GeographicLib/doc/thompson-tm-graticule-a.png b/gtsam/3rdparty/GeographicLib/doc/thompson-tm-graticule-a.png new file mode 100644 index 000000000..b3740ea99 Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/thompson-tm-graticule-a.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/thompson-tm-graticule.png b/gtsam/3rdparty/GeographicLib/doc/thompson-tm-graticule.png new file mode 100644 index 000000000..ba60e4ddb Binary files /dev/null and b/gtsam/3rdparty/GeographicLib/doc/thompson-tm-graticule.png differ diff --git a/gtsam/3rdparty/GeographicLib/doc/tmseries30.html b/gtsam/3rdparty/GeographicLib/doc/tmseries30.html new file mode 100644 index 000000000..26b1f9341 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/tmseries30.html @@ -0,0 +1,1046 @@ + + + + Krueger's series for the transverse Mercator projection + + +

+ Krueger's series for the transverse Mercator projection +

+ This extends Krueger's series for the transverse Mercator projection + given in here to 30th + order in the flattening. See +
+ Louis Krueger, + + Konforme Abbildung des Erdellipsoids in der Ebene, + Royal Prussian Geodetic Institute, New Series 52, 172 pp. (1912), + DOI: + + 10.2312/GFZ.b103-krueger28 +
+ and +
+ Charles F. F. Karney, + + Transverse Mercator with an accuracy of a few nanometers, + J. Geodesy 85(8), 475–485 (Aug. 2011); preprint + arXiv:1002.1417; + resource page + tm.html. +
+
+
+Krueger, p. 12, Eq. (5)
+A = a/(n + 1) * (1 + 1/4 * n^2
+                   + 1/64 * n^4
+                   + 1/256 * n^6
+                   + 25/16384 * n^8
+                   + 49/65536 * n^10
+                   + 441/1048576 * n^12
+                   + 1089/4194304 * n^14
+                   + 184041/1073741824 * n^16
+                   + 511225/4294967296 * n^18
+                   + 5909761/68719476736 * n^20
+                   + 17631601/274877906944 * n^22
+                   + 863948449/17592186044416 * n^24
+                   + 2704312009/70368744177664 * n^26
+                   + 34493775625/1125899906842624 * n^28
+                   + 111759833025/4503599627370496 * n^30);
+
+Krueger's gamma[j], p. 21, Eq. (41)
+alpha[1]
+   = 1/2 * n
+   - 2/3 * n^2
+   + 5/16 * n^3
+   + 41/180 * n^4
+   - 127/288 * n^5
+   + 7891/37800 * n^6
+   + 72161/387072 * n^7
+   - 18975107/50803200 * n^8
+   + 60193001/290304000 * n^9
+   + 134592031/1026432000 * n^10
+   - 1043934033787/3218890752000 * n^11
+   + 1107802529272207/5178390497280000 * n^12
+   + 142419537515471/2027901173760000 * n^13
+   - 20550145413484373/80782891757568000 * n^14
+   + 2101511170951245259/11421139410616320000 * n^15
+   + 6871484604164555073473/152001089131039948800000 * n^16
+   - 316612189636291463036929/1590165240140110233600000 * n^17
+   + 311760891443585845069947023/2276285401141473705984000000 * n^18
+   + 347174131720182892842402053/5544999731500337332224000000 * n^19
+   - 10268774819324130983842267351303/53283288669919616509673472000000 * n^20
+   + 464746136644252720151415143064067/3701786370752310199619420160000000 * n^21
+   + 2064362591952186950153454576839857/30080838421836438047733841920000000 * n^22
+   - 371073254699693809696179501698840034443/1863568101909611009933206974627840000000 * n^23
+   + 5346008647175289889016543194428866601311819/37129264970421612359156732460741427200000000 * n^24
+   + 6137137281591956159684411551066421423706607/167888850301036855884882616344222105600000000 * n^25
+   - 5694433253276142746311340663687118018405227/34071560796386891341343825081621544960000000 * n^26
+   + 1499618325109985269858805780437308686284756403/11441314242737326475117926447161802752000000000 * n^27
+   + 28163788993539415131077859632876464031084037436421/1310187798864261519640035449688674889891840000000000 * n^28
+   - 1382954166683887199687110280755185774160434238372379/10481502390914092157120283597509399119134720000000000 * n^29
+   + 115342138314917862218900682540434301181025997372394740949/1236751772737919661464211462733624662313402368000000000000 * n^30;
+alpha[2]
+   = 13/48 * n^2
+   - 3/5 * n^3
+   + 557/1440 * n^4
+   + 281/630 * n^5
+   - 1983433/1935360 * n^6
+   + 13769/28800 * n^7
+   + 148003883/174182400 * n^8
+   - 705286231/465696000 * n^9
+   + 1703267974087/3218890752000 * n^10
+   + 490493610499/373621248000 * n^11
+   - 1975809888712343/976396861440000 * n^12
+   + 1116592309932851/2013818526720000 * n^13
+   + 802251814098377521231/445424437014036480000 * n^14
+   - 25718419234005720100069/10254041727093964800000 * n^15
+   + 10411677743818269012186343/20672148121821433036800000 * n^16
+   + 58069234404819345427642159/24548175894662951731200000 * n^17
+   - 1619780216513490679161882727/538657116774318483701760000 * n^18
+   + 15210374203334956573188013/39416197422363181056000000 * n^19
+   + 1350424643880191120787483875017417/444214364490277223954330419200000 * n^20
+   - 363512649110052773321859331443938611/101105040251172472327105413120000000 * n^21
+   + 110501360211107135866854552436284378043/372713620381922201986641394925568000000 * n^22
+   + 435725651868235317320938241439343987241/116473006369350688120825435914240000000 * n^23
+   - 236785644303962703650496588593815148631118759/55962950100345618628294205448074035200000000 * n^24
+   + 29951219608236318375984513968969852637391/119180356695180484115811733824602112000000 * n^25
+   + 62685650245065205952020811520018086774286032497/14257637748641899145916185264924708044800000000 * n^26
+   - 4483003054643316539810052609365683886313161406697/933182192923263190626805875846634536960000000000 * n^27
+   + 1345853871818243074858148169703931833087859724988709/10481502390914092157120283597509399119134720000000000 * n^28
+   + 645835710031983279557286116276652061340439304187459/126360334379353222116394530036641089380679680000000 * n^29
+   - 6417447834385545863906095749619028053009319834823545892863/1194396760656532610281735373146342851007532236800000000000 * n^30;
+alpha[3]
+   = 61/240 * n^3
+   - 103/140 * n^4
+   + 15061/26880 * n^5
+   + 167603/181440 * n^6
+   - 67102379/29030400 * n^7
+   + 79682431/79833600 * n^8
+   + 6304945039/2128896000 * n^9
+   - 6601904925257/1307674368000 * n^10
+   + 35472608886503/41845579776000 * n^11
+   + 7660808256523559/1098446469120000 * n^12
+   - 388334559174821269/43261891706880000 * n^13
+   - 121304505560337904991/236631732163706880000 * n^14
+   + 171473290780515481554677/12620359048731033600000 * n^15
+   - 132727036454031241642633/9465269286548275200000 * n^16
+   - 30639039363651602964664613/7934763925547620761600000 * n^17
+   + 41628755176036445034328803761/1767468664415732524646400000 * n^18
+   - 62731007539014996251923219444381/3110744849371689243377664000000 * n^19
+   - 4253576948330492615223590251863457/425705432636515672956233318400000 * n^20
+   + 21109173608034038907290057857778161/560369142096606397967892480000000 * n^21
+   - 228353389351527744252835451931600005809/8319500454953620580058959708160000000 * n^22
+   - 36528815353507244513448437301156996025493/1863568101909611009933206974627840000000 * n^23
+   + 179949541301186621467483604212502389572317467/3179713073883273785698534400458752000000000 * n^24
+   - 6667459517369124611809567288843679508075480287/186543167001152062094314018160246784000000000 * n^25
+   - 236468538717455606379697014767782772375800752929/7057680450680141777849792338335891456000000000 * n^26
+   + 2724615431989937919395302944576209366322330213709/33653452487089882156338604087632199680000000000 * n^27
+   - 326200170759406656773108233662108528251650506200184011/7290019291116532045176607502113909002731520000000000 * n^28
+   - 36898523581280468039266697831389451828857036025105495411081/698722104984071577014815193290610567839406358528000000000 * n^29
+   + 48301814797856398208935403861888385264392898018206796432963809/432334302458894288277916900848565288850632684339200000000000 * n^30;
+alpha[4]
+   = 49561/161280 * n^4
+   - 179/168 * n^5
+   + 6601661/7257600 * n^6
+   + 97445/49896 * n^7
+   - 40176129013/7664025600 * n^8
+   + 138471097/66528000 * n^9
+   + 48087451385201/5230697472000 * n^10
+   - 634613396309/40864824000 * n^11
+   + 152161926556090753/1124809184378880000 * n^12
+   + 797541596189032241/27161585418240000 * n^13
+   - 670034891213941619/19612057573785600 * n^14
+   - 797738204370016183711/62444484876533760000 * n^15
+   + 1262572420740885661534720343/17264651178664053964800000 * n^16
+   - 1504688538793152003510638173/24548175894662951731200000 * n^17
+   - 4908380662744446707535585282187/97210776542865288855552000000 * n^18
+   + 21617826231307521472044305870999/139740491280368852729856000000 * n^19
+   - 9011412074161616811750466480987610329/96159344783777657891290349568000000 * n^20
+   - 5712764954291035029425456603013754181/42570543263651567295623331840000000 * n^21
+   + 13285505291912233404719867451738427771511/45538318279746133701375358402560000000 * n^22
+   - 179649231017237416866042466928297549711/1455912579616883601510317948928000000 * n^23
+   - 29884145110494866094058551866948880229303499503/101750818364264761142353100814680064000000000 * n^24
+   + 2382017529810135366707938471482990925184741/4716709930568539119450511386869760000000 * n^25
+   - 188545346993373372341522235835513997267194575937/1391079045351448234474741678280697446400000000 * n^26
+   - 77189939882994048469559094011678147843496599936029/135603037409161682387957728833964081152000000000 * n^27
+   + 5055292347375802605991447871089890508241922361424571717527/6177914279257927294560700205929359574176890880000000000 * n^28
+   - 896129405773425784164009625079521008114002654837731749413/8398102223366244916043451842435223171146711040000000000 * n^29
+   - 4583499403987764386036616357058392174411208549700462493009598039/4522881933416124861984361424261913791052772697702400000000000 * n^30;
+alpha[5]
+   = 34729/80640 * n^5
+   - 3418889/1995840 * n^6
+   + 14644087/9123840 * n^7
+   + 2605413599/622702080 * n^8
+   - 31015475399/2583060480 * n^9
+   + 5820486440369/1307674368000 * n^10
+   + 98568244458947/3678732288000 * n^11
+   - 1367520624030470251/29877743960064000 * n^12
+   - 11234223222165655787/1912175613444096000 * n^13
+   + 2982454477844692970369/27248502491578368000 * n^14
+   - 869190895988598534264203/7266267331087564800000 * n^15
+   - 2458295530839889742624897/30213139562662094438400 * n^16
+   + 20076007526718092337920372531/60426279125324188876800000 * n^17
+   - 92612134608258706595931646307/396778679766797097369600000 * n^18
+   - 3111621093870597339292256540131/8985511024872697343508480000 * n^19
+   + 618939899724538734690312503581728709/751244881123262952275705856000000 * n^20
+   - 349880405493459820104679463829848683211/1041726235157591293822312120320000000 * n^21
+   - 207806888296724735724043450497658236815707/199230142473889334943517193011200000000 * n^22
+   + 1022460523953867701806308301182024494003729/579578596287678065290231834214400000000 * n^23
+   - 383432658756943317231248322200166817451364947/1418641217578691381311653809435443200000000 * n^24
+   - 763997490849414433043000164958612268471750563033/295077373256367807312823992362572185600000000 * n^25
+   + 69453259794643484263302719504607020126095692449473/20581646784631654560069473467289409945600000000 * n^26
+   + 3526475778372639978202920400355285382983253400925713433/11591583469104547848231127456777395681361920000000000 * n^27
+   - 3386844879506808385587873157467763778147265832357828657961/599864444526160351145960845888230226510479360000000000 * n^28
+   + 8975715445112376764326365404354369942872021811244023950781587/1522855869837079078109212600761587135034603601920000000000 * n^29
+   + 1141689688674260410162806230731137824563608969465073820136479347/565360241677015607748045178032739223881596587212800000000000 * n^30;
+alpha[6]
+   = 212378941/319334400 * n^6
+   - 30705481/10378368 * n^7
+   + 175214326799/58118860800 * n^8
+   + 870492877/96096000 * n^9
+   - 1328004581729009/47823519744000 * n^10
+   + 3512873113922087/355687428096000 * n^11
+   + 986615629722639449/13133074268160000 * n^12
+   - 186591382609938512501/1419192838103040000 * n^13
+   - 11945326540608489526613/373693748455931904000 * n^14
+   + 4125626927677466366821/10899400996631347200 * n^15
+   - 4011823062707782237989439819/10071046520887364812800000 * n^16
+   - 5594107510292126787316683247/14477129373775586918400000 * n^17
+   + 14982221707493385549304025695646893/11007251005469054245797888000000 * n^18
+   - 7291595279883773582199320279582809/8943391441943606574710784000000 * n^19
+   - 8513492703227656510956084303336491/4584255567495120990240768000000 * n^20
+   + 157105326583313971040653100185655846951/40692431060843409914934067200000000 * n^21
+   - 342420444562433578699362565080425434441037/375021444656732865776032363315200000000 * n^22
+   - 6663996141625951282430738551524458085888493/1050486205771416493338545199513600000000 * n^23
+   + 1065943196304789336567113254479304136821982769941/116477910495934660781377891722067968000000000 * n^24
+   + 282615555043864261481140961100818513817314366357/285856205342106313334298242601241804800000000 * n^25
+   - 2234022131193996792575080782842298020429068641824778623/126453637844776885617066844983026134705766400000000 * n^26
+   + 1670315644839955612203042568472364219380574770260571/89166026685419598832547134282903043702784000000 * n^27
+   + 10801933283402577517707581324454394034794780353978810731521/1182341513848663880519575000591294359498915840000000000 * n^28
+   - 16737951977035205802462496054004751707736362520790525486549/392219059882489460364666706926919763487621120000000000 * n^29
+   + 608596584899951573523771478197765351237552575059720715257651893101/18091527733664499447937445697047655164211090790809600000000000 * n^30;
+alpha[7]
+   = 1522256789/1383782400 * n^7
+   - 16759934899/3113510400 * n^8
+   + 1315149374443/221405184000 * n^9
+   + 71809987837451/3629463552000 * n^10
+   - 52653013293696143/812999835648000 * n^11
+   + 101784256296129577/4455864483840000 * n^12
+   + 4323558791348929159/21064086650880000 * n^13
+   - 4743350772552838010233/12772735542927360000 * n^14
+   - 29903451511253057978977829/239786821925889638400000 * n^15
+   + 15436840428957043227623443109/12408968034664788787200000 * n^16
+   - 510180710084169862809596281619/397086977109273241190400000 * n^17
+   - 25997085578966927070281529664931/16379837805757521199104000000 * n^18
+   + 35427299825029861083061489601504459/6814012527195128818827264000000 * n^19
+   - 41290529970653089580171330206559029/15331528186189039842361344000000 * n^20
+   - 5636751993648050664276890397282425312669/651078896973494558638945075200000000 * n^21
+   + 141025630513942054689154210633777771281593/8496579605504103990238233231360000000 * n^22
+   - 5083353505162393632768455472240415265887349/3625207298348417702501646178713600000000 * n^23
+   - 2146307295003485715426155323634480307223656521293/64478843310249544361119904346144768000000000 * n^24
+   + 2825817217957521232544774598978333849050291610759191/66026335549695533425786782050452242432000000000 * n^25
+   + 1121526321726686366084998741747165637003373989067391/71050078471954976186444471989073608704000000000 * n^26
+   - 24751330931089944559270444413306567745123372815680765867/240606738674941774627508140128468530626560000000000 * n^27
+   + 283315570304624430111229930361091346970544306955451389315961/3103646473852742686363884376552147693684654080000000000 * n^28
+   + 4800340784447363734591990355494651667081994231886256711/55232397096636431665504905041636298326016000000000 * n^29
+   - 5883627608079327862661606773104442557734582970571316091093779/21654584826138278971716016135829556194222643609600000000 * n^30;
+alpha[8]
+   = 1424729850961/743921418240 * n^8
+   - 256783708069/25204608000 * n^9
+   + 2468749292989891/203249958912000 * n^10
+   + 117880637749661/2707556544000 * n^11
+   - 5921832934345276446697/38926432130826240000 * n^12
+   + 58559280970406047561/1064394628577280000 * n^13
+   + 707308930074513293534401/1284572260317265920000 * n^14
+   - 174465694566990976559029/168307400643782400000 * n^15
+   - 4693110873155601006258565965271/11118435359059650753331200000 * n^16
+   + 676391985485095809371733839/171665565696943718400000 * n^17
+   - 2198445417091794111397602386175901/542023723754157974224896000000 * n^18
+   - 53363941504564359044259819052979/8957723800023644405760000000 * n^19
+   + 3980756637943323854029497343795084553/210875756104775565551075328000000 * n^20
+   - 57605246865079073769101876100784936151/6705002845252607315528908800000000 * n^21
+   - 131556990309544385502695007449463535506251/3577507202317517469573992939520000000 * n^22
+   + 16563201841502261061487372612686514822354259/246931844784963022216298653286400000000 * n^23
+   + 3716622905750730591889081511594229480962791354087/1091129684472639151636059353184731136000000000 * n^24
+   - 2213908725034918327552841712951816333387504312678259/14018459110275430350511715674314768384000000000 * n^25
+   + 17011573703835625757730804229750060144161108086423592979/91512501071878009328140479921926808010752000000000 * n^26
+   + 682892898514410238829628389193295165408986121549166351/5831466588978968792019684149065332817920000000000 * n^27
+   - 155436494065578924089463413379949231968540857163058763243101/289553023799672787066018367491745557428305920000000000 * n^28
+   + 165551112077463450636444122527612450331221233114708176183743/410124712616255283555227578330105230951186432000000000 * n^29
+   + 1403124695221106030113716236806514839242351489435235474477081785401/2304047825501112882590584116852264779065289280061440000000000 * n^30;
+alpha[9]
+   = 21091646195357/6080126976000 * n^9
+   - 67196182138355857/3379030566912000 * n^10
+   + 395018924202597949/15446996877312000 * n^11
+   + 91220875613845291081/946128558735360000 * n^12
+   - 4988552993547340999703/13876552194785280000 * n^13
+   + 2274808037645071351151/16571805601849344000 * n^14
+   + 535711648203373741428799361/367673126953030778880000 * n^15
+   - 27678709003769097826752781127/9651419582517057945600000 * n^16
+   - 5280108162364963042999830777751/4014990546327096105369600000 * n^17
+   + 1174431699627195631670489145666649/96789950670385352540160000000 * n^18
+   - 1183738252014628519027860764867029/93856921862191857008640000000 * n^19
+   - 40137685403486395923628481749776837043/1911061539699528562806620160000000 * n^20
+   + 287333201658715623813482736998287053515959/4357220310514925123199093964800000000 * n^21
+   - 106257838315599820564882015419176890518173209/3950909516559408355460778452582400000000 * n^22
+   - 90892763520143573996692682431035087078662489897/622420206916436023998744174683750400000000 * n^23
+   + 201524866709123266853440470935579547318921733655003/778803283904190575028428648573042688000000000 * n^24
+   + 10814621264427896099430746759393142670689600538379/246140297135151589144787325968764108800000000 * n^25
+   - 530693286808080774017187055905756612819533423821542721/762604175598983411067837332682723400089600000000 * n^26
+   + 528646912311960943475639104830106896257711233429178692933/691427785876411626034839181632335882747904000000000 * n^27
+   + 1238335239482617295952056865714588188866564716732256454849533/1822776500516690149134344792578245470894161920000000000 * n^28
+   - 65933487212841390272205814518074033193900839255445948294377851/25518871007233662087880827096095436592518266880000000000 * n^29
+   + 162727413247772587683519571850133568153397325055616238461382829/98282138338670185068189671924151343633347379200000000000 * n^30;
+alpha[10]
+   = 77911515623232821/12014330904576000 * n^10
+   - 268897530802721453/6758061133824000 * n^11
+   + 8257746726303249815683/149866763703681024000 * n^12
+   + 323404376453879141969/1506527781986304000 * n^13
+   - 565045774309646240886321061/661811628515455401984000 * n^14
+   + 606966182513981199158868163/1723467782592331776000000 * n^15
+   + 75743290339815584481785361977/19854348855463662059520000 * n^16
+   - 22241327027192487028642722150343/2823040227886239449088000000 * n^17
+   - 1526410847130700516846978043440307/394199071821205799436288000000 * n^18
+   + 1980853898587532814589028918136701/54202372375415797422489600000 * n^19
+   - 32336501755791644291373778373511296903/833917762777976100133797888000000 * n^20
+   - 9178264588912399043908657569412179727459/129878682332656421941511454720000000 * n^21
+   + 1806166894952081193938559978698482758385827197/8083379310603065246736937333555200000000 * n^22
+   - 361654991248988355171855093660297726396047881/4322362548030805722213501213081600000000 * n^23
+   - 105020035995730778911321036642305474913412418767240671/190651043899745852766959333170680850022400000000 * n^24
+   + 2294386994267351811538453796616269131419043757692511/2383138048746823159586991664633510625280000000 * n^25
+   + 2743769449547669368889674700489658732983220398593193929/10458571551071772494644626276791635201228800000000 * n^26
+   - 23157882459582328183252760859500524302121767786137065570859/7994633774196009426027828037623883644272640000000000 * n^27
+   + 89430614800491857673988760128056842290692364119137870498038657/29634817943884252747216444369659216688085729280000000000 * n^28
+   + 2567130086431563482452599790796650371294900574502194735538864809/746426976961584616070514192560791520331159306240000000000 * n^29
+   - 509038828002331582891050965787949294310918940649244811719555481648577/43567449791293770870803772391388279458689106386616320000000000 * n^30;
+alpha[11]
+   = 12809767642647461/1029799791820800 * n^11
+   - 5303630969873795374429/65282870552739840000 * n^12
+   + 505329992704194411750631/4178103715375349760000 * n^13
+   + 902773043678795981447423/1880146671918907392000 * n^14
+   - 52457275102567933937177869/25762220537492275200000 * n^15
+   + 67595745292234822704267032563/73325720204837388288000000 * n^16
+   + 81338369151994478217697814085661/8212480662941787488256000000 * n^17
+   - 19217318226298386878750945280512161/893107272094919389347840000000 * n^18
+   - 1873245185945872710662470867765863817/171476596242224522754785280000000 * n^19
+   + 476337982883129731566963871315011795997/4406497269224532801843363840000000 * n^20
+   - 8440994919935476843536233253371860518791717/71444009058360425160553739059200000000 * n^21
+   - 33526203318350561460792162793779755990401717/146245349369463351503464326758400000000 * n^22
+   + 710399978033562118273811779126576411439704335403/961922137961764764361695542693068800000000 * n^23
+   - 34930525249908548784563565768397098265832106510929/133733897236073129045285727532744704000000000 * n^24
+   - 23048480004933480948529688590232835511983254849209969/11554608721196718349512686858829142425600000000 * n^25
+   + 3343638043167525209592261539785084441516908110518987/960960215823802999597333847150375731200000000 * n^26
+   + 3245082101525034287044377973345367353808255099669736817511/2599324777920413759906374035762203880062976000000000 * n^27
+   - 1563650841338021630530049879900135725592709642522865259185153573/135713995811197202921911671374689367332938055680000000000 * n^28
+   + 100228142507845651554674218817828912081709008921929406668291104191/8685695731916620987002346967980119509308035563520000000000 * n^29
+   + 1348681612012517778664036601950009019623074500848299186242899657141/84859828283817488489232796254889378316274578227200000000000 * n^30;
+alpha[12]
+   = 2240624428311897034834681/91918281738257694720000 * n^12
+   - 1694308924283012695547/10043518546575360000 * n^13
+   + 2898270966023179721324929303/10754438963376150282240000 * n^14
+   + 5049523426723058614103389/4683336365740032000000 * n^15
+   - 293488823111024724225343654073741/60224858194906441580544000000 * n^16
+   + 15397766080743841984369762728863/6297551277592380309504000000 * n^17
+   + 5863952550107110495571900519504737/229656155681550700118016000000 * n^18
+   - 1430933931370883795713846515020911423/24472734089815246481326080000000 * n^19
+   - 1870907814706500734631241404968509423277611/62870727971357174141287290372096000000 * n^20
+   + 85087672018039782610988182307863449111159229/270147659251925357638343825817600000000 * n^21
+   - 17181221423420856035067255437638564537594025459/48096106898088238218084777134653440000000 * n^22
+   - 29840743030792811125826874514052113793829046631/41332591865544579718666605350092800000000 * n^23
+   + 233752394874908577315877184530185132629657928559209871/97769766102433770649722734959323512832000000000 * n^24
+   - 201646398092527015113891771761912798737265288328930229/244933632787867935846440809976221925376000000000 * n^25
+   - 1478405663522054837879701822965363491041325865689756503513/211622658728717896571324859819455743524864000000000 * n^26
+   + 321386243763712289433592425205485189709512429739435078423/26177282004203385643588361566208718274560000000000 * n^27
+   + 2818199590151532790384019625468928958215697625600921714777625549/535252958269371601439920541444153022982568017920000000000 * n^28
+   - 11378071070442404926793965546213173776855685042822972281764801951/257713735203578688495924900168357493335389739417600000000 * n^29
+   + 26391837116130703226086300212905604518448450453630780847639554556493/613134590884340253673783066835327045013588110475264000000000 * n^30;
+alpha[13]
+   = 1987049611350093295679/40852569661447864320 * n^13
+   - 49990807275475500894703/140691247558557696000 * n^14
+   + 620844046443235040902108541/1021314241536196608000000 * n^15
+   + 30593679475357306372670316797813/12595102555184760619008000000 * n^16
+   - 785749129848932618333134357025453/67173880294318723301376000000 * n^17
+   + 275581708051003997988541817255279573/42168403354758578552438784000000 * n^18
+   + 642193387846955979009281483738217042761/9813737508016541917658480640000000 * n^19
+   - 10379707152495210640484367519099555203413/65622913178605350033605787648000000 * n^20
+   - 28662530127283669901885121584468088960326233/364665822910787579541585710284800000000 * n^21
+   + 4609055620394562855489493272499773205216196129/5087088229605486734605120658472960000000 * n^22
+   - 873057563036453343326459102080494704028393390097/813934116736877877536819305355673600000000 * n^23
+   - 19289084079854993646765928794776984023563835229561783/8695868619687619024133993253593677824000000000 * n^24
+   + 1182490481385670104330958793922877551368861956689593353/155502591787355069608043173476028121088000000000 * n^25
+   - 293417158736416271896554762676460700877470285796817656847/111689736551267778745977009349157197971456000000000 * n^26
+   - 39859038349761443605955883817872550236932196068750468867903/1675346048269016681189655140237357969571840000000000 * n^27
+   + 26244234609643418748414712844720424679053976070350152552610637/618202691811267155358982746747585090772008960000000000 * n^28
+   + 2077245025145718452430941958359096421872386057259172217716184873/101286329026358010734015733227124341272085948006400000000 * n^29
+   - 191207856187024789574592797220884621637003872633248259491607835405551/1166134827662716367083406640577189322150843540884684800000000 * n^30;
+alpha[14]
+   = 10469176753142937388346729/106216681119764447232000 * n^14
+   - 2524263545672345614192283257/3332037713011841433600000 * n^15
+   + 28798233421533175181823218687239/20791915329193890545664000000 * n^16
+   + 13912456133127892258104161571997/2535377787082646618112000000 * n^17
+   - 5642793384271167571209335562965961618499/200480637663766499175023247360000000 * n^18
+   + 2416612854960792848747357744110015450361/137830438393839468182828482560000000 * n^19
+   + 37531174405336506824031127490381559959133931/224939275458746012074376083537920000000 * n^20
+   - 2616330145733138560090205392154735810050979/6139719528452849037235086950400000000 * n^21
+   - 68829610700469773329308127037458237442895425239/341327210244497174450924224826572800000000 * n^22
+   + 63069353283833076130495586379466422512525299809581/24468894384402391193450630367254937600000000 * n^23
+   - 714098347019839680389819042844541592537678056730181857/223156316785749807684269748949365030912000000000 * n^24
+   - 2661752462851196865891091928419385880894607083642023593/398891916254527781235632176246989992755200000000 * n^25
+   + 5961320530838574206567558505826389702787945152445692779/250285123924409588226279012547130975846400000000 * n^26
+   - 94590092745211556049112510107228668331259876881195561421/11150842204387935702723354017813583888384000000000 * n^27
+   - 17802000569076164486140040573046212865608178116650965279535007359/225025779819301244550669719816120973041011261440000000000 * n^28
+   + 6231272989222159551881242282050573601231377672788471696790420989/43196913090312292480708919428987508217694126080000000000 * n^29
+   + 422268052780700950950541531621666843181077037988763165839750231840343627/5605286734647678672031164692522288170338508448622182400000000000 * n^30;
+alpha[15]
+   = 100206984674719544740861653301/495045603076045012992000000 * n^15
+   - 36822741875265270244508239254871/22559228132175371242045440000 * n^16
+   + 179792631498449481362046446075850677/56496153931013103632252928000000 * n^17
+   + 1198746750769645158859022771229488225047/96481306875687627727979937792000000 * n^18
+   - 712415136407467601227112286139274196716669/10497166188074813896804217231769600000 * n^19
+   + 4324780012493436320334302458159540323213361/91850204145654621597036900777984000000 * n^20
+   + 1555975364258875353541471977713778721787643043/3674008165826184863881476031119360000000 * n^21
+   - 1749084094448959255650030230541491009564819115959/1529305899025149449590664397953433600000000 * n^22
+   - 3736902111701391887100479481424584566863791566838269/7438543892858326922808991631645501030400000000 * n^23
+   + 160288079478771431803467565454719360005157928068793941/22073070464677426629639725167817628057600000000 * n^24
+   - 205505625990694957725950514798454096070237493947357149/21661039816003447999219783631351699000524800000 * n^25
+   - 12495724210779737453458596500764106334450954721020624496477/634054042883350928573315637689830862330265600000000 * n^26
+   + 5055693252244555496228110569294083881781629217112771929053811/68689187979029683928775860749731676752445440000000000 * n^27
+   - 3183992173345900271685562628167128755396195058359564971811781053/115191768240832779948557118477300021913851002880000000000 * n^28
+   - 5698640861911756799224037518645406078168295920245835514736969952989/22116819502239893750122966747641604207459392552960000000000 * n^29
+   + 142278670225215087706896520822001994673082990276889571404960221414791/294749152212543199400677229925300609918641519984640000000000 * n^30;
+alpha[16]
+   = 7712781743942384637654934879373/18338215136419449195724800000 * n^16
+   - 2402063456298622602221186822696471/676776843965261137261363200000 * n^17
+   + 7668107436276322919714287100049904599403/1041385534531231537381370757120000000 * n^18
+   + 361303680860095904135414295125524607/12819051189903224347361280000000 * n^19
+   - 7227390188103426658110578949868094476645931431/44088097989914218366577712373432320000000 * n^20
+   + 12901408373363616730918554960524450439118853/102117113984051111751513381273600000000 * n^21
+   + 497747383538267321534956030212997835594308172021801/464908993303645432675561976977843814400000000 * n^22
+   - 252499664598382602456303781455085911751340300461/82547761595107498699496089662259200000000 * n^23
+   - 131281534185888595153825331846748525760537617955805958541/108305199080017239996098918156758495002624000000000 * n^24
+   + 1426262784250791324747799093000080956187589936714029719/70320626514158153080237367679905483980800000000 * n^25
+   - 23170473116883805794188278794166757632616659619691851519/828740273599081251646377980227632916070400000000 * n^26
+   - 44044500279817699335584829646278793104954720796019992410409/769175802890176148160771357353766171967488000000000 * n^27
+   + 62420418657558519149643437875852556019705678659537976085016650961/277762254345241993722109472497853742008909168640000000000 * n^28
+   - 109511822578379305705407097075954475716527637153298910483976431823/1209513566528744189459849744011650230095435530240000000000 * n^29
+   - 168398596910687560076596170666837371522448204565539850254693515405079907/204359412200696618251136212748208422876924787189350400000000000 * n^30;
+alpha[17]
+   = 136336614071421552738346511544707/154416107000986498341273600000 * n^17
+   - 27801197719443334715141091692509100501/3573381736136578804739997696000000 * n^18
+   + 576392411336288932474450636964598560303/33631828104814859338729390080000000 * n^19
+   + 556540535711605007979630683151193569919453/8691707297670641941407583961088000000 * n^20
+   - 301243011881263087198414763542811432614781470369/759655217816414105679022838199091200000000 * n^21
+   + 989789926631181163755007364622407618669102051/2925597777633984541291825940398080000000 * n^22
+   + 2103270728132227977532547099652140536893417990637/779966854656425178023381737616179200000000 * n^23
+   - 149750803535199564120198336297627481136417850061461067253/18366093042521305863309053676398844051456000000000 * n^24
+   - 827633945205212562322541676028753996760694367358637422131/293857488680340893812944858822381504823296000000000 * n^25
+   + 10871559511195696848205970321319912766271482873182818466013/193406204284510078070764728510649051643904000000000 * n^26
+   - 1185910777714920025608418139877185236744968114328617926870881/14478603348520962788908637314894422060564480000000000 * n^27
+   - 1794514783827843337644294958827668476221297946256830260008605439/10945824131481847868414929810060183077786746880000000000 * n^28
+   + 128661408285411985453738219706261617148768669184661116871488103229/189555919076956236027138549181277523417671663616000000000 * n^29
+   - 1855414703915628112302305459595288498254055876861869243258846990726549/6247526147877631344159452657828430574942185943203840000000000 * n^30;
+alpha[18]
+   = 67752028110741493306780180177177973987/36222105548912401300221591552000000 * n^18
+   - 5545658735018547601364002065686581343/322869656256540697864175616000000 * n^19
+   + 6903145472582253547590916629983711429839564343/172188516038387197287245176658460672000000 * n^20
+   + 2594359997714507009889054556821919665165991039/17814495239540271366199495675084800000000 * n^21
+   - 2653661574489733699865151526666294107005175728022119/2762887731633092857043339748896900382720000000 * n^22
+   + 223899545504288463905906021765274294443981546647858717/247796493430843015616074533729190753075200000000 * n^23
+   + 144506895392063363464005464205241390539753389057581011317/21348620972503398268461805982822587957248000000000 * n^24
+   - 199508703723852397940714471767792646467211904185547826559/9208240064528857740794868475615606996992000000000 * n^25
+   - 123747223374921892225259794899435553979183207374624389411529/19856370306543034681931845460426635968774144000000000 * n^26
+   + 74365730590824979951370872254622112553384627249684845833999/480734876806360092600482098346103857479680000000000 * n^27
+   - 453806568576657850636481186180714169477831867390896126354437393759/1902140993515290007355661135881569592628719124480000000000 * n^28
+   - 129377367350744075863584786744687343612005128384626716428469495967/279376958422558219830362729332605533917343121408000000000 * n^29
+   + 9812276168495581890730160638055577559800537496316269869797927437190396177/4833641563655724730627900082998991975493047684412997632000000000 * n^30;
+alpha[19]
+   = 471824901393496747102665687245792177081/118103493571358059411833618432000000 * n^19
+   - 50561675675044750669650971499055765086319/1324934718670261598085912408883200000 * n^20
+   + 67251111238362727892454291277989954473027123753/714019364752482795768480796350873600000000 * n^21
+   + 240180124848943302649869868199872368699919588928959/724551150382581917006065888097048985600000000 * n^22
+   - 485940263706654462038872744309833664639315267073048459/208670731310183592097746975771950107852800000000 * n^23
+   + 1699999199365185300098132938338874634674993023922086094213/706611263899109188740995696707766052716544000000000 * n^24
+   + 18316002921325135783401359443916180813949011876130693396319/1081422456054288845377523848874494132853145600000000 * n^25
+   - 1070798289679403964467272203329695220087675802370874334174677/18654537366936482582762286393085023791716761600000000 * n^26
+   - 66905570444410496337928253364613460714163911189816744933/5208993291563945942641955456499557439897600000000 * n^27
+   + 639717024183652714810791734101835747576462370463927529907834770743/1512416617024375325397452369319368303913436446720000000000 * n^28
+   - 121315610544001063260669429484399550327396846073348792749387872304069/175562790458797122792695361672570558744154047774720000000000 * n^29
+   - 2310657553908327208643487025983368468395539176694805984465325989447845451/1788765381287069184854074866241403280404499554264678400000000000 * n^30;
+alpha[20]
+   = 202399116895368048088234707551711981612353729/23547147492429018432443784842182656000000 * n^20
+   - 3365095273417630466576291762515903066833421003/39463570282275703540635396955176960000000 * n^21
+   + 2717825461890719651841152458000965236132994648134207/12236863873128050153880223887861271756800000000 * n^22
+   + 167575736694631175164505551372730340638238831166089517/221984358698463534822733436465733382963200000000 * n^23
+   - 1780457197357285934359849612457829809553519546045920132315603/315054408863816150286651947972102624037883084800000000 * n^24
+   + 31433611667605561414091907198192986558131456317053607536179/4922725138497127348228936687064103500591923200000000 * n^25
+   + 81043708724580147220822100302291795209006507032171545390245907/1918125371612057150274616271477213034583582310400000000 * n^26
+   - 1577108197581107731425828348589622362098940512581130343622369/10399988029071674998896733424633161124413440000000000 * n^27
+   - 5514916654831738928837454570878277449201710700255298388849026950313581/235404621606609970647462666379821037767518556059074560000000000 * n^28
+   + 2277087194186373183792618936007821692864753094815436081352010122233691/1980567729863305041505094548868686615832487851458560000000000 * n^29
+   - 143439353635410339941300281453638717803865413230045426199413290694870693/72062639267329582851264081544843174826791394711961600000000000 * n^30;
+alpha[21]
+   = 7593597428771861155598510033855442354788700917369/407895462437601671796007462928709058560000000 * n^21
+   - 45805642625336613066067381416091711616993807717957/239175066611139162098568012353652129792000000 * n^22
+   + 1990618787705329951428358040285346629497792311202946171/3788533055120444327641317315681849735905280000000 * n^23
+   + 930144112851858298709480062321695584642393218056377949791/540958806428255752552630405171879505559552000000000 * n^24
+   - 752902102022542070422923926458337877174355061465216481203/54858440486545321043175068539316832105922560000000 * n^25
+   + 24990276016004332532181513229852654837023995611735929270423877/1479326420770302763580519691998352523776334233600000000 * n^26
+   + 1273703517934435922639076948106483178914355724092343511679304023/12119166110998363411723475629310149719087906816000000000 * n^27
+   - 387147736345336231749751695652681175080211230836264638568453074861881/968987437728821283747116150252959580864281690767360000000000 * n^28
+   - 26472588474688318840378923145456844687860042284441254323438583079847087/823916175623134897266119332329373632186314946206760960000000000 * n^29
+   + 489733176366105123100315909250683812497390264686335645655218001765029594209/157573968587924549102145322307992707155632733462043033600000000000 * n^30;
+alpha[22]
+   = 2439323846938124516749950544509820877337338687175781/60135445319372132184782814534632535490560000000 * n^22
+   - 34073601205416895076590748626649694428085903921401/78848923058617306186341102973731471360000000 * n^23
+   + 114050797567384263375075461734480044074661222373269471907217/91493073281158730512537813173716671122112512000000000 * n^24
+   + 137273833008580661426413574856400098350445610433824603561993/35055769925661361419206064286668615837548544000000000 * n^25
+   - 45059179088074031893922072777375249940924991766835661888221084641/1351036625382288628601140188130286029427907231744000000000 * n^26
+   + 206898006671113514273360240583654940027344524273411544491451421031/4644188399751617160816419396697858226158431109120000000000 * n^27
+   + 2440824507911814657571898799746797396009020312235697337059397039885469/9362683813899260196205901503742882183935397115985920000000000 * n^28
+   - 696311481675417712820466561405304148537325788366564328711011454870887/663190103484530930564584689848454154695423962382336000000000 * n^29
+   - 6924245472208385163375477930704649011923426449727911613839020300441563381/3208778996699554454443686563362760582078339299590694502400000000000 * n^30;
+alpha[23]
+   = 7474565215206746325580483864591180104671541156913/84105517929191793265430509838646902784000000 * n^23
+   - 16782060552985470049913293468183373087712600299046298630661/17138376408101110027167409206815767742801510400000000 * n^24
+   + 6503735528674785551831538506800050725715065676154256817241867/2193712180236942083477428378472418271078593331200000000 * n^25
+   + 43999179965065941867057377378097709899255133565469268235339039/4935852405533119687824213851562941109926834995200000000 * n^26
+   - 320196265269217417773345496488501328010142269670188589023798556437/3948681924426495750259371081250352887941467996160000000000 * n^27
+   + 123832182350468652680214620379816199199842965715033754557125222024173/1057259585265194237131946607004781985746328055971840000000000 * n^28
+   + 223366335034930390488779600823060385213901770612295015887755022091478569/346358240132877632084425708454766578530497071136374784000000000 * n^29
+   - 5683975145729510214638167363294386038771152028333168572495195332205249204543/2065161006792282881303388286661545724488088786650634649600000000000 * n^30;
+alpha[24]
+   = 39494178711472476796003427487122912293893944185276935843160849/201821520581798671679923410819462480939230586470400000000 * n^24
+   - 76348957557716638341723622087037389639067389665177807014579/34276752816202220054334818413631535485603020800000000 * n^25
+   + 4701748482852793217057834734347787548724108110072753226999643/665345672247687928615132123580645541557903032320000000 * n^26
+   + 679403733200977595115362734887022205196905112342852746889825923/33505525877837670103112284999324825937176952832000000000 * n^27
+   - 1551880057739501281928982393705767292741074023417989103820403149655498881/7867890886969072136238806216750253141927340875196661760000000000 * n^28
+   + 40509752985115825377187326802004288703338863504362380792112685460851409119/131940842100618072972160918314487643508961228036012769280000000000 * n^29
+   + 930119149078652355869135614976346780332901622265792177140238904719349791424829/584599423461200077168959145762652943547397441144179654656000000000000 * n^30;
+alpha[25]
+   = 8740098043964194699013511747075939410275887707894105297617/20190228149439643025202422050766554715809382400000000 * n^25
+   - 560970870667805373435462259322216583674714967329353232405989/110325175245152335101998949063117245411386982400000000 * n^26
+   + 37599914809270379883026138747614917048973558104768871252051312999/2227899902526348973090063625929131283095402577920000000000 * n^27
+   + 62112464645162326712991624734748037976412787406014636486771832698244341/1348054580849226799204709254809580010308671550814945280000000000 * n^28
+   - 337728148943314333204134420372420356729249456410758236907291010482662683997/703684491203296389184858231010600765381126549525401436160000000000 * n^29
+   + 9318731629311992919328873307373838077895502043140333484055412345740103859247/11610794104854390421550160811674912628788588067169123696640000000000 * n^30;
+alpha[26]
+   = 981053882391585426104317525561993317308039476510023968359/1020137843340108279168122377301889080377737216000000 * n^26
+   - 804535427693867223518181752525105894684868959294094526147221449/69088598041109651665505696484929975427905303347200000000 * n^27
+   + 1850220524749669257030657681847129002392911081379585567459419325323237/45823979891138552002269970273380595222214183119277260800000000 * n^28
+   + 4964057679773584492591452849477564911024827566211763096636472333282359/47482084426673170660246844197746340444070617376882688000000000 * n^29
+   - 4451537474316831472817032033079424859226655324781227836739835901181143999400077/3810722167747081984508770727934330298679331468199097008128000000000000 * n^30;
+alpha[27]
+   = 219796242799180006558858282267295702822729406335181729959735197/102474606956438773279014366383959253494644552499200000000 * n^27
+   - 1991862922927036259097631233677478784353889919238496520767270708775317/74463967323100147003688701694243467236098047568825548800000000 * n^28
+   + 6916252182087743491582730686935092456222021350509646835638283740939656053/71485408630176141123541153626473728546654125666072526848000000000 * n^29
+   + 4178831185325638216557225776185254600956561244767568179257086044280129070299149/17648407039378673440756244433745867195758653862097068018892800000000000 * n^30;
+alpha[28]
+   = 215719482708468448409738976464239418783926747463596671692384366197697/44929100822557395094481533143462725012487441496072519680000000 * n^28
+   - 278069851593691889742988308687280247895937313870882245850732354899927/4512967716551524060829618284499604074915033185989427200000000 * n^29
+   + 10456333895529602975165309445620837322364136333954987435106098028819923116751/45038779803274177894987830782750235833811918467990185574400000000000 * n^30;
+alpha[29]
+   = 27323334865827529185376977771399500293634233810796735936299404584293/2533595911046469648185048861473461936794404595643187200000000 * n^29
+   - 52262641147658201267292303345886757439639836488719164781023668387608491790413/367286072424459165080994152236686477795330009828475136901120000000000 * n^30;
+alpha[30]
+   = 138503251037159093918050273397984791664345186887370360837473296764761046660471/5699690220901306106942517947753261728997763363224497107763200000000000 * n^30;
+
+Krueger, p. 18, Eq. (26*)
+beta[1]
+   = 1/2 * n
+   - 2/3 * n^2
+   + 37/96 * n^3
+   - 1/360 * n^4
+   - 81/512 * n^5
+   + 96199/604800 * n^6
+   - 5406467/38707200 * n^7
+   + 7944359/67737600 * n^8
+   - 7378753979/97542144000 * n^9
+   + 25123531261/804722688000 * n^10
+   - 9280258847/6437781504000 * n^11
+   - 1628053924171/99584432640000 * n^12
+   + 171201246542931467/6186450514083840000 * n^13
+   - 5718183564876629179/180953677536952320000 * n^14
+   + 644468750008654952687/23162070724729896960000 * n^15
+   - 212771552062192641437497/10336074060910716518400000 * n^16
+   + 490410367787088228908921/33923525122989018316800000 * n^17
+   - 17113867364186490261786648857/1602504922403597489012736000000 * n^18
+   + 395980314414341959891853827859/51280157516915119648407552000000 * n^19
+   - 19481411440513215539899023606263/5115195712312283184928653312000000 * n^20
+   - 135570116300721989060886034459593007/108032933444035420865693157949440000000 * n^21
+   + 11080348232555971953029572642513796537/1863568101909611009933206974627840000000 * n^22
+   - 250868515348150853528597220771122960249/29817089630553776158931311594045440000000 * n^23
+   + 961059950401200029458005065879527529605493/118813647905349159549301543874372567040000000 * n^24
+   - 4018789334131226157542250009395235956239124497/659019700381670004966792563356519838515200000000 * n^25
+   + 2391844895236730308938558863293259934461956219/570305509945675965836647410596988321792000000000 * n^26
+   - 1573270095968198180509050797007198841027307027401/474494184274802403576090645616694283730944000000000 * n^27
+   + 2061253330556904530218418240686914940538061818436749/670816153018501898055698150240601543624622080000000000 * n^28
+   - 2710857345655764890042245118743890636519888766789337/1100826507517541576296530297830730738255790080000000000 * n^29
+   + 455119247458368582897233478322666951033511063680152518561/460521387375865357577946377396084237894154190848000000000000 * n^30;
+beta[2]
+   = 1/48 * n^2
+   + 1/15 * n^3
+   - 437/1440 * n^4
+   + 46/105 * n^5
+   - 1118711/3870720 * n^6
+   + 51841/1209600 * n^7
+   + 24749483/348364800 * n^8
+   - 115295683/1397088000 * n^9
+   + 5487737251099/51502252032000 * n^10
+   - 5845886411021/41845579776000 * n^11
+   + 6339155669701909/46867049349120000 * n^12
+   - 3825933403819459/36248733480960000 * n^13
+   + 1576089193435485637/19579096132485120000 * n^14
+   - 796020536210393262877/13672055636125286400000 * n^15
+   + 2472784862443506933077081/82688592487285732147200000 * n^16
+   - 1031884087773262337231/259769057086380441600000 * n^17
+   - 3043575175820301204619799099/301647985393618350872985600000 * n^18
+   + 1240087853302816440305681741/76309758209695118524416000000 * n^19
+   - 162802157643900956474519187209659/7107429831844435583269286707200000 * n^20
+   + 12816799444007020333086273455167501/404420161004689889308421652480000000 * n^21
+   - 8434093090274924630876141677262180833/219243306107013059992141997015040000000 * n^22
+   + 4577121708190925068719017020286339507/116473006369350688120825435914240000000 * n^23
+   - 3765607524414111763649498176471170518355049/111925900200691237256588410896148070400000000 * n^24
+   + 1131301743028144854789954188008691387730629/46411581213027015448945915575926784000000000 * n^25
+   - 460026540064989874633511523684594620842417879/29318721223109392213055526792924758016000000000 * n^26
+   + 604271886240145180390884566623502375996747842517/59723660347088844200115576054184610365440000000000 * n^27
+   - 935636652514721565914189601103950324131311023910747/134163230603700379611139630048120308724924416000000000 * n^28
+   + 13991916555135286064709925920796585055379160510097/3716480422922153591658662648136502628843520000000000 * n^29
+   + 551187495544637127580837409130179426064488050021383801799/558977683987257261611852154632488454271525086822400000000000 * n^30;
+beta[3]
+   = 17/480 * n^3
+   - 37/840 * n^4
+   - 209/4480 * n^5
+   + 5569/90720 * n^6
+   + 9261899/58060800 * n^7
+   - 6457463/17740800 * n^8
+   + 2473691167/9289728000 * n^9
+   - 852549456029/20922789888000 * n^10
+   - 2673218294321/191294078976000 * n^11
+   - 1619588070701683/35150287011840000 * n^12
+   + 799518679601909/34085126799360000 * n^13
+   + 29003748875152374779/473263464327413760000 * n^14
+   - 1018892483578870404121/11218096932205363200000 * n^15
+   + 481644368636077473383677/6234457370073130598400000 * n^16
+   - 723295134325860384163989341/8379110705378287524249600000 * n^17
+   + 18449123896439664237491327/175105254678958021017600000 * n^18
+   - 9545551652020360064000248463489/99543835179894055788085248000000 * n^19
+   + 1624734283470807394728668252816369/22704289740614169224332443648000000 * n^20
+   - 2700625783869782207997557873010304073/43592236301979204910718291804160000000 * n^21
+   + 115833584495328576175632817607784109681/1863568101909611009933206974627840000000 * n^22
+   - 80331805706465175347621476210358062805003/1550488660788796360264428202890362880000000 * n^23
+   + 521874000525184838244754419829212765128887/18500148793502683844064200148123648000000000 * n^24
+   - 381143434387098814023111575357004480524467771/143265152256884783688433165947069530112000000000 * n^25
+   - 3524924454475074760191004058569251720124879785757/215005177249519839120416073795064597315584000000000 * n^26
+   + 38831080481512203835364300143596202089804731885903/1433367848330132260802773825300430648770560000000000 * n^27
+   - 8744571180068348778510935237066929988537179992179467/279936740778874830534781728081174105704890368000000000 * n^28
+   + 924277626444402405054252433779774364643696474585704740403/27948884199362863080592607731624422713576254341120000000000 * n^29
+   - 126306569153879537470902727265265301493989903234598946584327/3458674419671154306223335206788522310805061474713600000000000 * n^30;
+beta[4]
+   = 4397/161280 * n^4
+   - 11/504 * n^5
+   - 830251/7257600 * n^6
+   + 466511/2494800 * n^7
+   + 324154477/7664025600 * n^8
+   - 937932223/3891888000 * n^9
+   - 89112264211/5230697472000 * n^10
+   + 12003335387/32691859200 * n^11
+   - 537877266968267441/2249618368757760000 * n^12
+   - 63357208977773989/597554879201280000 * n^13
+   + 887398150788484759/8825425908203520000 * n^14
+   + 2384026112354539199/18578524426076160000 * n^15
+   - 367013781018742745596861/2656100181332931379200000 * n^16
+   - 116368807092865455691/7292981549216563200000 * n^17
+   + 13509292858664313453220237223/388843106171461155422208000000 * n^18
+   + 12614093798238667596568634093/279480982560737705459712000000 * n^19
+   - 42830094113304502651660706556769109/1538549516540442526260645593088000000 * n^20
+   - 1668094745107834360626912832785989/31436708871619618925998768128000000 * n^21
+   + 324878397379290831787720619212058141009/5100291647331566974554040141086720000000 * n^22
+   - 83347374922531563076841834327924641529/3028298165603117891141461333770240000000 * n^23
+   + 61194082538219225945927920756047806920251343/1628013093828236178277649613034881024000000000 * n^24
+   - 98047007466353520331537046826194116951241/1156259299593917740254012509257728000000000 * n^25
+   + 1493069566723126691789414021618816357112902099/14163713916305654751015551633403464908800000000 * n^26
+   - 428919341299773794465717432164006775623731672469/4733778760465280548815978897476564287488000000000 * n^27
+   + 17024219401413321980501656137013731587720179574723869633/238879352131306522056347074629268570201506447360000000000 * n^28
+   - 1999391624298578429684484594521785906724957573844027707/33592408893464979664173807369740892684586844160000000000 * n^29
+   + 11744245649394563850890264467671937396646650052934109768653353/235189860537638492823186794061619517134744180280524800000000000 * n^30;
+beta[5]
+   = 4583/161280 * n^5
+   - 108847/3991680 * n^6
+   - 8005831/63866880 * n^7
+   + 22894433/124540416 * n^8
+   + 112731569449/557941063680 * n^9
+   - 5391039814733/10461394944000 * n^10
+   + 4863559943251/167382319104000 * n^11
+   + 37588208648677/67596705792000 * n^12
+   - 940430600213372183/7648702453776384000 * n^13
+   - 3291872437542629663/5190190950776832000 * n^14
+   + 189272332747364970877559/523171247838304665600000 * n^15
+   + 502532269819919668347149/1208525582506483777536000 * n^16
+   - 949451228897166389540897/2708180577045341798400000 * n^17
+   - 1784576325496520253476120683753/7154713153554885259768627200000 * n^18
+   + 524830142025358848902662672939/2071953130441233740385484800000 * n^19
+   + 2016209403231616185652826723458583/12019918097972207236411293696000000 * n^20
+   - 16096897691007333935470338878197156361/100005718575128764206941963550720000000 * n^21
+   - 76250060255013791707276485885487883543/490412658397266055245580782796800000000 * n^22
+   + 9252161795915253082728155240170650043693/58289047398075051137760458755276800000000 * n^23
+   + 7020751793938461613149395590976276678732551/107300863002315566295572360859117158400000000 * n^24
+   - 579414190481675218910106244870862973300742643/8393311950403350963564771338313164390400000000 * n^25
+   - 14173007029062232289088502554662276328011078147/150540045053305816210793863075031112744960000000 * n^26
+   + 772937441939971334194668845837513587924053359303309/7321000085750240746251238393754144640860160000000000 * n^27
+   + 49025366795674025628029223704689793073534968814712031/2399457778104641404583843383552920906041917440000000000 * n^28
+   - 669686609255507094686692239475289306509135059892997117053/9137135219022474468655275604569522810207621611520000000000 * n^29
+   + 40227222695357598417206145371640258351589316954641039386851/1130720483354031215496090356065478447763193174425600000000000 * n^30;
+beta[6]
+   = 20648693/638668800 * n^6
+   - 16363163/518918400 * n^7
+   - 2204645983/12915302400 * n^8
+   + 4543317553/18162144000 * n^9
+   + 54894890298749/167382319104000 * n^10
+   - 132058444054073/177843714048000 * n^11
+   - 21678380925301381/85364982743040000 * n^12
+   + 12818665941423773/9855505820160000 * n^13
+   - 4808615626581842484821/26158562391915233280000 * n^14
+   - 17463465220672744627/12110445551812608000 * n^15
+   + 165202773463857304705337/353370053364468940800000 * n^16
+   + 812997634361998476236143/536189976806503219200000 * n^17
+   - 154619327801320908736885805799083/176116016087504867932766208000000 * n^18
+   - 161959155482489360388164840926603/143094263071097705195372544000000 * n^19
+   + 9349367148014299101273724109539769/10684371642641961987921149952000000 * n^20
+   + 131732029936307954433180838298519269/162769724243373639659736268800000000 * n^21
+   - 8489365993766826694602346374698947667527/12000686229015451704833035626086400000000 * n^22
+   - 235155180584267064004207367582121161331463/369771144431538605655167910228787200000000 * n^23
+   + 10739171442634029743650624432194704913120097/17833938449138321267962165239742464000000000 * n^24
+   + 1762807308141499286674865995442897164018384597/4035617016594442070601857542605766656000000000 * n^25
+   - 558496189945509263731011585527531303192423984003189/1264536378447768856170668449830261347057664000000000 * n^26
+   - 97808507187022352611022156010465649331807161947569/289789586727613696205778186419434892034048000000000 * n^27
+   + 32615652758302709344528899560237170963687405836157/90059147187314916442820962074212161290240000000000 * n^28
+   + 943749252435341852900014209629694019211039392602319/4138675144863930994107684407508081919918080000000000 * n^29
+   - 2396490245787484054215780490518037472472963419615505648060407/7617485361542947135973661346125328490194143490867200000000000 * n^30;
+beta[7]
+   = 219941297/5535129600 * n^7
+   - 497323811/12454041600 * n^8
+   - 79431132943/332107776000 * n^9
+   + 4346429528407/12703122432000 * n^10
+   + 947319776978297/1625999671296000 * n^11
+   - 139564766909992667/115852476579840000 * n^12
+   - 3704835620812833323/5560918875832320000 * n^13
+   + 498841790610177443141/204363768686837760000 * n^14
+   + 39982484505071686289633/174390415946101555200000 * n^15
+   - 356813950170946951528704559/99271744277318310297600000 * n^16
+   + 15060663961223625760663/21138232235891097600000 * n^17
+   + 38394769836703949013594096271/9359907317575726399488000000 * n^18
+   - 175303180605302340156213620047457/109024200435122061101236224000000 * n^19
+   - 4999297133725717096793715285507829/1226522254895123187388907520000000 * n^20
+   + 130827473840213685129346417144165899127/55558732541738202337189979750400000000 * n^21
+   + 36940598630244479002168059481052336008621/10875621895045253107504938536140800000000 * n^22
+   - 526486046546475419696035545214440337907/215492198539596346402574633533440000000 * n^23
+   - 181704492729012922104603484325333564859103969/66558805997676949017930223841181696000000000 * n^24
+   + 16251647159655239438323473490445618080618846399/7202872969057694555540376223685699174400000000 * n^25
+   + 341205978466077200076092703065430429896507462203/161292905414256231654421996151819049369600000000 * n^26
+   - 897269639413978000885629059505489580735895982361633/465305593801127068287908304050096166666240000000000 * n^27
+   - 399121663633099371655729890858867495172854098268708589/248291717908219414909110750124171815494772326400000000 * n^28
+   + 40132241906468687661336733055001237954868039321697804833/25223285628771496117750933345947613002643537920000000000 * n^29
+   + 1896891499373733290268263706761724164585169669418091941816783/1593777443203777332318298787597055335894786569666560000000000 * n^30;
+beta[8]
+   = 191773887257/3719607091200 * n^8
+   - 17822319343/336825216000 * n^9
+   - 497155444501631/1422749712384000 * n^10
+   + 4081516004323/8281937664000 * n^11
+   + 3016420810780677019/2994340933140480000 * n^12
+   - 41961075720314059/21502921789440000 * n^13
+   - 14085528104367162867569/8992005822220861440000 * n^14
+   + 10746171896356804622543/2308215780257587200000 * n^15
+   + 13662158833536453560398591327/11118435359059650753331200000 * n^16
+   - 57341614923409542539239823/7238564686887793459200000 * n^17
+   + 144453057736406779924709655689/542023723754157974224896000000 * n^18
+   + 887382930255915812302412329/81992895194724433920000000 * n^19
+   - 2060398135313747799783225762752903/741970252961247360272302080000000 * n^20
+   - 10832617062792890567329480261903684747/885060375573344165649815961600000000 * n^21
+   + 10495965053853858396700728872356351447/2011024758699196210707274137600000000 * n^22
+   + 2827633829976426948425669998692889423/232406442150553432674163438387200000 * n^23
+   - 413070973425124733081767504737914466664159819031/59317777392239837516214863018588110848000000000 * n^24
+   - 192169586323003861221251799348718483715643402161/17652874435161653033977716034322300928000000000 * n^25
+   + 1383590112272607978551162261646356694508727283546677/183025002143756018656280959843853616021504000000000 * n^26
+   + 42340030181859331179384696226318556087021301196292587/4618521538471343283279589846059743591792640000000000 * n^27
+   - 41375761937244157344578465659087922365834839154673258123/5675239266473586626493960002838212925594796032000000000 * n^28
+   - 20325331939679357943380416802660356668728866279500649633/2734164750775035223701517188867368206341242880000000000 * n^29
+   + 26392423128042468212590130065257380662845826882235929755361/4017520183960092210271288782654341375876703191040000000000 * n^30;
+beta[9]
+   = 11025641854267/158083301376000 * n^9
+   - 492293158444691/6758061133824000 * n^10
+   - 3340781295639871/6360528125952000 * n^11
+   + 230755947172792843/315376186245120000 * n^12
+   + 2325760279413600365521/1332149010699386880000 * n^13
+   - 348782269044368632301/108224036583505920000 * n^14
+   - 136098374245460277375071/40852569661447864320000 * n^15
+   + 239596529464231037411713/27496921887512985600000 * n^16
+   + 35364463403763955482475445281/9177121248747648240844800000 * n^17
+   - 184592588983229841779643912853103/10840474475083159484497920000000 * n^18
+   - 104873550118556639023307009752009/57815863867110183917322240000000 * n^19
+   + 7665339074386065543669975721317792709/290481354034328341546606264320000000 * n^20
+   - 138062270900799459529491732714711746071/42901861518916185828421848268800000000 * n^21
+   - 17357777314150207521711937000950161082441881/505716418119604269498979641930547200000000 * n^22
+   + 4926642534361691999909217208854551999460491/475968393524333430116686721816985600000000 * n^23
+   + 10015652615289525910183306384331679276443744239/259601094634730191676142882857680896000000000 * n^24
+   - 116738227431164324545575763544019189664534311289453/6778703783102074765047442957179763556352000000000 * n^25
+   - 84974069676491141925432663367251874389066142853087/2178869073139952603050963807664924000256000000000 * n^26
+   + 3976320059916609695369389466291419325879319135434479/178432977000364290589635917840602808451072000000000 * n^27
+   + 1586328506886857290329263116615881138694586692983247121/43790426438839402982206481503381272574033920000000000 * n^28
+   - 80406545804397163817501103989422456991161536019523815972843/3266415488925908747248745868300215883842338160640000000000 * n^29
+   - 96019711772725383787880372103741416386264796387585150918847311/3025517346617622977139150860513074962408965721292800000000000 * n^30;
+beta[10]
+   = 7028504530429621/72085985427456000 * n^10
+   - 1396721719354981/13516122267648000 * n^11
+   - 242069739433316973869/299733527407362048000 * n^12
+   + 19998425063839930261/17952789402003456000 * n^13
+   + 2005763449529247335066903/661811628515455401984000 * n^14
+   - 1210830366517042702115957/224800145555521536000000 * n^15
+   - 1753821857771614575775682513/258106535121027606773760000 * n^16
+   + 332272605573163585761859289/20456813245552459776000000 * n^17
+   + 344973470391758976060874801536373/34689518320266110350393344000000 * n^18
+   - 2237438243573786540754649786424759/62874751955482325010087936000000 * n^19
+   - 1109701881606701094584605721502811981/126755499942252367220337278976000000 * n^20
+   + 627358150977452113555749190570504329703/10130537221947200911437893468160000000 * n^21
+   - 9310014587788716960656374062579608860273/311210103458218011999372087341875200000000 * n^22
+   - 446788868484797840813986816673961950907461/4958004099211806563715486685593600000000 * n^23
+   + 1592669172541355914905142337333376652510632300857/95325521949872926383479666585340425011200000000 * n^24
+   + 112875421374453323075239925362172217825744049933/992974186977842983161246526930629427200000000 * n^25
+   - 11164164940636962806588613537158861808945650584917881/292840003430009629850049535750165785634406400000000 * n^26
+   - 36738853303604438684911490335783868504502367676508134849/287806815871056339337001809354459811193815040000000000 * n^27
+   + 216582649507727909201718946529683408391594400595766366243093/3674717425041647340654839101837742869322630430720000000000 * n^28
+   + 4070973538524250670523695550641268121153963563101596930691/31101124040066025669604758023366313347131637760000000000 * n^29
+   - 2373100737803367912157154987764399515404306692774646531223199381/31685418030031833360584561739191475969955713735720960000000000 * n^30;
+beta[11]
+   = 20180430688893997/144171970854912000 * n^11
+   - 39227670225311092139/261131482210959360000 * n^12
+   - 15850794471105785046511/12534311146126049280000 * n^13
+   + 250199410574189500301/144626667070685184000 * n^14
+   + 137588598842474725924656737/26071367183942182502400000 * n^15
+   - 2668119315218475090518868331/293302880819349553152000000 * n^16
+   - 147889032611857077276756370409/10949974217255716651008000000 * n^17
+   + 107809340048140291312939137043109/3572429088379677557391360000000 * n^18
+   + 6793119291340068971080115425271339/288802688407957090955427840000000 * n^19
+   - 6754847041326342703335830346240936391/92384494472017791155888455680000000 * n^20
+   - 64145623999655583749753779305277081997/2304645453495497585824314163200000000 * n^21
+   + 2737268880658025692322671196199068915388587/19450631466138625749960755458867200000000 * n^22
+   + 63226986025671434632048293692546868186915331/3847688551847059057446782170772275200000000 * n^23
+   - 1090700244153262995408297323217157326170412252281/4814420300498632645630286191178809344000000000 * n^24
+   + 55625038880876569156054733788858925319816102829/3136997842858837560953670640406102016000000000 * n^25
+   + 6071056974043791221702396204511472430847588724030069/19238423520792536051938623619950522138624000000000 * n^26
+   - 1146269064361582904187395791106052397722761459105729423/15595948667522482559438244214573223280377856000000000 * n^27
+   - 106019806434003656675170902610826150161372006096027080991357/271427991622394405843823342749378734665876111360000000000 * n^28
+   + 261700017996377874094049879699967368736409082839966183897/1848807094916266706471338222217990529865482240000000000 * n^29
+   + 5564919878581209713189603625962524384371461254179337341860987383/12686544328430714529140303040105962058283049444966400000000000 * n^30;
+beta[12]
+   = 170866240186706518133/831839653739888640000 * n^12
+   - 213377450872182833497/957482101440184320000 * n^13
+   - 6175888888953945958057483/3072696846678900080640000 * n^14
+   + 1699533901862334396426791/622363365936119808000000 * n^15
+   + 1110507543583378006712775869269/120449716389812883161088000000 * n^16
+   - 410039885606415108766607293/26460299485682270208000000 * n^17
+   - 1868368333536354056091172181516467/70734095949917615636348928000000 * n^18
+   + 38905214964730326413906323913167/694966079629641887907840000000 * n^19
+   + 2767874903566891102867927978915243454399/52392273309464311784406075310080000000 * n^20
+   - 20032373737511717465214006054179506710383/135073829625962678819171912908800000000 * n^21
+   - 100577682847890502637160841018962740658759229/1322642939697426550997331371202969600000000 * n^22
+   + 135919298571923883567006460953143491460279/435079914374153470722806372106240000000 * n^23
+   + 3510216107422604000609260948095627318487208075137/48884883051216885324861367479661756416000000000 * n^24
+   - 101070009063831782999779504525998847565124914603267/183700224590900951884830607482166444032000000000 * n^25
+   - 290915990038543653257693921668246116917159442076793/22092475361789230960742705145987138060288000000000 * n^26
+   + 87749504586448696585237158790684148758827946213899707/104709128016813542574353446264834873098240000000000 * n^27
+   - 24637643848282085933220710334515754322900635607050021800141/214101183307748640575968216577661209193027207168000000000 * n^28
+   - 21317214475850887868873427382826252613387447653666787141648689/18832926803338442620856050396918432205278480957440000000000 * n^29
+   + 3923499613488828643584115055056306377586308324262330823616543131/12820086900308932576815464124738656395738660491755520000000000 * n^30;
+beta[13]
+   = 18814610183483742537419/61278854492171796480000 * n^13
+   - 46368551984271450700489/137877422607386542080000 * n^14
+   - 23268635133649915499415221/7193604657776689152000000 * n^15
+   + 445607162860807165073496089/101984636074370531328000000 * n^16
+   + 133255376497039560923384901787/8246409857103065776128000000 * n^17
+   - 17940677571433980181912441444683151/674694453676137256839020544000000 * n^18
+   - 2757949059159666555325445738852023379/53975556294090980547121643520000000 * n^19
+   + 24878591848279833324547251174969715273/239776028921827240507405762560000000 * n^20
+   + 15564548980094931213936099440270052236488729/135655686122812979589469884225945600000000 * n^21
+   - 30311212070549573455862406697198244599608233/101741764592109734692102413169459200000000 * n^22
+   - 62329425035966782423701548637355352965648981/325573646694751151014727722142269440000000 * n^23
+   + 623169776009883975758448302456707372300199400409/915354591546065160435157184588808192000000000 * n^24
+   + 9796262122721002376057350329922999007473366798297439/42296704966160578933387743185479648935936000000000 * n^25
+   - 6972722553962255796263966532090565610961098085631862003/5361107354460853379806896448759545502629888000000000 * n^26
+   - 204621385793344479983894287397851209945711725896319703509/1286665765070604811153655147702290920631173120000000000 * n^27
+   + 16994612718512721017891137595235443147803252876143561437699/7912994455184219588594979158369089161881714688000000000 * n^28
+   - 2017139943063547149336991050682980115243753114376812382829593/20257265805271602146803146645424868254417189601280000000000 * n^29
+   - 38559351426567355385426086606064720807546966166200767527984103843/12275103449081224916667438321865150759482563588259840000000000 * n^30;
+beta[14]
+   = 8913139575903156465851797/19119002601557600501760000 * n^14
+   - 267685764482874813822622157/519797883229847263641600000 * n^15
+   - 1312607511537430955013430449229/249502983950326686547968000000 * n^16
+   + 394441446207451421108383701253/55778311315818225598464000000 * n^17
+   + 23930383074197527389616417665944303/842355620435993694012702720000000 * n^18
+   - 3163985271870363313136985965093069527/68915219196919734091414241280000000 * n^19
+   - 11031130611852394131866851413708829814267/112469637729373006037188041768960000000 * n^20
+   + 82762604768504677943482108437799827136297/430547831932756038736110472396800000000 * n^21
+   + 5150460631556395571372500982024919497071310731/21162287035158824815957301939247513600000000 * n^22
+   - 29066497085581091842637088116335089148411714769/48937788768804782386901260734509875200000000 * n^23
+   - 18574016067923889310355562046347950371431867757801/40573875779227237760776317990793641984000000000 * n^24
+   + 2915644146751542300994700670854893964155460634998359/1994459581272638906178160881234949963776000000000 * n^25
+   + 44136416359780678842389174803925334595468092209791307/67329448721643370547025387111579849326592000000000 * n^26
+   - 19779807925985904471082228799863307496144797516514281/6575618800968119560003273400983467589632000000000 * n^27
+   - 9437414987664054735309211086890504857237214217749919547327367/14401649908435279651242862068231742274624720732160000000000 * n^28
+   + 10935173238809263052452436833453551042581316812365555123043/2044824288298806744648942931549704531015106560000000000 * n^29
+   + 9844133982291098741335196902427881991238566220082170652715161789559/44842293877181429376249317540178305362708067588977459200000000000 * n^30;
+beta[15]
+   = 602749854274775522930992007/840077387038136991744000000 * n^15
+   - 432388677389347815771203181653/541421475172208909809090560000 * n^16
+   - 509985088489059649186381056338807/59064160927877335615537152000000 * n^17
+   + 557542563821291613858429695152674917/48240653437843813863989968896000000 * n^18
+   + 228594885325983207294554048445139632797/4563985299162962563827920535552000000 * n^19
+   - 4879838474674757743673587551351918389761/61233469430436414398024600518656000000 * n^20
+   - 2751159808671003044739048717767661132425533/14696032663304739455525904124477440000000 * n^21
+   + 128125601507169052141729932672077247523358897/359836682123564576374273975989043200000000 * n^22
+   + 30192393359192032330697554623405270813965905808153/59508351142866615382471933053164008243200000000 * n^23
+   - 4779918733110943106587948891017151456334707858595371/4061444965500646499853709430878443562598400000000 * n^24
+   - 43635999640355928220666371208517025763949804332853/41311582611576823901881341954262617292800000000 * n^25
+   + 1093615732500524413310474447806551664943154712853580337/352628986416409072575533830586857805787955200000000 * n^26
+   + 12242342315633438381845240050057352332923530458934703251/7112724086411810733447920053364873798615040000000000 * n^27
+   - 201490867217252848518061423700123290704826593788569337593504193/29489092669653191666830622330188805609945856737280000000000 * n^28
+   - 177101515631733926913192960801449153246340895052913001485847913/83263320479020776471051168932297804075141242552320000000000 * n^29
+   + 3188424179872321062468258619737006762022989524905745242529616829657/245231294640835941901363455297850107452309744627220480000000000 * n^30;
+beta[16]
+   = 258111286167289650792323028754789/231006496073475801518545305600000 * n^16
+   - 5263782718468783726282279549/4203582881771808305971200000 * n^17
+   - 5480008133286071057255185152124708229/383668354827295829561557647360000000 * n^18
+   + 3254656358469551348762078052918542501/170852314259030174101631139840000000 * n^19
+   + 3903418284121815685136619157954211820691189/44088097989914218366577712373432320000000 * n^20
+   - 1475869269349982196110739285641411486418113/10620179854341315622157391652454400000000 * n^21
+   - 165406053235626113240302780087909075941876233947/464908993303645432675561976977843814400000000 * n^22
+   + 31141324189381440915034448751509805569920381009/47217319632401489256111763286812262400000000 * n^23
+   + 3425331498104147467678431771772144489569980472050747/3281975729697492121093906610810863484928000000000 * n^24
+   - 181114801957939134097279485499338367321177700348427827/78055895430715549919063478124695087218688000000000 * n^25
+   - 20329880662120223623532772221831681492746536794968375279/8563846812969934619691535885680832426278912000000000 * n^26
+   + 15514402521245792750246961997116209460024931536101177881/2381963776692158394304324203418114597060608000000000 * n^27
+   + 58528872092571805627208033537162293354868952581483996308205593/13610350462916857692383364152394833358436549263360000000000 * n^28
+   - 2739294316618535857897844520835697665418072257962762663947501/179187195041295435475533295409133367421546004480000000000 * n^29
+   - 28963918619355858559987610778078259702157647632421717394029814967389/4700266480616022219776132893208793726169270105355059200000000000 * n^30;
+beta[17]
+   = 5972486266662395092991359700731/3397154354021702963508019200000 * n^17
+   - 14169262403755308738265442730293527/7146763472273157609479995392000000 * n^18
+   - 1407123059162889531671157095700694121/59145628736053718147420651520000000 * n^19
+   + 31616271318862027601140911742786459816003/999546339232123823261872155525120000000 * n^20
+   + 33847994330735322699501662950595147934349517/215760061865017024098184001381990400000000 * n^21
+   - 86502185255596416338989303038079495440176441813/355518641938081801457782688277174681600000000 * n^22
+   - 1381419926651852376155125702746693024900887647/2049837214778129305702530815291817984000000 * n^23
+   + 2039800582062773533252062008847436810010590704673393/1669644822047391442119004879672622186496000000000 * n^24
+   + 6658940828673534449931395737435432548555706698080023117/3134479879256969534004745160772069384781824000000000 * n^25
+   - 1381470469487772782735900360391332279866899387998419366549/303260928318111802414959094304697712977641472000000000 * n^26
+   - 1395295684620560872662304928419977863449010608559002595498087/266869616919938386125164002988133987420324495360000000000 * n^27
+   + 3800355884806913283793161651067966638660881579408061104605403/280213097765935305431422203137540686791340720128000000000 * n^28
+   + 14254272866295825003590094337320088635299910217415520581006075573/1374912266371522565316844943394866303189511800094720000000000 * n^29
+   - 702046212944594816164772022402471437675208441448777951843503358652627/20791767020136757113362658445253016953407594818982379520000000000 * n^30;
+beta[18]
+   = 32561519486094387080527719588034341533/11663517986749793218671352479744000000 * n^18
+   - 729907719647457582367271201256463879/230528934567170058275021389824000000 * n^19
+   - 2367236104332471655932050118751689811238261/59375350358064550788705233330503680000000 * n^20
+   + 277337936278972764824727659347223162007380783/5246368848044609917345751476312473600000000 * n^21
+   + 2072215526282883572284838680097819963389051894913/7438543892858326922808991631645501030400000000 * n^22
+   - 21187399770302239981520985962108187969123956327017/49559298686168603123214906745838150615040000000 * n^23
+   - 117781246505279918774486020036924169110810872979542077/92510690880848059163334492592231214481408000000000 * n^24
+   + 15346233021039229146148984542248316965482710596146903/6780613138425795245494403150226037879603200000000 * n^25
+   + 23577648358032142021574052998960694124312121496108401309501/5499131500168427350457924910058518528661232025600000000 * n^26
+   - 25523104372278110417409133482492688317169934216303321881481/2864130989671055911696835890655478400344391680000000000 * n^27
+   - 4904614526502535650801519867527379473641587091534278367071269/432842750524368215007154889587272725078179640770560000000 * n^28
+   + 21605254007739675177136169588021592098439361907000904630780859/770695057717401985738931667124429059082325852160000000000 * n^29
+   + 587901467817860255311504068569140875259033445501764848866062463918953/24168207818278623653139500414994959877465238422064988160000000000 * n^30;
+beta[19]
+   = 428624286990709813412232185601376712413/95900036779942744242408898166784000000 * n^19
+   - 7696493507391194218978151080255673578313/1510425579284098221817940146126848000000 * n^20
+   - 527610184507500637130291508233596994938727387/7854213012277310753453288759859609600000000 * n^21
+   + 11361451298084078444421426214576116338438506193/127861967714573279471658686134773350400000000 * n^22
+   + 413731746541624122896290630838483865650422207002637/834682925240734368390987903087800431411200000000 * n^23
+   - 193620425636569480838170976533462900238070466349524697/256949550508766977723998435166460382806016000000000 * n^24
+   - 132662492287173341243380190879466905201764211256445800247/55272703309441429874851218942474144568049664000000000 * n^25
+   + 13146789691243844636190690725166722508695370878744595367/3135216364191005476094501914804205679280128000000000 * n^26
+   + 37750506608225008520506075562486792560657544757045773087576929/4393516640660880377892173691299384803425131692032000000000 * n^27
+   - 708261955363343231843730776055545581965081551994723487001141417/40755647785077903505447137531132451137035761090560000000000 * n^28
+   - 41215834581264644962808643579846154211341882270808962207078377401/1700549382091093699207676640514703059208080384327680000000000 * n^29
+   + 205978745011375578132532475847110147598943760061270638697653240745727/3577530762574138369708149732482806560808999108529356800000000000 * n^30;
+beta[20]
+   = 4413022171315891282875633078306076423077823/612225834803154479243538405896749056000000 * n^20
+   - 20372356369389063598321199048537111545322489/2467109651840332692314561267713966080000000 * n^21
+   - 8350441420653344994230757754481656794198878169653/73421183238768300923281343327167630540800000000 * n^22
+   + 3602842136240118426653037995310224523478929843329/23998309048482544305160371509809014374400000000 * n^23
+   + 556742892772424708949943649093699359972707482370822028429/630108817727632300573303895944205248075766169600000000 * n^24
+   - 19669578953730635368229268600445326314943118813499628227/14768175415491382044686810061192310501775769600000000 * n^25
+   - 58913853325627285400915530112249848640529228986228560671583/13043252526961988621867390646045048635168359710720000000 * n^26
+   + 6202219939216563039972447651959676151814355411005403328908487/798219881207309199515322083807444382620980346880000000000 * n^27
+   + 4029539464888473312146356584746881268371745066400450670075103971919/235404621606609970647462666379821037767518556059074560000000000 * n^28
+   - 96689844226844260169337694369507826490314199510140141134776628313/2860820054246996171062914348365880667313593563217920000000000 * n^29
+   - 1267431993370297356535644841552515784699654333219083107594851764271651/24717485268694046917983579969881208965589448386202828800000000000 * n^30;
+beta[21]
+   = 6364309775760426912861320334716314963236880099/543860616583468895728009950571612078080000000 * n^21
+   - 163511162729184839208619679935376666925954633509/12142734151027065152696529857954646589440000000 * n^22
+   - 293082088716477537348152181351392414509711063444079/1515413222048177731056526926272739894362112000000 * n^23
+   + 3584068349124466527596686906788906996841447765124034119/14064928967134649566368390534468867144548352000000000 * n^24
+   + 65325328354812776334115933271141213585155594697569614279619/41407150879244408323388541733476344873550348288000000000 * n^25
+   - 295262389665020199502850268061912716873799689551659695461801/125108748728002748005666808237574956296512838041600000000 * n^26
+   - 198220070520799681801810036957883626038127951175197474869802841/23353633095893846294391137537680658508682396434432000000000 * n^27
+   + 9203041943910402313157326557559771543787851843067288847306443759/639119373821137442471502141656207383123249625825280000000000 * n^28
+   + 223639420140739590352779061494286234859561093634481454398610059052269/6591329404985079178128954658634989057490519569654087680000000000 * n^29
+   - 7514702451752062815378233648033968164404526829002371317311008928464377/114599249882126944801560234405812877931369260699667660800000000000 * n^30;
+beta[22]
+   = 4597258274619973879852787439286345056927543926539/240541781277488528739131258138530141962240000000 * n^22
+   - 90547738027796418205837133798540945489664737617/4100143999048099921689737354634036510720000000 * n^23
+   - 120833998747258442540330733531559589117031890572073705423/365972293124634922050151252694866684488450048000000000 * n^24
+   + 700385303317244963533430016841479945264946535743006370213/1612565416580422625283478957186756328527233024000000000 * n^25
+   + 41927528317378886896874815834318257768184011744864991769792173/14861402879205174914612542069433146323706979549184000000000 * n^26
+   - 1883738571943229874285781147684391885621206162239253551981097/449437587072737144595137360970760473499203010560000000000 * n^27
+   - 1193194903894549620369066288907357112160028172942643483767868101/74901470511194081569647212029943057471483176927887360000000 * n^28
+   + 16593315611956986881113970672924159996956254881446619306408644351/621740722016747747404298146732925770026959964733440000000000 * n^29
+   + 11172709187913729666978241526344191734961305583177742422182451010341965837/166856507828376831631071701294863550268073643578716114124800000000000 * n^30;
+beta[23]
+   = 105692798364122771092494104410403169316822970007103/3367584937884839402347837613939421987471360000000 * n^23
+   - 4991587424316475527559827056175081831817518759624141283/137107011264808880217339273654526141942412083200000000 * n^24
+   - 1094971199704775675327145588577419573356229203017369297031/1935628394326713603068319157475663180363464704000000000 * n^25
+   + 55016459854774144990504572561411573956468991982011620879183/74037786082996795317363207773444116648902524928000000000 * n^26
+   + 239397211441168562919535061028225053930721123237942287411752901/47384183093117949003112452975004234655297615953920000000000 * n^27
+   - 3785206531097832093379025924494221733602175663051851724063493677/507484600927293233823334371362295353158237466866483200000000 * n^28
+   - 2878530207214341630613762260409649820059076958972834659710423583641/96377945080452906319144544961326352286747011098817331200000000 * n^29
+   + 4793620231717494054901024202427349307198672366940440795548189424277463/96899050172071924049425843362418567717916189402962329600000000000 * n^30;
+beta[24]
+   = 674454707484204643577912579775944698106967657841301509703/13020743263341849785801510375449192318660037836800000000 * n^24
+   - 14426118473738594318758580084527169080893428452291501/239224795864861496358580131547117377080524800000000 * n^25
+   - 8831250255802996377564597692702488675170603573810490306068589/9081968426180940225596553486875811642265376391168000000000 * n^26
+   + 8524975532343064334059520385109401209472880856691153037771/6682542557352665505329874016485837860046372864000000000 * n^27
+   + 3849014409982539112685345447510980453367887363991057306125975552515257/424866107896329895356895535704513669664076407260619735040000000000 * n^28
+   - 7018181262756669326759909066253824968190524410099850934366975116824761/527763368402472291888643673257950574035844912144051077120000000000 * n^29
+   - 850361604060552572056063294333220546778996672875303006775383312452755647779/15199585009991202006392937789828976532232333469748671021056000000000000 * n^30;
+beta[25]
+   = 199227752516955126043105919223151730212773157895262123371/2319787592894237605516361043901867597002650419200000000 * n^25
+   - 1168128087731386349278531921296393465205853015166911689601/11643549264334538750764812162661296977263303065600000000 * n^26
+   - 27390759516798680521492333486028666245475773964938356987895799/16337932618526559135993799923480296076032952238080000000000 * n^27
+   + 16623553892978221252992741635428809183176541795604885967233054812289/7566499905411789131019980978608610380442220962638725120000000000 * n^28
+   + 1391206775167565949946814294410548218174156897307634862471204069769203/85538095796791963737570611176977111081466475155984220160000000000 * n^29
+   - 309601436775289074939542822961271536740569529708755160589227851116770297/13036681100187385736477373542933235232324028706996910817280000000000 * n^30;
+beta[26]
+   = 20988866881167764922693397699209941026240719371894993737321/146779287695853579403580662414154531592167699251200000000 * n^26
+   - 20776782371826844247557167727961747229906685936639469810900161/123982629575591320352462040782956155904259153461248000000000 * n^27
+   - 56519161473334888467049876826142477266800694645666348046158762501/19499565911122788086072327775906636264771992816713728000000000 * n^28
+   + 713184336250531653186104175190769152673340166708863511978540935479/187949917522247967196810424949412597591112860450160640000000000 * n^29
+   + 222786377756937595153775101581958876025910578503920819534055082789529097879/7621444335494163969017541455868660597358662936398194016256000000000000 * n^30;
+beta[27]
+   = 1159063206283901297028135487345019691847337244400674181558705769/4849098401178682751562959817288951875366580224262144000000000 * n^27
+   - 836866364429699038099446680535614249403163042061868319644600230131/2978558692924005880147548067769738689443921902753021952000000000 * n^28
+   - 276258332981610143691601963914139654258026350011955431757944008776431/54988775869366262402723964328056714266657019743132712960000000000 * n^29
+   + 231942644768785218497452105692225263551992039422426853153865797716482578787/35296814078757346881512488867491734391517307724194136037785600000000000 * n^30;
+beta[28]
+   = 4820642953919212694667891843709465549522940845258602976903974801919/12021570220089681390145058868115702097935828940841025536000000000 * n^28
+   - 1407966726686721532660580475865160144206500909159825439202238905333/2978558692924005880147548067769738689443921902753021952000000000 * n^29
+   - 2269078966250518419628311750199082816400532696920651885729048451938814396007/259963837024498554809869759278034361232762393397239351135436800000000000 * n^30;
+beta[29]
+   = 2257448691193994841515777396189088185825275740674810644118087064739/3344346602581339935604264497144969756568614066249007104000000000 * n^29
+   - 190079826774799091739713735364123004573671877623337777048243884284125889/238239614545595134106590801450823661272646492861713602314240000000000 * n^30;
+beta[30]
+   = 46619651201884945136956267547124218081125978370322440448000334604980392416839/40900977025187772623419508793077406167287949894498991245308723200000000000 * n^30;
+    
+ + diff --git a/gtsam/3rdparty/GeographicLib/doc/utilities.html.in b/gtsam/3rdparty/GeographicLib/doc/utilities.html.in new file mode 100644 index 000000000..adadcb915 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/doc/utilities.html.in @@ -0,0 +1,24 @@ + + + GeographicLib-@PROJECT_VERSION@ utilities + + + +

+
+ + Online documentation for utilities for GeographicLib version + @PROJECT_VERSION@ is available at +
+ + http://geographiclib.sourceforge.net/@PROJECT_VERSION@/utilities.html. +
+
+ You will be redirected there. Click on the link to go there + directly. +
+
+

+ + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Accumulator.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Accumulator.cpp new file mode 100644 index 000000000..fda88f606 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Accumulator.cpp @@ -0,0 +1,99 @@ +/** + * \file NETGeographicLib/Accumulator.cpp + * \brief Implementation for NETGeographicLib::Accumulator class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/Accumulator.hpp" +#include "Accumulator.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +Accumulator::!Accumulator(void) +{ + if ( m_pAccumulator != NULL ) + { + delete m_pAccumulator; + m_pAccumulator = NULL; + } +} + +//***************************************************************************** +Accumulator::Accumulator(void) +{ + try + { + m_pAccumulator = new GeographicLib::Accumulator(); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr("Failed to allocate memory for a GeogrpicLib::Accumulator"); + } +} + +//***************************************************************************** +void Accumulator::Assign( double a ) +{ + m_pAccumulator->operator=( a); +} + +//***************************************************************************** +double Accumulator::Result() +{ + return m_pAccumulator->operator()(); +} + +//***************************************************************************** +void Accumulator::Sum( double a ) +{ + m_pAccumulator->operator+=( a ); +} + +//***************************************************************************** +void Accumulator::Multiply( int i ) +{ + m_pAccumulator->operator*=( i ); +} + +//***************************************************************************** +bool Accumulator::operator == ( Accumulator^ lhs, double a ) +{ + return lhs->m_pAccumulator->operator==( a ); +} + +//***************************************************************************** +bool Accumulator::operator != ( Accumulator^ lhs, double a ) +{ + return lhs->m_pAccumulator->operator!=( a ); +} + +//***************************************************************************** +bool Accumulator::operator < ( Accumulator^ lhs, double a ) +{ + return lhs->m_pAccumulator->operator<( a ); +} + +//***************************************************************************** +bool Accumulator::operator <= ( Accumulator^ lhs, double a ) +{ + return lhs->m_pAccumulator->operator<=( a ); +} + +//***************************************************************************** +bool Accumulator::operator > ( Accumulator^ lhs, double a ) +{ + return lhs->m_pAccumulator->operator>( a ); +} + +//***************************************************************************** +bool Accumulator::operator >= ( Accumulator^ lhs, double a ) +{ + return lhs->m_pAccumulator->operator>=( a ); +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Accumulator.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Accumulator.h new file mode 100644 index 000000000..825306f32 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Accumulator.h @@ -0,0 +1,116 @@ +#pragma once +/** + * \file NETGeographicLib/Accumulator.h + * \brief Header for NETGeographicLib::Accumulator class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /*! + \brief .NET wrapper for GeographicLib::Accumulator. + + This class allows .NET applications to access GeographicLib::Accumulator. + + This allow many numbers of floating point type \e double to be added together + with twice the normal precision. The effective + precision of the sum is 106 bits or about 32 decimal places. + + The implementation follows J. R. Shewchuk, + Adaptive Precision + Floating-Point Arithmetic and Fast Robust Geometric Predicates, + Discrete & Computational Geometry 18(3) 305--363 (1997). + + C# Example: + \include example-Accumulator.cs + Managed C++ Example: + \include example-Accumulator.cpp + Visual Basic Example: + \include example-Accumulator.vb + + INTERFACE DIFFERENCES:
+ Since assignment operators (=,+=,-=,*=) are not supported in managed classes; + - the Assign() method replaces the = operator, + - the Sum() method replaces the += and -= operators, and + - the Multiply() method replaces the *= operator, + + Use Result() instead of the () operator to obtain the summed value from the accumulator. + */ + public ref class Accumulator + { + private: + // Pointer to the unmanaged GeographicLib::Accumulator. + GeographicLib::Accumulator* m_pAccumulator; + // The finalizer releases the unmanaged object when this class is destroyrd. + !Accumulator(void); + public: + //! \brief Constructor. + Accumulator(void); + //! \brief Destructor calls the finalizer. + ~Accumulator() { this->!Accumulator(); } + /*! + \brief Assigns a value to an accumulator. + \param[in] a The value to be assigned. + */ + void Assign( double a ); + //! \brief Returns the accumulated value. + double Result(); + /*! + \brief Adds a value to the accumulator. + \param[in] a The value to be added. + */ + void Sum( double a ); + /*! + \brief Multiplication by an integer + \param[in] i The multiplier. + */ + void Multiply( int i ); + /*! + \brief Equality operator. + \param[in] lhs The accumulator. + \param[in] a The value to be compared to. + \return true if the accumulated value is equal to a. + */ + static bool operator == ( Accumulator^ lhs, double a ); + /*! + \brief Inequality operator. + \param[in] lhs The accumulator. + \param[in] a The value to be compared to. + \return true if the accumulated value is not equal to a. + */ + static bool operator != ( Accumulator^ lhs, double a ); + /*! + \brief Less than operator. + \param[in] lhs The accumulator. + \param[in] a The value to be compared to. + \return true if the accumulated value is less than a. + */ + static bool operator < ( Accumulator^ lhs, double a ); + /*! + \brief Less than or equal to operator. + \param[in] lhs The accumulator. + \param[in] a The value to be compared to. + \return true if the accumulated value is less than or equal to a. + */ + static bool operator <= ( Accumulator^ lhs, double a ); + /*! + \brief Greater than operator. + \param[in] lhs The accumulator. + \param[in] a The value to be compared to. + \return true if the accumulated value is greater than a. + */ + static bool operator > ( Accumulator^ lhs, double a ); + /*! + \brief Greater than or equal to operator. + \param[in] lhs The accumulator. + \param[in] a The value to be compared to. + \return true if the accumulated value is greater than or equal to a. + */ + static bool operator >= ( Accumulator^ lhs, double a ); + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AlbersEqualArea.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AlbersEqualArea.cpp new file mode 100644 index 000000000..87a3160e8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AlbersEqualArea.cpp @@ -0,0 +1,186 @@ +/** + * \file NETGeographicLib/AlbersEqualArea.cpp + * \brief Implementation for NETGeographicLib::AlbersEqualArea class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/AlbersEqualArea.hpp" +#include "AlbersEqualArea.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +AlbersEqualArea::!AlbersEqualArea() +{ + if ( m_pAlbersEqualArea != NULL ) + { + delete m_pAlbersEqualArea; + m_pAlbersEqualArea = NULL; + } +} + +//***************************************************************************** +AlbersEqualArea::AlbersEqualArea( StandardTypes type ) +{ + try + { + switch ( type ) + { + case StandardTypes::CylindricalEqualArea: + m_pAlbersEqualArea = new GeographicLib::AlbersEqualArea( GeographicLib::AlbersEqualArea::CylindricalEqualArea ); + break; + case StandardTypes::AzimuthalEqualAreaNorth: + m_pAlbersEqualArea = new GeographicLib::AlbersEqualArea( GeographicLib::AlbersEqualArea::AzimuthalEqualAreaNorth ); + break; + case StandardTypes::AzimuthalEqualAreaSouth: + m_pAlbersEqualArea = new GeographicLib::AlbersEqualArea( GeographicLib::AlbersEqualArea::AzimuthalEqualAreaSouth ); + break; + } + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::AlbersEqualArea" ); + } +} + +//***************************************************************************** +AlbersEqualArea::AlbersEqualArea(double a, double f, double stdlat1, double stdlat2, double k1) +{ + try + { + m_pAlbersEqualArea = new GeographicLib::AlbersEqualArea( a, f, stdlat1, stdlat2, k1 ); + } + catch ( GeographicLib::GeographicErr err ) + { + throw gcnew GeographicErr( err.what() ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::AlbersEqualArea" ); + } +} + +//***************************************************************************** +AlbersEqualArea::AlbersEqualArea(double a, double f, double stdlat, double k0) +{ + try + { + m_pAlbersEqualArea = new GeographicLib::AlbersEqualArea( a, f, stdlat, k0 ); + } + catch ( GeographicLib::GeographicErr err ) + { + throw gcnew GeographicErr( err.what() ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::AlbersEqualArea" ); + } +} + +//***************************************************************************** +AlbersEqualArea::AlbersEqualArea(double a, double f, + double sinlat1, double coslat1, + double sinlat2, double coslat2, + double k1) +{ + try + { + m_pAlbersEqualArea = new GeographicLib::AlbersEqualArea( + a, f, sinlat1, coslat1, sinlat2, coslat2, k1 ); + } + catch ( GeographicLib::GeographicErr err ) + { + throw gcnew GeographicErr( err.what() ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::AlbersEqualArea" ); + } +} + +//***************************************************************************** +void AlbersEqualArea::SetScale(double lat, double k) +{ + try + { + m_pAlbersEqualArea->SetScale( lat, k ); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} + +//***************************************************************************** +void AlbersEqualArea::Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double lx, ly, lgamma, lk; + m_pAlbersEqualArea->Forward( lon0, lat, lon, lx, ly, lgamma, lk ); + x = lx; + y = ly; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void AlbersEqualArea::Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double llat, llon, lgamma, lk; + m_pAlbersEqualArea->Reverse( lon0, x, y, llat, llon, lgamma, lk ); + lat = llat; + lon = llon; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void AlbersEqualArea::Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y) +{ + double lx, ly, lgamma, lk; + m_pAlbersEqualArea->Forward( lon0, lat, lon, lx, ly, lgamma, lk ); + x = lx; + y = ly; +} + +//***************************************************************************** +void AlbersEqualArea::Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon, lgamma, lk; + m_pAlbersEqualArea->Reverse( lon0, x, y, llat, llon, lgamma, lk ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double AlbersEqualArea::MajorRadius::get() +{ return m_pAlbersEqualArea->MajorRadius(); } + +//***************************************************************************** +double AlbersEqualArea::Flattening::get() +{ return m_pAlbersEqualArea->Flattening(); } + +//***************************************************************************** +double AlbersEqualArea::OriginLatitude::get() +{ return m_pAlbersEqualArea->OriginLatitude(); } + +//***************************************************************************** +double AlbersEqualArea::CentralScale::get() +{ return m_pAlbersEqualArea->CentralScale(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AlbersEqualArea.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AlbersEqualArea.h new file mode 100644 index 000000000..c1105173a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AlbersEqualArea.h @@ -0,0 +1,269 @@ +#pragma once +/** + * \file NETGeographicLib/AlbersEqualArea.h + * \brief Header for NETGeographicLib::AlbersEqualArea class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET Wrapper for GeographicLib::AlbersEqualArea. + * + * This class allows .NET applications to access + * GeographicLib::AlbersEqualArea + * + * Implementation taken from the report, + * - J. P. Snyder, + * Map Projections: A + * Working Manual, USGS Professional Paper 1395 (1987), + * pp. 101--102. + * + * This is a implementation of the equations in Snyder except that divided + * differences will be [have been] used to transform the expressions into + * ones which may be evaluated accurately. [In this implementation, the + * projection correctly becomes the cylindrical equal area or the azimuthal + * equal area projection when the standard latitude is the equator or a + * pole.] + * + * The ellipsoid parameters, the standard parallels, and the scale on the + * standard parallels are set in the constructor. Internally, the case with + * two standard parallels is converted into a single standard parallel, the + * latitude of minimum azimuthal scale, with an azimuthal scale specified on + * this parallel. This latitude is also used as the latitude of origin which + * is returned by AlbersEqualArea::OriginLatitude. The azimuthal scale on + * the latitude of origin is given by AlbersEqualArea::CentralScale. The + * case with two standard parallels at opposite poles is singular and is + * disallowed. The central meridian (which is a trivial shift of the + * longitude) is specified as the \e lon0 argument of the + * AlbersEqualArea::Forward and AlbersEqualArea::Reverse functions. + * AlbersEqualArea::Forward and AlbersEqualArea::Reverse also return the + * meridian convergence, γ, and azimuthal scale, \e k. A small square + * aligned with the cardinal directions is projected to a rectangle with + * dimensions \e k (in the E-W direction) and 1/\e k (in the N-S direction). + * The E-W sides of the rectangle are oriented γ degrees + * counter-clockwise from the \e x axis. There is no provision in this class + * for specifying a false easting or false northing or a different latitude + * of origin. + * + * C# Example: + * \include example-AlbersEqualArea.cs + * Managed C++ Example: + * \include example-AlbersEqualArea.cpp + * Visual Basic Example: + * \include example-AlbersEqualArea.vb + * + * INTERFACE DIFFERENCES:
+ * A constructor has been provided that creates the standard projections. + * + * The MajorRadius, Flattening, OriginLatitude, and CentralScale functions + * are implemented as properties. + **********************************************************************/ + public ref class AlbersEqualArea + { + private: + // pointer to the unmanaged GeographicLib::AlbersEqualArea + GeographicLib::AlbersEqualArea* m_pAlbersEqualArea; + + // Frees the unmanaged m_pAlbersEqualArea when object is destroyed. + !AlbersEqualArea(); + public: + /** + Standard AlbersEqualAreaProjections that assume the WGS84 ellipsoid. + *********************************************************************/ + enum class StandardTypes + { + CylindricalEqualArea, //!< cylindrical equal area projection (stdlat = 0, and \e k0 = 1) + AzimuthalEqualAreaNorth, //!< Lambert azimuthal equal area projection (stdlat = 90°, and \e k0 = 1) + AzimuthalEqualAreaSouth //!< Lambert azimuthal equal area projection (stdlat = −90°, and \e k0 = 1) + }; + + //! \brief Destructor + ~AlbersEqualArea() { this->!AlbersEqualArea(); } + + /**! + * Constructor for one of the standard types. + * @param[in] type The desired standard type. + **********************************************************************/ + AlbersEqualArea( StandardTypes type ); + + /** + * Constructor with a single standard parallel. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] stdlat standard parallel (degrees), the circle of tangency. + * @param[in] k0 azimuthal scale on the standard parallel. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k0 is + * not positive. + * @exception GeographicErr if \e stdlat is not in [−90°, + * 90°]. + **********************************************************************/ + AlbersEqualArea(double a, double f, double stdlat, double k0); + + /** + * Constructor with two standard parallels. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] stdlat1 first standard parallel (degrees). + * @param[in] stdlat2 second standard parallel (degrees). + * @param[in] k1 azimuthal scale on the standard parallels. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k1 is + * not positive. + * @exception GeographicErr if \e stdlat1 or \e stdlat2 is not in + * [−90°, 90°], or if \e stdlat1 and \e stdlat2 are + * opposite poles. + **********************************************************************/ + AlbersEqualArea(double a, double f, double stdlat1, double stdlat2, double k1); + + /** + * Constructor with two standard parallels specified by sines and cosines. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] sinlat1 sine of first standard parallel. + * @param[in] coslat1 cosine of first standard parallel. + * @param[in] sinlat2 sine of second standard parallel. + * @param[in] coslat2 cosine of second standard parallel. + * @param[in] k1 azimuthal scale on the standard parallels. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k1 is + * not positive. + * @exception GeographicErr if \e stdlat1 or \e stdlat2 is not in + * [−90°, 90°], or if \e stdlat1 and \e stdlat2 are + * opposite poles. + * + * This allows parallels close to the poles to be specified accurately. + * This routine computes the latitude of origin and the azimuthal scale at + * this latitude. If \e dlat = abs(\e lat2 − \e lat1) ≤ 160°, + * then the error in the latitude of origin is less than 4.5 × + * 10−14d;. + **********************************************************************/ + AlbersEqualArea(double a, double f, + double sinlat1, double coslat1, + double sinlat2, double coslat2, + double k1); + + /** + * Set the azimuthal scale for the projection. + * + * @param[in] lat (degrees). + * @param[in] k azimuthal scale at latitude \e lat (default 1). + * @exception GeographicErr \e k is not positive. + * @exception GeographicErr if \e lat is not in (−90°, + * 90°). + * + * This allows a "latitude of conformality" to be specified. + **********************************************************************/ + void SetScale(double lat, double k); + + /** + * Forward projection, from geographic to Lambert conformal conic. + * + * @param[in] lon0 central meridian longitude (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k azimuthal scale of projection at point; the radial + * scale is the 1/\e k. + * + * The latitude origin is given by AlbersEqualArea::LatitudeOrigin(). No + * false easting or northing is added and \e lat should be in the range + * [−90°, 90°]; \e lon and \e lon0 should be in the + * range [−540°, 540°). The values of \e x and \e y + * returned for points which project to infinity (i.e., one or both of the + * poles) will be large but finite. + **********************************************************************/ + void Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * Reverse projection, from Lambert conformal conic to geographic. + * + * @param[in] lon0 central meridian longitude (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k azimuthal scale of projection at point; the radial + * scale is the 1/\e k. + * + * The latitude origin is given by AlbersEqualArea::LatitudeOrigin(). No + * false easting or northing is added. \e lon0 should be in the range + * [−540°, 540°). The value of \e lon returned is in + * the range [−180°, 180°). The value of \e lat + * returned is in the range [−90°, 90°]. If the + * input point is outside the legal projected space the nearest pole is + * returned. + **********************************************************************/ + void Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * AlbersEqualArea::Forward without returning the convergence and + * scale. + **********************************************************************/ + void Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * AlbersEqualArea::Reverse without returning the convergence and + * scale. + **********************************************************************/ + void Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value used in + * the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return latitude of the origin for the projection (degrees). + * + * This is the latitude of minimum azimuthal scale and equals the \e stdlat + * in the 1-parallel constructor and lies between \e stdlat1 and \e stdlat2 + * in the 2-parallel constructors. + **********************************************************************/ + property double OriginLatitude { double get(); } + + /** + * @return central scale for the projection. This is the azimuthal scale + * on the latitude of origin. + **********************************************************************/ + property double CentralScale { double get(); } + ///@} + }; +} // namespace NETGeographic diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AssemblyInfo.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AssemblyInfo.cpp new file mode 100644 index 000000000..579e0f9d9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AssemblyInfo.cpp @@ -0,0 +1,43 @@ +#include "stdafx.h" + +using namespace System; +using namespace System::Reflection; +using namespace System::Runtime::CompilerServices; +using namespace System::Runtime::InteropServices; +using namespace System::Security::Permissions; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly:AssemblyTitleAttribute("NETGeographic")]; +[assembly:AssemblyDescriptionAttribute(".NET Interface for GeographicLib")]; +[assembly:AssemblyConfigurationAttribute("1.33")]; +[assembly:AssemblyCompanyAttribute("Open Source")]; +[assembly:AssemblyProductAttribute("NETGeographic")]; +[assembly:AssemblyCopyrightAttribute("GeographicLib copyright (c) Charles Karney 2013\nNETGeographicLib copyright (c) Scott Heiman 2013")]; +[assembly:AssemblyTrademarkAttribute("")]; +[assembly:AssemblyCultureAttribute("")]; + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the value or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly:AssemblyVersionAttribute("1.33.*")]; + +[assembly:ComVisible(false)]; + +[assembly:CLSCompliantAttribute(true)]; + +#if _MSC_VER < 1800 +// RequestMinium marked as obsolete in Visual Studio 12 (2013) +[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)]; +#endif diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AzimuthalEquidistant.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AzimuthalEquidistant.cpp new file mode 100644 index 000000000..5279ee938 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AzimuthalEquidistant.cpp @@ -0,0 +1,110 @@ +/** + * \file NETGeographicLib/AzimuthalEquidistant.cpp + * \brief Implementation for NETGeographicLib::AzimuthalEquidistant class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/AzimuthalEquidistant.hpp" +#include "AzimuthalEquidistant.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::AzimuthalEquidistant"; + +//***************************************************************************** +AzimuthalEquidistant::!AzimuthalEquidistant() +{ + if ( m_pAzimuthalEquidistant != NULL ) + { + delete m_pAzimuthalEquidistant; + m_pAzimuthalEquidistant = NULL; + } +} + +//***************************************************************************** +AzimuthalEquidistant::AzimuthalEquidistant(void) +{ + try + { + m_pAzimuthalEquidistant = new GeographicLib::AzimuthalEquidistant( GeographicLib::Geodesic::WGS84 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +AzimuthalEquidistant::AzimuthalEquidistant( Geodesic^ g ) +{ + try + { + const GeographicLib::Geodesic* pGeodesic = + reinterpret_cast( + g->GetUnmanaged()->ToPointer() ); + m_pAzimuthalEquidistant = new GeographicLib::AzimuthalEquidistant( *pGeodesic ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void AzimuthalEquidistant::Forward(double lat0, double lon0, double lat, double lon, + double% x, double% y, double% azi, double% rk) +{ + double lx, ly, lazi, lrk; + m_pAzimuthalEquidistant->Forward( lat0, lon0, lat, lon, + lx, ly, lazi, lrk ); + x = lx; + y = ly; + azi = lazi; + rk = lrk; +} + +//***************************************************************************** +void AzimuthalEquidistant::Reverse(double lat0, double lon0, double x, double y, + double% lat, double% lon, double% azi, double% rk) +{ + double llat, llon, lazi, lrk; + m_pAzimuthalEquidistant->Reverse(lat0, lon0, x, y, + llat, llon, lazi, lrk); + lat = llat; + lon = llon; + azi = lazi; + rk = lrk; +} +//***************************************************************************** +void AzimuthalEquidistant::Forward(double lat0, double lon0, double lat, double lon, + double% x, double% y) +{ + double azi, rk, lx, ly; + m_pAzimuthalEquidistant->Forward(lat0, lon0, lat, lon, lx, ly, azi, rk); + x = lx; + y = ly; +} + +//***************************************************************************** +void AzimuthalEquidistant::Reverse(double lat0, double lon0, double x, double y, + double% lat, double% lon) +{ + double azi, rk, llat, llon; + m_pAzimuthalEquidistant->Reverse(lat0, lon0, x, y, llat, llon, azi, rk); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double AzimuthalEquidistant::MajorRadius::get() +{ return m_pAzimuthalEquidistant->MajorRadius(); } + +//***************************************************************************** +double AzimuthalEquidistant::Flattening::get() +{ return m_pAzimuthalEquidistant->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AzimuthalEquidistant.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AzimuthalEquidistant.h new file mode 100644 index 000000000..ab0643fc4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/AzimuthalEquidistant.h @@ -0,0 +1,161 @@ +/** + * \file NETGeographicLib/AzimuthalEquidistant.h + * \brief Header for NETGeographicLib::AzimuthalEquidistant class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once +#include "Geodesic.h" + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::AzimuthalEquidistant. + * + * This class allows .NET applications to access GeographicLib::AzimuthalEquidistant. + * + * Azimuthal equidistant projection centered at an arbitrary position on the + * ellipsoid. For a point in projected space (\e x, \e y), the geodesic + * distance from the center position is hypot(\e x, \e y) and the azimuth of + * the geodesic from the center point is atan2(\e x, \e y). The Forward and + * Reverse methods also return the azimuth \e azi of the geodesic at (\e x, + * \e y) and reciprocal scale \e rk in the azimuthal direction which, + * together with the basic properties of the projection, serve to specify + * completely the local affine transformation between geographic and + * projected coordinates. + * + * The conversions all take place using a Geodesic object (by default + * Geodesic::WGS84). For more information on geodesics see \ref geodesic. + * + * C# Example: + * \include example-AzimuthalEquidistant.cs + * Managed C++ Example: + * \include example-AzimuthalEquidistant.cpp + * Visual Basic Example: + * \include example-AzimuthalEquidistant.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor is provided that assumes a WGS84 ellipsoid. + * + * The MajorRadius and Flattening functions are implemented as + * properties. + **********************************************************************/ + public ref class AzimuthalEquidistant + { + private: + // Pointer to the unmanaged GeographicLib::AzimuthalEquidistant + const GeographicLib::AzimuthalEquidistant* m_pAzimuthalEquidistant; + + // Frees the unmanaged memory when the object is destroyed. + !AzimuthalEquidistant(); + public: + /** + * Default Constructor for AzimuthalEquidistant. + * Assumes WGS84 Geodesic + **********************************************************************/ + AzimuthalEquidistant(void); + + /** + * Constructor for AzimuthalEquidistant. + * + * @param[in] earth the Geodesic object to use for geodesic calculations. + **********************************************************************/ + AzimuthalEquidistant( Geodesic^ earth ); + + /** + * Destructor + * + * frees unmanaged memory. + **********************************************************************/ + ~AzimuthalEquidistant() + { this->!AzimuthalEquidistant(); } + + /** + * Forward projection, from geographic to azimuthal equidistant. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] azi azimuth of geodesic at point (degrees). + * @param[out] rk reciprocal of azimuthal scale at point. + * + * \e lat0 and \e lat should be in the range [−90°, + * 90°] and \e lon0 and \e lon should be in the range + * [−540°, 540°). The scale of the projection is 1 + * in the "radial" direction, \e azi clockwise from true north, and is 1/\e + * rk in the direction perpendicular to this. A call to Forward followed + * by a call to Reverse will return the original (\e lat, \e lon) (to + * within roundoff). + **********************************************************************/ + void Forward(double lat0, double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk); + + /** + * Reverse projection, from azimuthal equidistant to geographic. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] azi azimuth of geodesic at point (degrees). + * @param[out] rk reciprocal of azimuthal scale at point. + * + * \e lat0 should be in the range [−90°, 90°] and \e + * lon0 should be in the range [−540°, 540°). \e lat + * will be in the range [−90°, 90°] and \e lon will + * be in the range [−180°, 180°). The scale of the + * projection is 1 in the "radial" direction, \e azi clockwise from true + * north, and is 1/\e rk in the direction perpendicular to this. A call to + * Reverse followed by a call to Forward will return the original (\e x, \e + * y) (to roundoff) only if the geodesic to (\e x, \e y) is a shortest + * path. + **********************************************************************/ + void Reverse(double lat0, double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk); + + /** + * AzimuthalEquidistant::Forward without returning the azimuth and scale. + **********************************************************************/ + void Forward(double lat0, double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * AzimuthalEquidistant::Reverse without returning the azimuth and scale. + **********************************************************************/ + void Reverse(double lat0, double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CMakeLists.txt new file mode 100644 index 000000000..664b1bc07 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CMakeLists.txt @@ -0,0 +1,42 @@ +# Build the .NET library... + +# Include all the .cpp files in the library. +file (GLOB SOURCES [A-Za-z]*.cpp) +file (GLOB HEADERS [A-Za-z]*.h) + +add_library (${NETGEOGRAPHICLIB_LIBRARIES} SHARED ${SOURCES} ${HEADERS}) +set_target_properties (${NETGEOGRAPHICLIB_LIBRARIES} + PROPERTIES COMPILE_FLAGS "/clr") + +string (REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") +string (REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +add_definitions (${PROJECT_DEFINITIONS}) +target_link_libraries (${NETGEOGRAPHICLIB_LIBRARIES} ${PROJECT_LIBRARIES}) + +# Set the version number on the library +set_target_properties (${NETGEOGRAPHICLIB_LIBRARIES} PROPERTIES + VERSION "${LIBVERSIONFULL}" OUTPUT_NAME ${NETLIBNAME} + PDB_NAME ${NETLIBNAME}${CMAKE_DEBUG_POSTFIX}) + +# Specify where the library is installed, adding it to the export depends +install (TARGETS ${NETGEOGRAPHICLIB_LIBRARIES} + EXPORT depends + RUNTIME DESTINATION bin) + +if (PACKAGE_DEBUG_LIBS) + install (PROGRAMS + "${CMAKE_CURRENT_BINARY_DIR}/Debug/${NETLIBNAME}${CMAKE_DEBUG_POSTFIX}.dll" + DESTINATION bin CONFIGURATIONS Release) +endif () + +# Install pdb file in debug mode. +get_target_property (_P ${NETGEOGRAPHICLIB_LIBRARIES} LOCATION_DEBUG) +get_filename_component (_P ${_P} PATH) +get_target_property (_N ${NETGEOGRAPHICLIB_LIBRARIES} PDB_NAME) +set (_PDB ${_P}/${_N}.pdb) +install (FILES ${_PDB} DESTINATION bin + RENAME ${NETLIBNAME}${CMAKE_DEBUG_POSTFIX}.pdb CONFIGURATIONS Debug) + +# Put all the library into a folder in the IDE +set_property (TARGET ${NETGEOGRAPHICLIB_LIBRARIES} PROPERTY FOLDER library) diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CassiniSoldner.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CassiniSoldner.cpp new file mode 100644 index 000000000..cfaa96aea --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CassiniSoldner.cpp @@ -0,0 +1,134 @@ +/** + * \file NETGeographicLib/CassiniSoldner.cpp + * \brief Implementation for NETGeographicLib::CassiniSoldner class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/CassiniSoldner.hpp" +#include "Geodesic.h" +#include "CassiniSoldner.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::CassiniSoldner"; + +//***************************************************************************** +CassiniSoldner::!CassiniSoldner() +{ + if ( m_pCassiniSoldner != NULL ) + { + delete m_pCassiniSoldner; + m_pCassiniSoldner = NULL; + } +} + +//***************************************************************************** +CassiniSoldner::CassiniSoldner(double lat0, double lon0) +{ + try + { + m_pCassiniSoldner = new GeographicLib::CassiniSoldner( GeographicLib::Geodesic::WGS84 ); + m_pCassiniSoldner->Reset(lat0, lon0); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +CassiniSoldner::CassiniSoldner(double lat0, double lon0, + Geodesic^ earth ) +{ + try + { + const GeographicLib::Geodesic* pGeodesic = + reinterpret_cast( + earth->GetUnmanaged()->ToPointer() ); + m_pCassiniSoldner = new GeographicLib::CassiniSoldner( *pGeodesic ); + m_pCassiniSoldner->Reset(lat0, lon0); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void CassiniSoldner::Reset(double lat0, double lon0) +{ + m_pCassiniSoldner->Reset(lat0, lon0); +} + +//***************************************************************************** +void CassiniSoldner::Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk) +{ + double lx, ly, lazi, lrk; + m_pCassiniSoldner->Forward(lat, lon, lx, ly, lazi, lrk); + x = lx; + y = ly; + azi = lazi; + rk = lrk; +} + +//***************************************************************************** +void CassiniSoldner::Reverse(double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk) +{ + double llat, llon, lazi, lrk; + m_pCassiniSoldner->Reverse( x, y, llat, llon, lazi, lrk ); + lat = llat; + lon = llon; + azi = lazi; + rk = lrk; +} +//***************************************************************************** +void CassiniSoldner::Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y) +{ + double lx, ly, azi, rk; + m_pCassiniSoldner->Forward(lat, lon, lx, ly, azi, rk); + x = lx; + y = ly; +} + +//***************************************************************************** +void CassiniSoldner::Reverse(double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon, lazi, lrk; + m_pCassiniSoldner->Reverse( x, y, llat, llon, lazi, lrk ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double CassiniSoldner::LatitudeOrigin::get() +{ return m_pCassiniSoldner->LatitudeOrigin(); } + +//***************************************************************************** +double CassiniSoldner::LongitudeOrigin::get() +{ return m_pCassiniSoldner->LongitudeOrigin(); } + +//***************************************************************************** +double CassiniSoldner::MajorRadius::get() +{ return m_pCassiniSoldner->MajorRadius(); } + +//***************************************************************************** +double CassiniSoldner::Flattening::get() +{ return m_pCassiniSoldner->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CassiniSoldner.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CassiniSoldner.h new file mode 100644 index 000000000..7150da02d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CassiniSoldner.h @@ -0,0 +1,201 @@ +/** + * \file NETGeographicLib/CassiniSoldner.h + * \brief Header for NETGeographicLib::CassiniSoldner class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::CassiniSoldner. + * + * This class allows .NET applications to access GeographicLib::CassiniSoldner. + * + * Cassini-Soldner projection centered at an arbitrary position, \e lat0, \e + * lon0, on the ellipsoid. This projection is a transverse cylindrical + * equidistant projection. The projection from (\e lat, \e lon) to easting + * and northing (\e x, \e y) is defined by geodesics as follows. Go north + * along a geodesic a distance \e y from the central point; then turn + * clockwise 90° and go a distance \e x along a geodesic. + * (Although the initial heading is north, this changes to south if the pole + * is crossed.) This procedure uniquely defines the reverse projection. The + * forward projection is constructed as follows. Find the point (\e lat1, \e + * lon1) on the meridian closest to (\e lat, \e lon). Here we consider the + * full meridian so that \e lon1 may be either \e lon0 or \e lon0 + + * 180°. \e x is the geodesic distance from (\e lat1, \e lon1) to + * (\e lat, \e lon), appropriately signed according to which side of the + * central meridian (\e lat, \e lon) lies. \e y is the shortest distance + * along the meridian from (\e lat0, \e lon0) to (\e lat1, \e lon1), again, + * appropriately signed according to the initial heading. [Note that, in the + * case of prolate ellipsoids, the shortest meridional path from (\e lat0, \e + * lon0) to (\e lat1, \e lon1) may not be the shortest path.] This procedure + * uniquely defines the forward projection except for a small class of points + * for which there may be two equally short routes for either leg of the + * path. + * + * Because of the properties of geodesics, the (\e x, \e y) grid is + * orthogonal. The scale in the easting direction is unity. The scale, \e + * k, in the northing direction is unity on the central meridian and + * increases away from the central meridian. The projection routines return + * \e azi, the true bearing of the easting direction, and \e rk = 1/\e k, the + * reciprocal of the scale in the northing direction. + * + * The conversions all take place using a Geodesic object (by default + * Geodesic::WGS84). For more information on geodesics see \ref geodesic. + * The determination of (\e lat1, \e lon1) in the forward projection is by + * solving the inverse geodesic problem for (\e lat, \e lon) and its twin + * obtained by reflection in the meridional plane. The scale is found by + * determining where two neighboring geodesics intersecting the central + * meridian at \e lat1 and \e lat1 + \e dlat1 intersect and taking the ratio + * of the reduced lengths for the two geodesics between that point and, + * respectively, (\e lat1, \e lon1) and (\e lat, \e lon). + * + * C# Example: + * \include example-CassiniSoldner.cs + * Managed C++ Example: + * \include example-CassiniSoldner.cpp + * Visual Basic Example: + * \include example-CassiniSoldner.vb + * + * INTERFACE DIFFERENCES:
+ * The LatitudeOrigin, LongitudeOrigin, MajorRadius and Flattening + * functions are implimented as properties. + **********************************************************************/ + public ref class CassiniSoldner + { + private: + // A pointer to the unmanaged GeographicLib::CassiniSoldner + GeographicLib::CassiniSoldner* m_pCassiniSoldner; + + // The finalizer frees the unmanaged memory when the object is destroyed. + !CassiniSoldner(); + public: + /** + * Constructor for CassiniSoldner specifying a center point and + * assuming the WGS84 ellipsoid. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + **********************************************************************/ + CassiniSoldner(double lat0, double lon0); + + /** + * Constructor for CassiniSoldner specifying a center point. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] earth the Geodesic object to use for geodesic calculations. + * By default this uses the WGS84 ellipsoid. + * + * \e lat0 should be in the range [−90°, 90°] and \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + CassiniSoldner(double lat0, double lon0, Geodesic^ earth ); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~CassiniSoldner() + { this->!CassiniSoldner(); } + + /** + * Set the central point of the projection + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * + * \e lat0 should be in the range [−90°, 90°] and \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + void Reset(double lat0, double lon0); + + /** + * Forward projection, from geographic to Cassini-Soldner. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] azi azimuth of easting direction at point (degrees). + * @param[out] rk reciprocal of azimuthal northing scale at point. + * + * \e lat should be in the range [−90°, 90°] and \e + * lon should be in the range [−540°, 540°). A call + * to Forward followed by a call to Reverse will return the original (\e + * lat, \e lon) (to within roundoff). The routine does nothing if the + * origin has not been set. + **********************************************************************/ + void Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk); + + /** + * Reverse projection, from Cassini-Soldner to geographic. + * + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] azi azimuth of easting direction at point (degrees). + * @param[out] rk reciprocal of azimuthal northing scale at point. + * + * A call to Reverse followed by a call to Forward will return the original + * (\e x, \e y) (to within roundoff), provided that \e x and \e y are + * sufficiently small not to "wrap around" the earth. The routine does + * nothing if the origin has not been set. + **********************************************************************/ + void Reverse(double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk); + + /** + * CassiniSoldner::Forward without returning the azimuth and scale. + **********************************************************************/ + void Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * CassiniSoldner::Reverse without returning the azimuth and scale. + **********************************************************************/ + void Reverse(double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e lat0 the latitude of origin (degrees). + **********************************************************************/ + property double LatitudeOrigin { double get(); } + + /** + * @return \e lon0 the longitude of origin (degrees). + **********************************************************************/ + property double LongitudeOrigin { double get(); } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CircularEngine.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CircularEngine.cpp new file mode 100644 index 000000000..37aae2150 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CircularEngine.cpp @@ -0,0 +1,83 @@ +/** + * \file NETGeographicLib/CircularEngine.cpp + * \brief Implementation for NETGeographicLib::CircularEngine class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/CircularEngine.hpp" +#include "CircularEngine.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +CircularEngine::CircularEngine(const GeographicLib::CircularEngine& c) +{ + try + { + m_pCircularEngine = new GeographicLib::CircularEngine( c ); + } + catch ( GeographicLib::GeographicErr err ) + { + throw gcnew GeographicErr( err.what() ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::CircularEngine" ); + } +} + +//***************************************************************************** +CircularEngine::!CircularEngine() +{ + if ( m_pCircularEngine != NULL ) + { + delete m_pCircularEngine; + m_pCircularEngine = NULL; + } +} + +//***************************************************************************** +double CircularEngine::LongitudeSum(double coslon, double sinlon) +{ + return m_pCircularEngine->operator()( coslon, sinlon ); +} + +//***************************************************************************** +double CircularEngine::LongitudeSum(double lon) +{ + return m_pCircularEngine->operator()( lon ); +} + +//***************************************************************************** +double CircularEngine::LongitudeSum(double coslon, double sinlon, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz) +{ + double lgradx, lgrady, lgradz; + double output = m_pCircularEngine->operator()( coslon, sinlon, lgradx, lgrady, lgradz ); + gradx = lgradx; + grady = lgrady; + gradz = lgradz; + return output; +} + +//***************************************************************************** +double CircularEngine::LongitudeSum(double lon, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz) +{ + double lgradx, lgrady, lgradz; + double output = m_pCircularEngine->operator()( lon, lgradx, lgrady, lgradz ); + gradx = lgradx; + grady = lgrady; + gradz = lgradz; + return output; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CircularEngine.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CircularEngine.h new file mode 100644 index 000000000..febed2bf9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/CircularEngine.h @@ -0,0 +1,142 @@ +/** + * \file NETGeographicLib/CircularEngine.h + * \brief Header for NETGeographicLib::CircularEngine class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::CircularEngine. + * + * This class allows .NET applications to access GeographicLib::CircularEngine. + * + * The class is a companion to SphericalEngine. If the results of a + * spherical harmonic sum are needed for several points on a circle of + * constant latitude \e lat and height \e h, then SphericalEngine::Circle can + * compute the inner sum, which is independent of longitude \e lon, and + * produce a CircularEngine object. CircularEngine::LongitudeSum() can + * then be used to perform the outer sum for particular values of \e lon. + * This can lead to substantial improvements in computational speed for high + * degree sum (approximately by a factor of \e N / 2 where \e N is the + * maximum degree). + * + * CircularEngine is tightly linked to the internals of SphericalEngine. For + * that reason, the constructor for this class is for internal use only. Use + * SphericalHarmonic::Circle, SphericalHarmonic1::Circle, and + * SphericalHarmonic2::Circle to create instances of this class. + * + * CircularEngine stores the coefficients needed to allow the summation over + * order to be performed in 2 or 6 vectors of length \e M + 1 (depending on + * whether gradients are to be calculated). For this reason the constructor + * may throw a GeographicErr exception. + * + * C# Example: + * \include example-CircularEngine.cs + * Managed C++ Example: + * \include example-CircularEngine.cpp + * Visual Basic Example: + * \include example-CircularEngine.vb + * + * INTERFACE DIFFERENCES:
+ * The () operator has been replaced with with LongitudeSum. + * + * This class does not have a constructor that can be used in a .NET + * application. Use SphericalHarmonic::Circle, SphericalHarmonic1::Circle or + * SphericalHarmonic2::Circle to create instances of this class. + **********************************************************************/ + public ref class CircularEngine + { + private: + // pointer to the unmanaged GeographicLib::CircularEngine + const GeographicLib::CircularEngine* m_pCircularEngine; + + // The finalizer frees the unmanaged memory when the object is destroyed. + !CircularEngine(); + public: + /** + * The constructor. + * + * This constructor should not be used in .NET applications. + * Use SphericalHarmonic::Circle, SphericalHarmonic1::Circle or + * SphericalHarmonic2::Circle to create instances of this class. + * + * @param[in] c The unmanaged CircularEngine to be copied. + **********************************************************************/ + CircularEngine( const GeographicLib::CircularEngine& c ); + + /** + * The destructor calls the finalizer + **********************************************************************/ + ~CircularEngine() + { this->!CircularEngine(); } + + /** + * Evaluate the sum for a particular longitude given in terms of its + * cosine and sine. + * + * @param[in] coslon the cosine of the longitude. + * @param[in] sinlon the sine of the longitude. + * @return \e V the value of the sum. + * + * The arguments must satisfy coslon2 + + * sinlon2 = 1. + **********************************************************************/ + double LongitudeSum(double coslon, double sinlon); + + /** + * Evaluate the sum for a particular longitude. + * + * @param[in] lon the longitude (degrees). + * @return \e V the value of the sum. + **********************************************************************/ + double LongitudeSum(double lon); + + /** + * Evaluate the sum and its gradient for a particular longitude given in + * terms of its cosine and sine. + * + * @param[in] coslon the cosine of the longitude. + * @param[in] sinlon the sine of the longitude. + * @param[out] gradx \e x component of the gradient. + * @param[out] grady \e y component of the gradient. + * @param[out] gradz \e z component of the gradient. + * @return \e V the value of the sum. + * + * The gradients will only be computed if the CircularEngine object was + * created with this capability (e.g., via \e gradp = true in + * SphericalHarmonic::Circle). If not, \e gradx, etc., will not be + * touched. The arguments must satisfy coslon2 + + * sinlon2 = 1. + **********************************************************************/ + double LongitudeSum(double coslon, double sinlon, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz); + + /** + * Evaluate the sum and its gradient for a particular longitude. + * + * @param[in] lon the longitude (degrees). + * @param[out] gradx \e x component of the gradient. + * @param[out] grady \e y component of the gradient. + * @param[out] gradz \e z component of the gradient. + * @return \e V the value of the sum. + * + * The gradients will only be computed if the CircularEngine object was + * created with this capability (e.g., via \e gradp = true in + * SphericalHarmonic::Circle). If not, \e gradx, etc., will not be + * touched. + **********************************************************************/ + double LongitudeSum(double lon, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz); + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.cpp new file mode 100644 index 000000000..8271b7fd2 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.cpp @@ -0,0 +1,130 @@ +/** + * \file NETGeographicLib/DMS.cpp + * \brief Implementation for NETGeographicLib::DMS class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/DMS.hpp" +#include "DMS.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +double DMS::Decode( System::String^ dms, + [System::Runtime::InteropServices::Out] Flag% ind) +{ + try + { + GeographicLib::DMS::flag lind; + double out = GeographicLib::DMS::Decode( StringConvert::ManagedToUnmanaged(dms), lind ); + ind = static_cast(lind); + return out; + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} + +//***************************************************************************** +double DMS::Decode(System::String^ str) +{ + try + { + return GeographicLib::DMS::Decode(StringConvert::ManagedToUnmanaged(str)); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} + +//***************************************************************************** +void DMS::DecodeLatLon(System::String^ dmsa, System::String^ dmsb, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + bool swaplatlong ) +{ + try + { + double llat, llon; + GeographicLib::DMS::DecodeLatLon( StringConvert::ManagedToUnmanaged( dmsa ), + StringConvert::ManagedToUnmanaged( dmsb ), llat, llon, swaplatlong ); + lat = llat; + lon = llon; + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} + +//***************************************************************************** +double DMS::DecodeAngle(System::String^ angstr) +{ + try + { + return GeographicLib::DMS::DecodeAngle(StringConvert::ManagedToUnmanaged( angstr )); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} + +//***************************************************************************** +double DMS::DecodeAzimuth(System::String^ azistr) +{ + try + { + return GeographicLib::DMS::DecodeAzimuth(StringConvert::ManagedToUnmanaged( azistr )); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} + +//***************************************************************************** +System::String^ DMS::Encode(double angle, Component trailing, unsigned prec, + Flag ind, char dmssep) +{ + try + { + return StringConvert::UnmanagedToManaged( + GeographicLib::DMS::Encode( angle, + static_cast(trailing), + prec, + static_cast(ind), + dmssep ) + ); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} +//***************************************************************************** +System::String^ DMS::Encode(double angle, unsigned prec, Flag ind, + char dmssep ) +{ + try + { + return StringConvert::UnmanagedToManaged( + GeographicLib::DMS::Encode( angle, + prec, + static_cast(ind), + dmssep ) + ); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.h new file mode 100644 index 000000000..a0c37fe4e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/DMS.h @@ -0,0 +1,326 @@ +/** + * \file NETGeographicLib/DMS.h + * \brief Header for NETGeographicLib::DMS class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::DMS. + * + * Parse a string representing degree, minutes, and seconds and return the + * angle in degrees and format an angle in degrees as degree, minutes, and + * seconds. In addition, handle NANs and infinities on input and output. + * + * C# Example: + * \include example-DMS.cs + * Managed C++ Example: + * \include example-DMS.cpp + * Visual Basic Example: + * \include example-DMS.vb + **********************************************************************/ +public ref class DMS +{ +public: + /** + * Indicator for presence of hemisphere indicator (N/S/E/W) on latitudes + * and longitudes. + **********************************************************************/ + enum class Flag { + /** + * No indicator present. + * @hideinitializer + **********************************************************************/ + NONE = 0, + /** + * Latitude indicator (N/S) present. + * @hideinitializer + **********************************************************************/ + LATITUDE = 1, + /** + * Longitude indicator (E/W) present. + * @hideinitializer + **********************************************************************/ + LONGITUDE = 2, + /** + * Used in Encode to indicate output of an azimuth in [000, 360) with no + * letter indicator. + * @hideinitializer + **********************************************************************/ + AZIMUTH = 3, + /** + * Used in Encode to indicate output of a plain number. + * @hideinitializer + **********************************************************************/ + NUMBER = 4, + }; + + /** + * Indicator for trailing units on an angle. + **********************************************************************/ + enum class Component { + /** + * Trailing unit is degrees. + * @hideinitializer + **********************************************************************/ + DEGREE = 0, + /** + * Trailing unit is arc minutes. + * @hideinitializer + **********************************************************************/ + MINUTE = 1, + /** + * Trailing unit is arc seconds. + * @hideinitializer + **********************************************************************/ + SECOND = 2, + }; + + /** + * Convert a string in DMS to an angle. + * + * @param[in] dms string input. + * @param[out] ind a DMS::flag value signaling the presence of a + * hemisphere indicator. + * @exception GeographicErr if \e dms is malformed (see below). + * @return angle (degrees). + * + * Degrees, minutes, and seconds are indicated by the characters d, ' + * (single quote), " (double quote), and these components may only be + * given in this order. Any (but not all) components may be omitted and + * other symbols (e.g., the ° symbol for degrees and the unicode + * prime and double prime symbols for minutes and seconds) may be + * substituted. The last component indicator may be omitted and is assumed + * to be the next smallest unit (thus 33d10 is interpreted as 33d10'). The + * final component may be a decimal fraction but the non-final components + * must be integers. Instead of using d, ', and " to indicate + * degrees, minutes, and seconds, : (colon) may be used to separate + * these components (numbers must appear before and after each colon); thus + * 50d30'10.3" may be written as 50:30:10.3, 5.5' may be written + * 0:5.5, and so on. The integer parts of the minutes and seconds + * components must be less than 60. A single leading sign is permitted. A + * hemisphere designator (N, E, W, S) may be added to the beginning or end + * of the string. The result is multiplied by the implied sign of the + * hemisphere designator (negative for S and W). In addition \e ind is set + * to DMS::LATITUDE if N or S is present, to DMS::LONGITUDE if E or W is + * present, and to DMS::NONE otherwise. Throws an error on a malformed + * string. No check is performed on the range of the result. Examples of + * legal and illegal strings are + * - LEGAL (all the entries on each line are equivalent) + * - -20.51125, 20d30'40.5"S, -20°30'40.5, -20d30.675, + * N-20d30'40.5", -20:30:40.5 + * - 4d0'9, 4d9", 4d9'', 4:0:9, 004:00:09, 4.0025, 4.0025d, 4d0.15, + * 04:.15 + * - ILLEGAL (the exception thrown explains the problem) + * - 4d5"4', 4::5, 4:5:, :4:5, 4d4.5'4", -N20.5, 1.8e2d, 4:60, + * 4d-5' + * + * NOTE: At present, all the string handling in the C++ + * implementation %GeographicLib is with 8-bit characters. The support for + * unicode symbols for degrees, minutes, and seconds is therefore via the + * UTF-8 encoding. (The + * JavaScript implementation of this class uses unicode natively, of + * course.) + * + * Here is the list of Unicode symbols supported for degrees, minutes, + * seconds: + * - degrees: + * - d, D lower and upper case letters + * - U+00b0 degree symbol (°) + * - U+00ba masculine ordinal indicator + * - U+2070 superscript zero + * - U+02da ring above + * - minutes: + * - ' apostrophe + * - U+2032 prime (′) + * - U+00b4 acute accent + * - U+2019 right single quote (’) + * - seconds: + * - " quotation mark + * - U+2033 double prime (″) + * - U+201d right double quote (”) + * - ' ' any two consecutive symbols for minutes + * . + * The codes with a leading zero byte, e.g., U+00b0, are accepted in their + * UTF-8 coded form 0xc2 0xb0 and as a single byte 0xb0. + **********************************************************************/ + static double Decode(System::String^ dms, + [System::Runtime::InteropServices::Out] Flag% ind); + + /** + * Convert DMS to an angle. + * + * @param[in] d degrees. + * @param[in] m arc minutes. + * @param[in] s arc seconds. + * @return angle (degrees) + * + * This does not propagate the sign on \e d to the other components, so + * -3d20' would need to be represented as - DMS::Decode(3.0, 20.0) or + * DMS::Decode(-3.0, -20.0). + **********************************************************************/ + static double Decode(double d, double m, double s ) + { return d + (m + s/double(60))/double(60); } + + /// \cond SKIP + /** + * DEPRECATED (use Utility::num, instead). + * Convert a string to a double number. + * + * @param[in] str string input. + * @exception GeographicErr if \e str is malformed. + * @return decoded number. + **********************************************************************/ + static double Decode(System::String^ str); + /// \endcond + + /** + * Convert a pair of strings to latitude and longitude. + * + * @param[in] dmsa first string. + * @param[in] dmsb second string. + * @param[out] lat latitude. + * @param[out] lon longitude reduced to the range [−180°, + * 180°). + * @param[in] swaplatlong if true assume longitude is given before latitude + * in the absence of hemisphere designators (default false). + * @exception GeographicErr if \e dmsa or \e dmsb is malformed. + * @exception GeographicErr if \e dmsa and \e dmsb are both interpreted as + * latitudes. + * @exception GeographicErr if \e dmsa and \e dmsb are both interpreted as + * longitudes. + * @exception GeographicErr if decoded latitude is not in [−90°, + * 90°]. + * @exception GeographicErr if decoded longitude is not in + * [−540°, 540°). + * + * By default, the \e lat (resp., \e lon) is assigned to the results of + * decoding \e dmsa (resp., \e dmsb). However this is overridden if either + * \e dmsa or \e dmsb contain a latitude or longitude hemisphere designator + * (N, S, E, W). If an exception is thrown, \e lat and \e lon are + * unchanged. + **********************************************************************/ + static void DecodeLatLon(System::String^ dmsa, System::String^ dmsb, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + bool swaplatlong ); + + /** + * Convert a string to an angle in degrees. + * + * @param[in] angstr input string. + * @exception GeographicErr if \e angstr is malformed. + * @exception GeographicErr if \e angstr includes a hemisphere designator. + * @return angle (degrees) + * + * No hemisphere designator is allowed and no check is done on the range of + * the result. + **********************************************************************/ + static double DecodeAngle(System::String^ angstr); + + /** + * Convert a string to an azimuth in degrees. + * + * @param[in] azistr input string. + * @exception GeographicErr if \e azistr is malformed. + * @exception GeographicErr if \e azistr includes a N/S designator. + * @exception GeographicErr if decoded azimuth is not in + * [−540°, 540°). + * @return azimuth (degrees) reduced to the range [−180°, + * 180°). + * + * A hemisphere designator E/W can be used; the result is multiplied by + * −1 if W is present. + **********************************************************************/ + static double DecodeAzimuth(System::String^ azistr); + + /** + * Convert angle (in degrees) into a DMS string (using d, ', and "). + * + * @param[in] angle input angle (degrees) + * @param[in] trailing DMS::component value indicating the trailing units + * on the string and this is given as a decimal number if necessary. + * @param[in] prec the number of digits after the decimal point for the + * trailing component. + * @param[in] ind DMS::flag value indicated additional formatting. + * @param[in] dmssep if non-null, use as the DMS separator character + * (instead of d, ', " delimiters). + * @exception GeographicErr if memory for the string can't be allocated. + * @return formatted string + * + * The interpretation of \e ind is as follows: + * - ind == DMS::NONE, signed result no leading zeros on degrees except in + * the units place, e.g., -8d03'. + * - ind == DMS::LATITUDE, trailing N or S hemisphere designator, no sign, + * pad degrees to 2 digits, e.g., 08d03'S. + * - ind == DMS::LONGITUDE, trailing E or W hemisphere designator, no + * sign, pad degrees to 3 digits, e.g., 008d03'W. + * - ind == DMS::AZIMUTH, convert to the range [0, 360°), no + * sign, pad degrees to 3 digits, , e.g., 351d57'. + * . + * The integer parts of the minutes and seconds components are always given + * with 2 digits. + **********************************************************************/ + static System::String^ Encode(double angle, Component trailing, unsigned prec, + Flag ind, char dmssep ); + + /** + * Convert angle into a DMS string (using d, ', and ") selecting the + * trailing component based on the precision. + * + * @param[in] angle input angle (degrees) + * @param[in] prec the precision relative to 1 degree. + * @param[in] ind DMS::flag value indicated additional formatting. + * @param[in] dmssep if non-null, use as the DMS separator character + * (instead of d, ', " delimiters). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return formatted string + * + * \e prec indicates the precision relative to 1 degree, e.g., \e prec = 3 + * gives a result accurate to 0.1' and \e prec = 4 gives a result accurate + * to 1". \e ind is interpreted as in DMS::Encode with the additional + * facility that DMS::NUMBER represents \e angle as a number in fixed + * format with precision \e prec. + **********************************************************************/ + static System::String^ Encode(double angle, unsigned prec, Flag ind, + char dmssep ); + + /** + * Split angle into degrees and minutes + * + * @param[in] ang angle (degrees) + * @param[out] d degrees (an integer returned as a double) + * @param[out] m arc minutes. + **********************************************************************/ + static void Encode(double ang, + [System::Runtime::InteropServices::Out] double% d, + [System::Runtime::InteropServices::Out] double% m) + { + d = int(ang); m = 60 * (ang - d); + } + + /** + * Split angle into degrees and minutes and seconds. + * + * @param[in] ang angle (degrees) + * @param[out] d degrees (an integer returned as a double) + * @param[out] m arc minutes (an integer returned as a double) + * @param[out] s arc seconds. + **********************************************************************/ + static void Encode(double ang, + [System::Runtime::InteropServices::Out] double% d, + [System::Runtime::InteropServices::Out] double% m, + [System::Runtime::InteropServices::Out] double% s) + { + d = int(ang); ang = 60 * (ang - d); + m = int(ang); s = 60 * (ang - m); + } +}; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Ellipsoid.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Ellipsoid.cpp new file mode 100644 index 000000000..8f5acd6e0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Ellipsoid.cpp @@ -0,0 +1,270 @@ +/** + * \file NETGeographicLib/Ellipsoid.cpp + * \brief Implementation for NETGeographicLib::Ellipsoid class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/Ellipsoid.hpp" +#include "Ellipsoid.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::Ellipsoid"; + +//***************************************************************************** +Ellipsoid::!Ellipsoid(void) +{ + if ( m_pEllipsoid != NULL ) + { + delete m_pEllipsoid; + m_pEllipsoid = NULL; + } +} + +//***************************************************************************** +Ellipsoid::Ellipsoid() +{ + try + { + m_pEllipsoid = new GeographicLib::Ellipsoid( GeographicLib::Ellipsoid::WGS84 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +Ellipsoid::Ellipsoid(double a, double f) +{ + try + { + m_pEllipsoid = new GeographicLib::Ellipsoid( a, f ); + } + catch ( std::bad_alloc err ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +double Ellipsoid::ParametricLatitude(double phi) +{ + return m_pEllipsoid->ParametricLatitude( phi ); +} + +//***************************************************************************** +double Ellipsoid::InverseParametricLatitude(double beta) +{ + return m_pEllipsoid->InverseParametricLatitude( beta ); +} + +//***************************************************************************** +double Ellipsoid::GeocentricLatitude(double phi) +{ + return m_pEllipsoid->GeocentricLatitude( phi ); +} + +//***************************************************************************** +double Ellipsoid::InverseGeocentricLatitude(double theta) +{ + return m_pEllipsoid->InverseGeocentricLatitude( theta ); +} + +//***************************************************************************** +double Ellipsoid::RectifyingLatitude(double phi) +{ + return m_pEllipsoid->RectifyingLatitude( phi ); +} + +//***************************************************************************** +double Ellipsoid::InverseRectifyingLatitude(double mu) +{ + return m_pEllipsoid->InverseRectifyingLatitude( mu ); +} + +//***************************************************************************** +double Ellipsoid::AuthalicLatitude(double phi) +{ + return m_pEllipsoid->AuthalicLatitude( phi ); +} + +//***************************************************************************** +double Ellipsoid::InverseAuthalicLatitude(double xi) +{ + return m_pEllipsoid->InverseAuthalicLatitude( xi ); +} + +//***************************************************************************** +double Ellipsoid::ConformalLatitude(double phi) +{ + return m_pEllipsoid->ConformalLatitude( phi ); +} + +//***************************************************************************** +double Ellipsoid::InverseConformalLatitude(double chi) +{ + return m_pEllipsoid->InverseConformalLatitude( chi ); +} + +//***************************************************************************** +double Ellipsoid::IsometricLatitude(double phi) +{ + return m_pEllipsoid->IsometricLatitude( phi ); +} + +//***************************************************************************** +double Ellipsoid::InverseIsometricLatitude(double psi) +{ + return m_pEllipsoid->InverseIsometricLatitude( psi ); +} + +//***************************************************************************** +double Ellipsoid::CircleRadius(double phi) +{ + return m_pEllipsoid->CircleRadius( phi ); +} + +//***************************************************************************** +double Ellipsoid::CircleHeight(double phi) +{ + return m_pEllipsoid->CircleHeight( phi ); +} + +//***************************************************************************** +double Ellipsoid::MeridianDistance(double phi) +{ + return m_pEllipsoid->MeridianDistance( phi ); +} + +//***************************************************************************** +double Ellipsoid::MeridionalCurvatureRadius(double phi) +{ + return m_pEllipsoid->MeridionalCurvatureRadius( phi ); +} + +//***************************************************************************** +double Ellipsoid::TransverseCurvatureRadius(double phi) +{ + return m_pEllipsoid->TransverseCurvatureRadius( phi ); +} + +//***************************************************************************** +double Ellipsoid::NormalCurvatureRadius(double phi, double azi) +{ + return m_pEllipsoid->NormalCurvatureRadius( phi, azi ); +} + +//***************************************************************************** +double Ellipsoid::SecondFlatteningToFlattening(double fp) +{ + return GeographicLib::Ellipsoid::SecondFlatteningToFlattening( fp ); +} + +//***************************************************************************** +double Ellipsoid::FlatteningToSecondFlattening(double f) +{ + return GeographicLib::Ellipsoid::FlatteningToSecondFlattening( f ); +} + +//***************************************************************************** +double Ellipsoid::ThirdFlatteningToFlattening(double n) +{ + return GeographicLib::Ellipsoid::ThirdFlatteningToFlattening( n ); +} + +//***************************************************************************** +double Ellipsoid::FlatteningToThirdFlattening(double f) +{ + return GeographicLib::Ellipsoid::FlatteningToThirdFlattening( f ); +} + +//***************************************************************************** +double Ellipsoid::EccentricitySqToFlattening(double e2) +{ + return GeographicLib::Ellipsoid::EccentricitySqToFlattening( e2 ); +} + +//***************************************************************************** +double Ellipsoid::FlatteningToEccentricitySq(double f) +{ + return GeographicLib::Ellipsoid::FlatteningToEccentricitySq( f ); +} + +//***************************************************************************** +double Ellipsoid::SecondEccentricitySqToFlattening(double ep2) +{ + return GeographicLib::Ellipsoid::SecondEccentricitySqToFlattening( ep2 ); +} + +//***************************************************************************** +double Ellipsoid::FlatteningToSecondEccentricitySq(double f) +{ + return GeographicLib::Ellipsoid::FlatteningToSecondEccentricitySq( f ); +} + +//***************************************************************************** +double Ellipsoid::ThirdEccentricitySqToFlattening(double epp2) +{ + return GeographicLib::Ellipsoid::ThirdEccentricitySqToFlattening( epp2 ); +} + +//***************************************************************************** +double Ellipsoid::FlatteningToThirdEccentricitySq(double f) +{ + return GeographicLib::Ellipsoid::FlatteningToThirdEccentricitySq( f ); +} + +//***************************************************************************** +double Ellipsoid::MajorRadius::get() +{ return m_pEllipsoid->MajorRadius(); } + +//***************************************************************************** +double Ellipsoid::MinorRadius::get() +{ return m_pEllipsoid->MinorRadius(); } + +//***************************************************************************** +double Ellipsoid::QuarterMeridian::get() +{ return m_pEllipsoid->QuarterMeridian(); } + +//***************************************************************************** +double Ellipsoid::Area::get() +{ return m_pEllipsoid->Area(); } + +//***************************************************************************** +double Ellipsoid::Volume::get() +{ return m_pEllipsoid->Volume(); } + +//***************************************************************************** +double Ellipsoid::Flattening::get() +{ return m_pEllipsoid->Flattening(); } + +//***************************************************************************** +double Ellipsoid::SecondFlattening::get() +{ return m_pEllipsoid->SecondFlattening(); } + +//***************************************************************************** +double Ellipsoid::ThirdFlattening::get() +{ return m_pEllipsoid->ThirdFlattening(); } + +//***************************************************************************** +double Ellipsoid::EccentricitySq::get() +{ return m_pEllipsoid->EccentricitySq(); } + +//***************************************************************************** +double Ellipsoid::SecondEccentricitySq::get() +{ return m_pEllipsoid->SecondEccentricitySq(); } + +//***************************************************************************** +double Ellipsoid::ThirdEccentricitySq::get() +{ return m_pEllipsoid->ThirdEccentricitySq(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Ellipsoid.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Ellipsoid.h new file mode 100644 index 000000000..751bf6c5a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Ellipsoid.h @@ -0,0 +1,521 @@ +/** + * \file NETGeographicLib/Ellipsoid.h + * \brief Header for NETGeographicLib::Ellipsoid class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::Ellipsoid. + * + * This class allows .NET applications to access GeographicLib::Ellipsoid. + * + * This class returns various properties of the ellipsoid and converts + * between various types of latitudes. The latitude conversions are also + * possible using the various projections supported by %GeographicLib; but + * Ellipsoid provides more direct access (sometimes using private functions + * of the projection classes). Ellipsoid::RectifyingLatitude, + * Ellipsoid::InverseRectifyingLatitude, and Ellipsoid::MeridianDistance + * provide functionality which can be provided by the Geodesic class. + * However Geodesic uses a series approximation (valid for abs \e f < 1/150), + * whereas Ellipsoid computes these quantities using EllipticFunction which + * provides accurate results even when \e f is large. Use of this class + * should be limited to −3 < \e f < 3/4 (i.e., 1/4 < b/a < 4). + * + * C# Example: + * \include example-Ellipsoid.cs + * Managed C++ Example: + * \include example-Ellipsoid.cpp + * Visual Basic Example: + * \include example-Ellipsoid.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor has been provided that assumes a WGS84 ellipsoid. + * + * The following functions are implemented as properties: + * MajorRadius, MinorRadius, QuarterMeridian, Area, Volume, Flattening, + * SecondFlattening, ThirdFlattening, EccentricitySq, SecondEccentricitySq, + * and ThirdEccentricitySq. + **********************************************************************/ + public ref class Ellipsoid + { + private: + // A pointer to the unmanaged GeographicLib::Ellipsoid + GeographicLib::Ellipsoid* m_pEllipsoid; + + // Th efinalizer frees the unmanaged memory when the object is destroyed. + !Ellipsoid(); + public: + /** \name Constructor + **********************************************************************/ + ///@{ + + /** + * Constructor for a WGS84 ellipsoid + **********************************************************************/ + Ellipsoid(); + + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @exception GeographicErr if \e a or (1 − \e f ) \e a is not + * positive. + **********************************************************************/ + Ellipsoid(double a, double f); + ///@} + + /** The destructor calls the finalizer. + **********************************************************************/ + ~Ellipsoid() + { this->!Ellipsoid(); } + + /** \name %Ellipsoid dimensions. + **********************************************************************/ + ///@{ + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e b the polar semi-axis (meters). + **********************************************************************/ + property double MinorRadius { double get(); } + + /** + * @return \e L the distance between the equator and a pole along a + * meridian (meters). For a sphere \e L = (π/2) \e a. The radius + * of a sphere with the same meridian length is \e L / (π/2). + **********************************************************************/ + property double QuarterMeridian { double get(); } + + /** + * @return \e A the total area of the ellipsoid (meters2). For + * a sphere \e A = 4π a2. The radius of a sphere + * with the same area is sqrt(\e A / (4π)). + **********************************************************************/ + property double Area { double get(); } + + /** + * @return \e V the total volume of the ellipsoid (meters3). + * For a sphere \e V = (4π / 3) a3. The radius of + * a sphere with the same volume is cbrt(\e V / (4π/3)). + **********************************************************************/ + property double Volume { double get(); } + ///@} + + /** \name %Ellipsoid shape + **********************************************************************/ + ///@{ + + /** + * @return \e f = (\e a − \e b) / \e a, the flattening of the + * ellipsoid. This is the value used in the constructor. This is zero, + * positive, or negative for a sphere, oblate ellipsoid, or prolate + * ellipsoid. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return \e f ' = (\e a − \e b) / \e b, the second flattening of + * the ellipsoid. This is zero, positive, or negative for a sphere, + * oblate ellipsoid, or prolate ellipsoid. + **********************************************************************/ + property double SecondFlattening { double get(); } + + /** + * @return \e n = (\e a − \e b) / (\e a + \e b), the third flattening + * of the ellipsoid. This is zero, positive, or negative for a sphere, + * oblate ellipsoid, or prolate ellipsoid. + **********************************************************************/ + property double ThirdFlattening { double get(); } + + /** + * @return e2 = (a2 − + * b2) / a2, the eccentricity squared + * of the ellipsoid. This is zero, positive, or negative for a sphere, + * oblate ellipsoid, or prolate ellipsoid. + **********************************************************************/ + property double EccentricitySq { double get(); } + + /** + * @return e' 2 = (a2 − + * b2) / b2, the second eccentricity + * squared of the ellipsoid. This is zero, positive, or negative for a + * sphere, oblate ellipsoid, or prolate ellipsoid. + **********************************************************************/ + property double SecondEccentricitySq { double get(); } + + /** + * @return e'' 2 = (a2 − + * b2) / (a2 + b2), + * the third eccentricity squared of the ellipsoid. This is zero, + * positive, or negative for a sphere, oblate ellipsoid, or prolate + * ellipsoid. + **********************************************************************/ + property double ThirdEccentricitySq { double get(); } + ///@} + + /** \name Latitude conversion. + **********************************************************************/ + ///@{ + + /** + * @param[in] phi the geographic latitude (degrees). + * @return β the parametric latitude (degrees). + * + * The geographic latitude, φ, is the angle beween the equatorial + * plane and a vector normal to the surface of the ellipsoid. + * + * The parametric latitude (also called the reduced latitude), β, + * allows the cartesian coordinated of a meridian to be expressed + * conveniently in parametric form as + * - \e R = \e a cos β + * - \e Z = \e b sin β + * . + * where \e a and \e b are the equatorial radius and the polar semi-axis. + * For a sphere β = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * β lies in [−90°, 90°]. + **********************************************************************/ + double ParametricLatitude(double phi); + + /** + * @param[in] beta the parametric latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * β must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + double InverseParametricLatitude(double beta); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return θ the geocentric latitude (degrees). + * + * The geocentric latitude, θ, is the angle beween the equatorial + * plane and a line between the center of the ellipsoid and a point on the + * ellipsoid. For a sphere θ = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * θ lies in [−90°, 90°]. + **********************************************************************/ + double GeocentricLatitude(double phi); + + /** + * @param[in] theta the geocentric latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * θ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + double InverseGeocentricLatitude(double theta); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return μ the rectifying latitude (degrees). + * + * The rectifying latitude, μ, has the property that the distance along + * a meridian of the ellipsoid between two points with rectifying latitudes + * μ1 and μ2 is equal to + * (μ2 - μ1) \e L / 90°, + * where \e L = QuarterMeridian(). For a sphere μ = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * μ lies in [−90°, 90°]. + **********************************************************************/ + double RectifyingLatitude(double phi); + + /** + * @param[in] mu the rectifying latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * μ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + double InverseRectifyingLatitude(double mu); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return ξ the authalic latitude (degrees). + * + * The authalic latitude, ξ, has the property that the area of the + * ellipsoid between two circles with authalic latitudes + * ξ1 and ξ2 is equal to (sin + * ξ2 - sin ξ1) \e A / 2, where \e A + * = Area(). For a sphere ξ = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * ξ lies in [−90°, 90°]. + **********************************************************************/ + double AuthalicLatitude(double phi); + + /** + * @param[in] xi the authalic latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * ξ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + double InverseAuthalicLatitude(double xi); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return χ the conformal latitude (degrees). + * + * The conformal latitude, χ, gives the mapping of the ellipsoid to a + * sphere which which is conformal (angles are preserved) and in which the + * equator of the ellipsoid maps to the equator of the sphere. For a + * sphere χ = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * χ lies in [−90°, 90°]. + **********************************************************************/ + double ConformalLatitude(double phi); + + /** + * @param[in] chi the conformal latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * χ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + double InverseConformalLatitude(double chi); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return ψ the isometric latitude (degrees). + * + * The isometric latitude gives the mapping of the ellipsoid to a plane + * which which is conformal (angles are preserved) and in which the equator + * of the ellipsoid maps to a straight line of constant scale; this mapping + * defines the Mercator projection. For a sphere ψ = + * sinh−1 tan φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + double IsometricLatitude(double phi); + + /** + * @param[in] psi the isometric latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * The returned value φ lies in [−90°, 90°]. + **********************************************************************/ + double InverseIsometricLatitude(double psi); + ///@} + + /** \name Other quantities. + **********************************************************************/ + ///@{ + + /** + * @param[in] phi the geographic latitude (degrees). + * @return \e R = \e a cos β the radius of a circle of latitude + * φ (meters). \e R (π/180°) gives meters per degree + * longitude measured along a circle of latitude. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + double CircleRadius(double phi); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return \e Z = \e b sin β the distance of a circle of latitude + * φ from the equator measured parallel to the ellipsoid axis + * (meters). + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + double CircleHeight(double phi); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return \e s the distance along a meridian + * between the equator and a point of latitude φ (meters). \e s is + * given by \e s = μ \e L / 90°, where \e L = + * QuarterMeridian()). + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + double MeridianDistance(double phi); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return ρ the meridional radius of curvature of the ellipsoid at + * latitude φ (meters); this is the curvature of the meridian. \e + * rho is given by ρ = (180°/π) d\e s / dφ, + * where \e s = MeridianDistance(); thus ρ (π/180°) + * gives meters per degree latitude measured along a meridian. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + double MeridionalCurvatureRadius(double phi); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return ν the transverse radius of curvature of the ellipsoid at + * latitude φ (meters); this is the curvature of a curve on the + * ellipsoid which also lies in a plane perpendicular to the ellipsoid + * and to the meridian. ν is related to \e R = CircleRadius() by \e + * R = ν cos φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + double TransverseCurvatureRadius(double phi); + + /** + * @param[in] phi the geographic latitude (degrees). + * @param[in] azi the angle between the meridian and the normal section + * (degrees). + * @return the radius of curvature of the ellipsoid in the normal + * section at latitude φ inclined at an angle \e azi to the + * meridian (meters). + * + * φ must lie in the range [−90°, 90°] and \e + * azi must lie in the range [−540°, 540°); the + * result is undefined if either of conditions does not hold. + **********************************************************************/ + double NormalCurvatureRadius(double phi, double azi); + ///@} + + /** \name Eccentricity conversions. + **********************************************************************/ + ///@{ + + /** + * @param[in] fp = \e f ' = (\e a − \e b) / \e b, the second + * flattening. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * \e f ' should lie in (−1, ∞). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static double SecondFlatteningToFlattening(double fp); + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return \e f ' = (\e a − \e b) / \e b, the second flattening. + * + * \e f should lie in (−∞, 1). + * The returned value \e f ' lies in (−1, ∞). + **********************************************************************/ + static double FlatteningToSecondFlattening(double f); + + /** + * @param[in] n = (\e a − \e b) / (\e a + \e b), the third + * flattening. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * \e n should lie in (−1, 1). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static double ThirdFlatteningToFlattening(double n); + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return \e n = (\e a − \e b) / (\e a + \e b), the third + * flattening. + * + * \e f should lie in (−∞, 1). + * The returned value \e n lies in (−1, 1). + **********************************************************************/ + static double FlatteningToThirdFlattening(double f); + + /** + * @param[in] e2 = e2 = (a2 − + * b2) / a2, the eccentricity + * squared. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * e2 should lie in (−∞, 1). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static double EccentricitySqToFlattening(double e2); + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return e2 = (a2 − + * b2) / a2, the eccentricity + * squared. + * + * \e f should lie in (−∞, 1). + * The returned value e2 lies in (−∞, 1). + **********************************************************************/ + static double FlatteningToEccentricitySq(double f); + + /** + * @param[in] ep2 = e' 2 = (a2 − + * b2) / b2, the second eccentricity + * squared. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * e' 2 should lie in (−1, ∞). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static double SecondEccentricitySqToFlattening(double ep2); + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return e' 2 = (a2 − + * b2) / b2, the second eccentricity + * squared. + * + * \e f should lie in (−∞, 1). + * The returned value e' 2 lies in (−1, ∞). + **********************************************************************/ + static double FlatteningToSecondEccentricitySq(double f); + + /** + * @param[in] epp2 = e'' 2 = (a2 + * − b2) / (a2 + + * b2), the third eccentricity squared. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * e'' 2 should lie in (−1, 1). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static double ThirdEccentricitySqToFlattening(double epp2); + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return e'' 2 = (a2 − + * b2) / (a2 + b2), + * the third eccentricity squared. + * + * \e f should lie in (−∞, 1). + * The returned value e'' 2 lies in (−1, 1). + **********************************************************************/ + static double FlatteningToThirdEccentricitySq(double f); + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/EllipticFunction.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/EllipticFunction.cpp new file mode 100644 index 000000000..1a05b8a56 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/EllipticFunction.cpp @@ -0,0 +1,311 @@ +/** + * \file NETGeographicLib/EllipticFunction.cpp + * \brief Implementation for NETGeographicLib::EllipticFunction class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/EllipticFunction.hpp" +#include "EllipticFunction.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for the GeographicLib::EllipticFunction."; + +//***************************************************************************** +EllipticFunction::EllipticFunction(double k2, double alpha2) +{ + try + { + m_pEllipticFunction = new GeographicLib::EllipticFunction( k2, alpha2 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +EllipticFunction::EllipticFunction(double k2, double alpha2, double kp2, double alphap2) +{ + try + { + m_pEllipticFunction = new GeographicLib::EllipticFunction( k2, alpha2, kp2, alphap2 ); + } + catch ( std::bad_alloc err ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +EllipticFunction::!EllipticFunction() +{ + if ( m_pEllipticFunction != NULL ) + { + delete m_pEllipticFunction; + m_pEllipticFunction = NULL; + } +} + +//***************************************************************************** +void EllipticFunction::Reset(double k2, double alpha2 ) +{ + m_pEllipticFunction->Reset( k2, alpha2 ); +} + +//***************************************************************************** +void EllipticFunction::Reset(double k2, double alpha2, double kp2, double alphap2) +{ + m_pEllipticFunction->Reset( k2, alpha2, kp2, alphap2 ); +} + +//***************************************************************************** +double EllipticFunction::K() +{ + return m_pEllipticFunction->K(); +} + +//***************************************************************************** +double EllipticFunction::E() +{ + return m_pEllipticFunction->E(); +} + +//***************************************************************************** +double EllipticFunction::D() +{ + return m_pEllipticFunction->D(); +} + +//***************************************************************************** +double EllipticFunction::KE() +{ + return m_pEllipticFunction->KE(); +} + +//***************************************************************************** +double EllipticFunction::Pi() +{ + return m_pEllipticFunction->Pi(); +} + +//***************************************************************************** +double EllipticFunction::G() +{ + return m_pEllipticFunction->G(); +} + +//***************************************************************************** +double EllipticFunction::H() +{ + return m_pEllipticFunction->H(); +} + +//***************************************************************************** +double EllipticFunction::F(double phi) +{ + return m_pEllipticFunction->F( phi ); +} + +//***************************************************************************** +double EllipticFunction::E(double phi) +{ + return m_pEllipticFunction->E( phi ); +} + +//***************************************************************************** +double EllipticFunction::Ed(double ang) +{ + return m_pEllipticFunction->Ed(ang); +} + +//***************************************************************************** +double EllipticFunction::Einv(double x) +{ + return m_pEllipticFunction->Einv(x); +} + +//***************************************************************************** +double EllipticFunction::Pi(double phi) +{ + return m_pEllipticFunction->Pi(phi); +} + +//***************************************************************************** +double EllipticFunction::D(double phi) +{ + return m_pEllipticFunction->D(phi); +} + +//***************************************************************************** +double EllipticFunction::G(double phi) +{ + return m_pEllipticFunction->G(phi); +} + +//***************************************************************************** +double EllipticFunction::H(double phi) +{ + return m_pEllipticFunction->H(phi); +} + +//***************************************************************************** +double EllipticFunction::F(double sn, double cn, double dn) +{ + return m_pEllipticFunction->F( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::E(double sn, double cn, double dn) +{ + return m_pEllipticFunction->E( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::Pi(double sn, double cn, double dn) +{ + return m_pEllipticFunction->Pi( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::D(double sn, double cn, double dn) +{ + return m_pEllipticFunction->D( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::G(double sn, double cn, double dn) +{ + return m_pEllipticFunction->G( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::H(double sn, double cn, double dn) +{ + return m_pEllipticFunction->H( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::deltaF(double sn, double cn, double dn) +{ + return m_pEllipticFunction->deltaF( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::deltaE(double sn, double cn, double dn) +{ + return m_pEllipticFunction->deltaE( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::deltaEinv(double stau, double ctau) +{ + return m_pEllipticFunction->deltaEinv( stau, ctau ); +} + +//***************************************************************************** +double EllipticFunction::deltaPi(double sn, double cn, double dn) +{ + return m_pEllipticFunction->deltaPi( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::deltaD(double sn, double cn, double dn) +{ + return m_pEllipticFunction->deltaD( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::deltaG(double sn, double cn, double dn) +{ + return m_pEllipticFunction->deltaG( sn, cn, dn ); +} + +//***************************************************************************** +double EllipticFunction::deltaH(double sn, double cn, double dn) +{ + return m_pEllipticFunction->deltaH( sn, cn, dn ); +} + +//***************************************************************************** +void EllipticFunction::sncndn(double x, + [System::Runtime::InteropServices::Out] double% sn, + [System::Runtime::InteropServices::Out] double% cn, + [System::Runtime::InteropServices::Out] double% dn) +{ + double lsn, lcn, ldn; + m_pEllipticFunction->sncndn( x, lsn, lcn, ldn ); + sn = lsn; + cn = lcn; + dn = ldn; +} + +//***************************************************************************** +double EllipticFunction::Delta(double sn, double cn) +{ + return m_pEllipticFunction->Delta( sn, cn ); +} + +//***************************************************************************** +double EllipticFunction::RF(double x, double y, double z) +{ + return GeographicLib::EllipticFunction::RF( x, y, z ); +} + +//***************************************************************************** +double EllipticFunction::RF(double x, double y) +{ + return GeographicLib::EllipticFunction::RF( x, y ); +} + +//***************************************************************************** +double EllipticFunction::RC(double x, double y) +{ + return GeographicLib::EllipticFunction::RC( x, y ); +} + +//***************************************************************************** +double EllipticFunction::RG(double x, double y, double z) +{ + return GeographicLib::EllipticFunction::RG( x, y, z ); +} + +//***************************************************************************** +double EllipticFunction::RG(double x, double y) +{ + return GeographicLib::EllipticFunction::RG( x, y ); +} + +//***************************************************************************** +double EllipticFunction::RJ(double x, double y, double z, double p) +{ + return GeographicLib::EllipticFunction::RJ( x, y, z, p ); +} + +//***************************************************************************** +double EllipticFunction::RD(double x, double y, double z) +{ + return GeographicLib::EllipticFunction::RD( x, y, z ); +} + +//***************************************************************************** +double EllipticFunction::k2::get() +{ return m_pEllipticFunction->k2(); } + +//***************************************************************************** +double EllipticFunction::kp2::get() +{ return m_pEllipticFunction->kp2(); } + +//***************************************************************************** +double EllipticFunction::alpha2::get() +{ return m_pEllipticFunction->alpha2(); } + +//***************************************************************************** +double EllipticFunction::alphap2::get() +{ return m_pEllipticFunction->alpha2(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/EllipticFunction.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/EllipticFunction.h new file mode 100644 index 000000000..e62442a49 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/EllipticFunction.h @@ -0,0 +1,698 @@ +/** + * \file NETGeographicLib/EllipticFunction.h + * \brief Header for NETGeographicLib::EllipticFunction class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::EllipticFunction. + * + * This class allows .NET applications to access GeographicLib::EllipticFunction. + * + * This provides the elliptic functions and integrals needed for Ellipsoid, + * GeodesicExact, and TransverseMercatorExact. Two categories of function + * are provided: + * - \e static functions to compute symmetric elliptic integrals + * (http://dlmf.nist.gov/19.16.i) + * - \e member functions to compute Legrendre's elliptic + * integrals (http://dlmf.nist.gov/19.2.ii) and the + * Jacobi elliptic functions (http://dlmf.nist.gov/22.2). + * . + * In the latter case, an object is constructed giving the modulus \e k (and + * optionally the parameter α2). The modulus is always + * passed as its square k2 which allows \e k to be pure + * imaginary (k2 < 0). (Confusingly, Abramowitz and + * Stegun call \e m = k2 the "parameter" and \e n = + * α2 the "characteristic".) + * + * In geodesic applications, it is convenient to separate the incomplete + * integrals into secular and periodic components, e.g., + * \f[ + * E(\phi, k) = (2 E(\phi) / \pi) [ \phi + \delta E(\phi, k) ] + * \f] + * where δ\e E(φ, \e k) is an odd periodic function with period + * π. + * + * The computation of the elliptic integrals uses the algorithms given in + * - B. C. Carlson, + * Computation of real or + * complex elliptic integrals, Numerical Algorithms 10, 13--26 (1995) + * . + * with the additional optimizations given in http://dlmf.nist.gov/19.36.i. + * The computation of the Jacobi elliptic functions uses the algorithm given + * in + * - R. Bulirsch, + * Numerical Calculation of + * Elliptic Integrals and Elliptic Functions, Numericshe Mathematik 7, + * 78--90 (1965). + * . + * The notation follows http://dlmf.nist.gov/19 and http://dlmf.nist.gov/22 + * + * C# Example: + * \include example-EllipticFunction.cs + * Managed C++ Example: + * \include example-EllipticFunction.cpp + * Visual Basic Example: + * \include example-EllipticFunction.vb + * + * INTERFACE DIFFERENCES:
+ * The k2, kp2, alpha2, and alphap2 functions are implemented as properties. + **********************************************************************/ + public ref class EllipticFunction + { + private: + // a pointer to the unmanaged GeographicLib::EllipticFunction. + GeographicLib::EllipticFunction* m_pEllipticFunction; + + // The finalizer frees the unmanaged memory. + !EllipticFunction(); + public: + /** \name Constructor + **********************************************************************/ + ///@{ + /** + * Constructor specifying the modulus and parameter. + * + * @param[in] k2 the square of the modulus k2. + * k2 must lie in (-∞, 1). (No checking is + * done.) + * @param[in] alpha2 the parameter α2. + * α2 must lie in (-∞, 1). (No checking is done.) + * + * If only elliptic integrals of the first and second kinds are needed, + * then set α2 = 0 (the default value); in this case, we + * have Π(φ, 0, \e k) = \e F(φ, \e k), \e G(φ, 0, \e k) = \e + * E(φ, \e k), and \e H(φ, 0, \e k) = \e F(φ, \e k) - \e + * D(φ, \e k). + **********************************************************************/ + EllipticFunction(double k2, double alpha2 ); + + /** + * Constructor specifying the modulus and parameter and their complements. + * + * @param[in] k2 the square of the modulus k2. + * k2 must lie in (-∞, 1). (No checking is + * done.) + * @param[in] alpha2 the parameter α2. + * α2 must lie in (-∞, 1). (No checking is done.) + * @param[in] kp2 the complementary modulus squared k'2 = + * 1 − k2. + * @param[in] alphap2 the complementary parameter α'2 = 1 + * − α2. + * + * The arguments must satisfy \e k2 + \e kp2 = 1 and \e alpha2 + \e alphap2 + * = 1. (No checking is done that these conditions are met.) This + * constructor is provided to enable accuracy to be maintained, e.g., when + * \e k is very close to unity. + **********************************************************************/ + EllipticFunction(double k2, double alpha2, double kp2, double alphap2); + + /** + * Destructor calls the finalizer. + **********************************************************************/ + ~EllipticFunction() + { this->!EllipticFunction(); } + + /** + * Reset the modulus and parameter. + * + * @param[in] k2 the new value of square of the modulus + * k2 which must lie in (-∞, 1). (No checking is + * done.) + * @param[in] alpha2 the new value of parameter α2. + * α2 must lie in (-∞, 1). (No checking is done.) + **********************************************************************/ + void Reset(double k2, double alpha2 ); + + /** + * Reset the modulus and parameter supplying also their complements. + * + * @param[in] k2 the square of the modulus k2. + * k2 must lie in (-∞, 1). (No checking is + * done.) + * @param[in] alpha2 the parameter α2. + * α2 must lie in (-∞, 1). (No checking is done.) + * @param[in] kp2 the complementary modulus squared k'2 = + * 1 − k2. + * @param[in] alphap2 the complementary parameter α'2 = 1 + * − α2. + * + * The arguments must satisfy \e k2 + \e kp2 = 1 and \e alpha2 + \e alphap2 + * = 1. (No checking is done that these conditions are met.) This + * constructor is provided to enable accuracy to be maintained, e.g., when + * is very small. + **********************************************************************/ + void Reset(double k2, double alpha2, double kp2, double alphap2); + + ///@} + + /** \name Inspector functions. + **********************************************************************/ + ///@{ + /** + * @return the square of the modulus k2. + **********************************************************************/ + property double k2 { double get(); } + + /** + * @return the square of the complementary modulus k'2 = + * 1 − k2. + **********************************************************************/ + property double kp2 { double get(); } + + /** + * @return the parameter α2. + **********************************************************************/ + property double alpha2 { double get(); } + + /** + * @return the complementary parameter α'2 = 1 − + * α2. + **********************************************************************/ + property double alphap2 { double get(); } + ///@} + + /** \name Complete elliptic integrals. + **********************************************************************/ + ///@{ + /** + * The complete integral of the first kind. + * + * @return \e K(\e k). + * + * \e K(\e k) is defined in http://dlmf.nist.gov/19.2.E4 + * \f[ + * K(k) = \int_0^{\pi/2} \frac1{\sqrt{1-k^2\sin^2\phi}}\,d\phi. + * \f] + **********************************************************************/ + double K(); + + /** + * The complete integral of the second kind. + * + * @return \e E(\e k) + * + * \e E(\e k) is defined in http://dlmf.nist.gov/19.2.E5 + * \f[ + * E(k) = \int_0^{\pi/2} \sqrt{1-k^2\sin^2\phi}\,d\phi. + * \f] + **********************************************************************/ + double E(); + + /** + * Jahnke's complete integral. + * + * @return \e D(\e k). + * + * \e D(\e k) is defined in http://dlmf.nist.gov/19.2.E6 + * \f[ + * D(k) = \int_0^{\pi/2} \frac{\sin^2\phi}{\sqrt{1-k^2\sin^2\phi}}\,d\phi. + * \f] + **********************************************************************/ + double D(); + + /** + * The difference between the complete integrals of the first and second + * kinds. + * + * @return \e K(\e k) − \e E(\e k). + **********************************************************************/ + double KE(); + + /** + * The complete integral of the third kind. + * + * @return Π(α2, \e k) + * + * Π(α2, \e k) is defined in + * http://dlmf.nist.gov/19.2.E7 + * \f[ + * \Pi(\alpha^2, k) = \int_0^{\pi/2} + * \frac1{\sqrt{1-k^2\sin^2\phi}(1 - \alpha^2\sin^2\phi_)}\,d\phi. + * \f] + **********************************************************************/ + double Pi(); + + /** + * Legendre's complete geodesic longitude integral. + * + * @return \e G(α2, \e k) + * + * \e G(α2, \e k) is given by + * \f[ + * G(\alpha^2, k) = \int_0^{\pi/2} + * \frac{\sqrt{1-k^2\sin^2\phi}}{1 - \alpha^2\sin^2\phi}\,d\phi. + * \f] + **********************************************************************/ + double G(); + + /** + * Cayley's complete geodesic longitude difference integral. + * + * @return \e H(α2, \e k) + * + * \e H(α2, \e k) is given by + * \f[ + * H(\alpha^2, k) = \int_0^{\pi/2} + * \frac{\cos^2\phi}{(1-\alpha^2\sin^2\phi)\sqrt{1-k^2\sin^2\phi}} + * \,d\phi. + * \f] + **********************************************************************/ + double H(); + ///@} + + /** \name Incomplete elliptic integrals. + **********************************************************************/ + ///@{ + /** + * The incomplete integral of the first kind. + * + * @param[in] phi + * @return \e F(φ, \e k). + * + * \e F(φ, \e k) is defined in http://dlmf.nist.gov/19.2.E4 + * \f[ + * F(\phi, k) = \int_0^\phi \frac1{\sqrt{1-k^2\sin^2\theta}}\,d\theta. + * \f] + **********************************************************************/ + double F(double phi); + + /** + * The incomplete integral of the second kind. + * + * @param[in] phi + * @return \e E(φ, \e k). + * + * \e E(φ, \e k) is defined in http://dlmf.nist.gov/19.2.E5 + * \f[ + * E(\phi, k) = \int_0^\phi \sqrt{1-k^2\sin^2\theta}\,d\theta. + * \f] + **********************************************************************/ + double E(double phi); + + /** + * The incomplete integral of the second kind with the argument given in + * degrees. + * + * @param[in] ang in degrees. + * @return \e E(π ang/180, \e k). + **********************************************************************/ + double Ed(double ang); + + /** + * The inverse of the incomplete integral of the second kind. + * + * @param[in] x + * @return φ = E−1(\e x, \e k); i.e., the + * solution of such that \e E(φ, \e k) = \e x. + **********************************************************************/ + double Einv(double x); + + /** + * The incomplete integral of the third kind. + * + * @param[in] phi + * @return Π(φ, α2, \e k). + * + * Π(φ, α2, \e k) is defined in + * http://dlmf.nist.gov/19.2.E7 + * \f[ + * \Pi(\phi, \alpha^2, k) = \int_0^\phi + * \frac1{\sqrt{1-k^2\sin^2\theta}(1 - \alpha^2\sin^2\theta_)}\,d\theta. + * \f] + **********************************************************************/ + double Pi(double phi); + + /** + * Jahnke's incomplete elliptic integral. + * + * @param[in] phi + * @return \e D(φ, \e k). + * + * \e D(φ, \e k) is defined in http://dlmf.nist.gov/19.2.E4 + * \f[ + * D(\phi, k) = \int_0^\phi + * \frac{\sin^2\theta}{\sqrt{1-k^2\sin^2\theta}}\,d\theta. + * \f] + **********************************************************************/ + double D(double phi); + + /** + * Legendre's geodesic longitude integral. + * + * @param[in] phi + * @return \e G(φ, α2, \e k). + * + * \e G(φ, α2, \e k) is defined by + * \f[ + * \begin{aligned} + * G(\phi, \alpha^2, k) &= + * \frac{k^2}{\alpha^2} F(\phi, k) + + * \biggl(1 - \frac{k^2}{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\ + * &= \int_0^\phi + * \frac{\sqrt{1-k^2\sin^2\theta}}{1 - \alpha^2\sin^2\theta}\,d\theta. + * \end{aligned} + * \f] + * + * Legendre expresses the longitude of a point on the geodesic in terms of + * this combination of elliptic integrals in Exercices de Calcul + * Intégral, Vol. 1 (1811), p. 181, + * http://books.google.com/books?id=riIOAAAAQAAJ&pg=PA181. + * + * See \ref geodellip for the expression for the longitude in terms of this + * function. + **********************************************************************/ + double G(double phi); + + /** + * Cayley's geodesic longitude difference integral. + * + * @param[in] phi + * @return \e H(φ, α2, \e k). + * + * \e H(φ, α2, \e k) is defined by + * \f[ + * \begin{aligned} + * H(\phi, \alpha^2, k) &= + * \frac1{\alpha^2} F(\phi, k) + + * \biggl(1 - \frac1{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\ + * &= \int_0^\phi + * \frac{\cos^2\theta}{(1-\alpha^2\sin^2\theta)\sqrt{1-k^2\sin^2\theta}} + * \,d\theta. + * \end{aligned} + * \f] + * + * Cayley expresses the longitude difference of a point on the geodesic in + * terms of this combination of elliptic integrals in Phil. Mag. 40 + * (1870), p. 333, http://books.google.com/books?id=Zk0wAAAAIAAJ&pg=PA333. + * + * See \ref geodellip for the expression for the longitude in terms of this + * function. + **********************************************************************/ + double H(double phi); + ///@} + + /** \name Incomplete integrals in terms of Jacobi elliptic functions. + **********************************************************************/ + /** + * The incomplete integral of the first kind in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e F(φ, \e k) as though φ ∈ (−π, π]. + **********************************************************************/ + double F(double sn, double cn, double dn); + + /** + * The incomplete integral of the second kind in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e E(φ, \e k) as though φ ∈ (−π, π]. + **********************************************************************/ + double E(double sn, double cn, double dn); + + /** + * The incomplete integral of the third kind in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return Π(φ, α2, \e k) as though φ ∈ + * (−π, π]. + **********************************************************************/ + double Pi(double sn, double cn, double dn); + + /** + * Jahnke's incomplete elliptic integral in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e D(φ, \e k) as though φ ∈ (−π, π]. + **********************************************************************/ + double D(double sn, double cn, double dn); + + /** + * Legendre's geodesic longitude integral in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e G(φ, α2, \e k) as though φ ∈ + * (−π, π]. + **********************************************************************/ + double G(double sn, double cn, double dn); + + /** + * Cayley's geodesic longitude difference integral in terms of Jacobi + * elliptic functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e H(φ, α2, \e k) as though φ ∈ + * (−π, π]. + **********************************************************************/ + double H(double sn, double cn, double dn); + ///@} + + /** \name Periodic versions of incomplete elliptic integrals. + **********************************************************************/ + ///@{ + /** + * The periodic incomplete integral of the first kind. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e F(φ, \e k) / (2 \e K(\e k)) - + * φ + **********************************************************************/ + double deltaF(double sn, double cn, double dn); + + /** + * The periodic incomplete integral of the second kind. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e E(φ, \e k) / (2 \e E(\e k)) - + * φ + **********************************************************************/ + double deltaE(double sn, double cn, double dn); + + /** + * The periodic inverse of the incomplete integral of the second kind. + * + * @param[in] stau = sinτ + * @param[in] ctau = sinτ + * @return the periodic function E−1(τ (2 \e + * E(\e k)/π), \e k) - τ + **********************************************************************/ + double deltaEinv(double stau, double ctau); + + /** + * The periodic incomplete integral of the third kind. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π Π(φ, \e k) / (2 Π(\e k)) - + * φ + **********************************************************************/ + double deltaPi(double sn, double cn, double dn); + + /** + * The periodic Jahnke's incomplete elliptic integral. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e D(φ, \e k) / (2 \e D(\e k)) - + * φ + **********************************************************************/ + double deltaD(double sn, double cn, double dn); + + /** + * Legendre's periodic geodesic longitude integral. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e G(φ, \e k) / (2 \e G(\e k)) - + * φ + **********************************************************************/ + double deltaG(double sn, double cn, double dn); + + /** + * Cayley's periodic geodesic longitude difference integral. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e H(φ, \e k) / (2 \e H(\e k)) - + * φ + **********************************************************************/ + double deltaH(double sn, double cn, double dn); + ///@} + + /** \name Elliptic functions. + **********************************************************************/ + ///@{ + /** + * The Jacobi elliptic functions. + * + * @param[in] x the argument. + * @param[out] sn sn(\e x, \e k). + * @param[out] cn cn(\e x, \e k). + * @param[out] dn dn(\e x, \e k). + **********************************************************************/ + void sncndn(double x, + [System::Runtime::InteropServices::Out] double% sn, + [System::Runtime::InteropServices::Out] double% cn, + [System::Runtime::InteropServices::Out] double% dn); + + /** + * The Δ amplitude function. + * + * @param[in] sn sinφ + * @param[in] cn cosφ + * @return Δ = sqrt(1 − k2 + * sin2φ) + **********************************************************************/ + double Delta(double sn, double cn); + ///@} + + /** \name Symmetric elliptic integrals. + **********************************************************************/ + ///@{ + /** + * Symmetric integral of the first kind RF. + * + * @param[in] x + * @param[in] y + * @param[in] z + * @return RF(\e x, \e y, \e z) + * + * RF is defined in http://dlmf.nist.gov/19.16.E1 + * \f[ R_F(x, y, z) = \frac12 + * \int_0^\infty\frac1{\sqrt{(t + x) (t + y) (t + z)}}\, dt \f] + * If one of the arguments is zero, it is more efficient to call the + * two-argument version of this function with the non-zero arguments. + **********************************************************************/ + static double RF(double x, double y, double z); + + /** + * Complete symmetric integral of the first kind, RF with + * one argument zero. + * + * @param[in] x + * @param[in] y + * @return RF(\e x, \e y, 0) + **********************************************************************/ + static double RF(double x, double y); + + /** + * Degenerate symmetric integral of the first kind RC. + * + * @param[in] x + * @param[in] y + * @return RC(\e x, \e y) = RF(\e x, \e + * y, \e y) + * + * RC is defined in http://dlmf.nist.gov/19.2.E17 + * \f[ R_C(x, y) = \frac12 + * \int_0^\infty\frac1{\sqrt{t + x}(t + y)}\,dt \f] + **********************************************************************/ + static double RC(double x, double y); + + /** + * Symmetric integral of the second kind RG. + * + * @param[in] x + * @param[in] y + * @param[in] z + * @return RG(\e x, \e y, \e z) + * + * RG is defined in Carlson, eq 1.5 + * \f[ R_G(x, y, z) = \frac14 + * \int_0^\infty[(t + x) (t + y) (t + z)]^{-1/2} + * \biggl( + * \frac x{t + x} + \frac y{t + y} + \frac z{t + z} + * \biggr)t\,dt \f] + * See also http://dlmf.nist.gov/19.16.E3. + * If one of the arguments is zero, it is more efficient to call the + * two-argument version of this function with the non-zero arguments. + **********************************************************************/ + static double RG(double x, double y, double z); + + /** + * Complete symmetric integral of the second kind, RG + * with one argument zero. + * + * @param[in] x + * @param[in] y + * @return RG(\e x, \e y, 0) + **********************************************************************/ + static double RG(double x, double y); + + /** + * Symmetric integral of the third kind RJ. + * + * @param[in] x + * @param[in] y + * @param[in] z + * @param[in] p + * @return RJ(\e x, \e y, \e z, \e p) + * + * RJ is defined in http://dlmf.nist.gov/19.16.E2 + * \f[ R_J(x, y, z, p) = \frac32 + * \int_0^\infty[(t + x) (t + y) (t + z)]^{-1/2} (t + p)^{-1}\, dt \f] + **********************************************************************/ + static double RJ(double x, double y, double z, double p); + + /** + * Degenerate symmetric integral of the third kind RD. + * + * @param[in] x + * @param[in] y + * @param[in] z + * @return RD(\e x, \e y, \e z) = RJ(\e + * x, \e y, \e z, \e z) + * + * RD is defined in http://dlmf.nist.gov/19.16.E5 + * \f[ R_D(x, y, z) = \frac32 + * \int_0^\infty[(t + x) (t + y)]^{-1/2} (t + z)^{-3/2}\, dt \f] + **********************************************************************/ + static double RD(double x, double y, double z); + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeoCoords.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeoCoords.cpp new file mode 100644 index 000000000..a060068a1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeoCoords.cpp @@ -0,0 +1,243 @@ +/** + * \file NETGeographicLib/GeoCoords.cpp + * \brief Implementation for NETGeographicLib::GeoCoords class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/GeoCoords.hpp" +#include "GeoCoords.h" +#include "UTMUPS.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::GeoCoords"; + +//***************************************************************************** +GeoCoords::!GeoCoords(void) +{ + if ( m_pGeoCoords != NULL ) + { + delete m_pGeoCoords; + m_pGeoCoords = NULL; + } +} + +//***************************************************************************** +GeoCoords::GeoCoords() +{ + try + { + m_pGeoCoords = new GeographicLib::GeoCoords(); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +GeoCoords::GeoCoords(System::String^ s, bool centerp, bool swaplatlong ) +{ + try + { + m_pGeoCoords = new GeographicLib::GeoCoords(StringConvert::ManagedToUnmanaged(s), centerp, swaplatlong); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +GeoCoords::GeoCoords(double latitude, double longitude, int zone ) +{ + try + { + m_pGeoCoords = new GeographicLib::GeoCoords(latitude, longitude, zone); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +GeoCoords::GeoCoords(int zone, bool northp, double easting, double northing) +{ + try + { + m_pGeoCoords = new GeographicLib::GeoCoords(zone, northp, easting, northing); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void GeoCoords::Reset( System::String^ s, bool centerp, bool swaplatlong ) +{ + try + { + m_pGeoCoords->Reset(StringConvert::ManagedToUnmanaged(s), centerp, swaplatlong); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void GeoCoords::Reset(double latitude, double longitude, int zone) +{ + try + { + m_pGeoCoords->Reset(latitude, longitude, zone); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void GeoCoords::Reset(int zone, bool northp, double easting, double northing) +{ + try + { + m_pGeoCoords->Reset(zone, northp, easting, northing); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void GeoCoords::AltZone::set( int zone ) +{ + try + { + m_pGeoCoords->SetAltZone(zone); + } + catch ( GeographicLib::GeographicErr err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +int GeoCoords::AltZone::get() { return m_pGeoCoords->AltZone(); } + +//***************************************************************************** +double GeoCoords::Latitude::get() { return m_pGeoCoords->Latitude(); } + +//***************************************************************************** +double GeoCoords::Longitude::get() { return m_pGeoCoords->Longitude(); } + +//***************************************************************************** +double GeoCoords::Easting::get() { return m_pGeoCoords->Easting(); } + +//***************************************************************************** +double GeoCoords::Northing::get() { return m_pGeoCoords->Northing(); } + +//***************************************************************************** +double GeoCoords::Convergence::get() { return m_pGeoCoords->Convergence(); } + +//***************************************************************************** +double GeoCoords::Scale::get() { return m_pGeoCoords->Scale(); } + +//***************************************************************************** +bool GeoCoords::Northp::get() { return m_pGeoCoords->Northp(); } + +//***************************************************************************** +char GeoCoords::Hemisphere::get() { return m_pGeoCoords->Hemisphere(); } + +//***************************************************************************** +int GeoCoords::Zone::get() { return m_pGeoCoords->Zone(); } + +//***************************************************************************** +double GeoCoords::AltEasting::get() { return m_pGeoCoords->AltEasting(); } + +//***************************************************************************** +double GeoCoords::AltNorthing::get() { return m_pGeoCoords->AltNorthing(); } + +//***************************************************************************** +double GeoCoords::AltConvergence::get() +{ return m_pGeoCoords->AltConvergence(); } + +//***************************************************************************** +double GeoCoords::AltScale::get() { return m_pGeoCoords->AltScale(); } + +//***************************************************************************** +double GeoCoords::MajorRadius::get() { return UTMUPS::MajorRadius(); } + +//***************************************************************************** +double GeoCoords::Flattening::get() { return UTMUPS::Flattening(); } + +//***************************************************************************** +System::String^ GeoCoords::GeoRepresentation(int prec, bool swaplatlong ) +{ + return gcnew System::String( m_pGeoCoords->GeoRepresentation(prec, swaplatlong).c_str() ); +} + +//***************************************************************************** +System::String^ GeoCoords::DMSRepresentation(int prec, bool swaplatlong, + char dmssep ) +{ + return gcnew System::String( m_pGeoCoords->DMSRepresentation(prec, swaplatlong, dmssep).c_str() ); +} + +//***************************************************************************** +System::String^ GeoCoords::MGRSRepresentation(int prec) +{ + return gcnew System::String( m_pGeoCoords->MGRSRepresentation(prec).c_str() ); +} + +//***************************************************************************** +System::String^ GeoCoords::UTMUPSRepresentation(int prec) +{ + return gcnew System::String( m_pGeoCoords->UTMUPSRepresentation(prec).c_str() ); +} + +//***************************************************************************** +System::String^ GeoCoords::UTMUPSRepresentation(bool northp, int prec) +{ + return gcnew System::String( m_pGeoCoords->UTMUPSRepresentation(northp, prec).c_str() ); +} + +//***************************************************************************** +System::String^ GeoCoords::AltMGRSRepresentation(int prec) +{ + return gcnew System::String( m_pGeoCoords->AltMGRSRepresentation(prec).c_str() ); +} + +//***************************************************************************** +System::String^ GeoCoords::AltUTMUPSRepresentation(int prec) +{ + return gcnew System::String( m_pGeoCoords->AltUTMUPSRepresentation(prec).c_str() ); +} + +//***************************************************************************** +System::String^ GeoCoords::AltUTMUPSRepresentation(bool northp, int prec) +{ + return gcnew System::String( m_pGeoCoords->AltUTMUPSRepresentation(northp, prec).c_str() ); +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeoCoords.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeoCoords.h new file mode 100644 index 000000000..bbc012a17 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeoCoords.h @@ -0,0 +1,474 @@ +/** + * \file NETGeographicLib/GeoCoords.h + * \brief Header for NETGeographicLib::GeoCoords class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::GeoCoords. + * + * This class allows .NET applications to access GeographicLib::GeoCoords. + * + * This class stores a geographic position which may be set via the + * constructors or Reset via + * - latitude and longitude + * - UTM or UPS coordinates + * - a string representation of these or an MGRS coordinate string + * + * The state consists of the latitude and longitude and the supplied UTM or + * UPS coordinates (possibly derived from the MGRS coordinates). If latitude + * and longitude were given then the UTM/UPS coordinates follows the standard + * conventions. + * + * The mutable state consists of the UTM or UPS coordinates for a alternate + * zone. A method SetAltZone is provided to set the alternate UPS/UTM zone. + * + * Methods are provided to return the geographic coordinates, the input UTM + * or UPS coordinates (and associated meridian convergence and scale), or + * alternate UTM or UPS coordinates (and their associated meridian + * convergence and scale). + * + * Once the input string has been parsed, you can print the result out in any + * of the formats, decimal degrees, degrees minutes seconds, MGRS, UTM/UPS. + * + * C# Example: + * \include example-GeoCoords.cs + * Managed C++ Example: + * \include example-GeoCoords.cpp + * Visual Basic Example: + * \include example-GeoCoords.vb + * + * INTERFACE DIFFERENCES:
+ * The following functions are implemented as properties: MajorRadius, + * Flattening, Latitude, Longitude, Easting, Northing, Convergence, + * Scale, Northp, Hemisphere, Zone, AltZone, AltEasting, AltNorthing, + * AltConvergence, and AltScale. + **********************************************************************/ + public ref class GeoCoords + { + private: + // pointer to the unmanaged GeographicLib::GeoCoords + GeographicLib::GeoCoords* m_pGeoCoords; + + // The finalizer frees unmanaged memory when the object is destroyed. + !GeoCoords(); + public: + /** \name Initializing the GeoCoords object + **********************************************************************/ + ///@{ + /** + * The default constructor is equivalent to \e latitude = 90°, + * \e longitude = 0°. + **********************************************************************/ + GeoCoords(); + + /** + * Construct from a string. + * + * @param[in] s 1-element, 2-element, or 3-element string representation of + * the position. + * @param[in] centerp governs the interpretation of MGRS coordinates (see + * below). + * @param[in] swaplatlong governs the interpretation of geographic + * coordinates (see below). + * @exception GeographicErr if the \e s is malformed (see below). + * + * Parse as a string and interpret it as a geographic position. The input + * string is broken into space (or comma) separated pieces and Basic + * decision on which format is based on number of components + * -# MGRS + * -# "Lat Long" or "Long Lat" + * -# "Zone Easting Northing" or "Easting Northing Zone" + * + * The following inputs are approximately the same (Ar Ramadi Bridge, Iraq) + * - Latitude and Longitude + * - 33.44 43.27 + * - N33d26.4' E43d16.2' + * - 43d16'12"E 33d26'24"N + * - 43:16:12E 33:26:24 + * - MGRS + * - 38SLC301 + * - 38SLC391014 + * - 38SLC3918701405 + * - 37SHT9708 + * - UTM + * - 38N 339188 3701405 + * - 897039 3708229 37N + * + * Latitude and Longitude parsing: Latitude precedes longitude, + * unless a N, S, E, W hemisphere designator is used on one or both + * coordinates. If \e swaplatlong = true (default is false), then + * longitude precedes latitude in the absence of a hemisphere designator. + * Thus (with \e swaplatlong = false) + * - 40 -75 + * - N40 W75 + * - -75 N40 + * - 75W 40N + * - E-75 -40S + * . + * are all the same position. The coordinates may be given in + * decimal degrees, degrees and decimal minutes, degrees, minutes, + * seconds, etc. Use d, ', and " to mark off the degrees, + * minutes and seconds. Various alternative symbols for degrees, minutes, + * and seconds are allowed. Alternatively, use : to separate these + * components. (See DMS::Decode for details.) Thus + * - 40d30'30" + * - 40d30'30 + * - 40°30'30 + * - 40d30.5' + * - 40d30.5 + * - 40:30:30 + * - 40:30.5 + * - 40.508333333 + * . + * all specify the same angle. The leading sign applies to all components + * so -1d30 is -(1+30/60) = -1.5. Latitudes must be in the range + * [−90°, 90°] and longitudes in the range + * [−540°, 540°). Internally longitudes are reduced + * to the range [−180°, 180°). + * + * UTM/UPS parsing: For UTM zones (−80° ≤ Lat < + * 84°), the zone designator is made up of a zone number (for 1 to 60) + * and a hemisphere letter (N or S), e.g., 38N. The latitude zone designer + * ([C--M] in the southern hemisphere and [N--X] in the northern) should + * NOT be used. (This is part of the MGRS coordinate.) The zone + * designator for the poles (where UPS is employed) is a hemisphere letter + * by itself, i.e., N or S. + * + * MGRS parsing interprets the grid references as square area at the + * specified precision (1m, 10m, 100m, etc.). If \e centerp = true (the + * default), the center of this square is then taken to be the precise + * position; thus: + * - 38SMB = 38N 450000 3650000 + * - 38SMB4484 = 38N 444500 3684500 + * - 38SMB44148470 = 38N 444145 3684705 + * . + * Otherwise, the "south-west" corner of the square is used, i.e., + * - 38SMB = 38N 400000 3600000 + * - 38SMB4484 = 38N 444000 3684000 + * - 38SMB44148470 = 38N 444140 3684700 + **********************************************************************/ + GeoCoords(System::String^ s, bool centerp, bool swaplatlong ); + + /** + * Construct from geographic coordinates. + * + * @param[in] latitude (degrees). + * @param[in] longitude (degrees). + * @param[in] zone if specified, force the UTM/UPS representation to use a + * specified zone using the rules given in UTMUPS::zonespec. + * @exception GeographicErr if \e latitude is not in [−90°, + * 90°]. + * @exception GeographicErr if \e longitude is not in [−540°, + * 540°). + * @exception GeographicErr if \e zone cannot be used for this location. + **********************************************************************/ + GeoCoords(double latitude, double longitude, int zone ); + + /** + * Construct from UTM/UPS coordinates. + * + * @param[in] zone UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] easting (meters). + * @param[in] northing (meters). + * @exception GeographicErr if \e zone, \e easting, or \e northing is + * outside its allowed range. + **********************************************************************/ + GeoCoords(int zone, bool northp, double easting, double northing); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~GeoCoords() { this->!GeoCoords(); } + + /** + * Reset the location from a string. See + * GeoCoords(const std::string& s, bool centerp, bool swaplatlong). + * + * @param[in] s 1-element, 2-element, or 3-element string representation of + * the position. + * @param[in] centerp governs the interpretation of MGRS coordinates. + * @param[in] swaplatlong governs the interpretation of geographic + * coordinates. + * @exception GeographicErr if the \e s is malformed. + **********************************************************************/ + void Reset( System::String^ s, bool centerp, bool swaplatlong); + + /** + * Reset the location in terms of geographic coordinates. See + * GeoCoords(double latitude, double longitude, int zone). + * + * @param[in] latitude (degrees). + * @param[in] longitude (degrees). + * @param[in] zone if specified, force the UTM/UPS representation to use a + * specified zone using the rules given in UTMUPS::zonespec. + * @exception GeographicErr if \e latitude is not in [−90°, + * 90°]. + * @exception GeographicErr if \e longitude is not in [−540°, + * 540°). + * @exception GeographicErr if \e zone cannot be used for this location. + **********************************************************************/ + void Reset(double latitude, double longitude, int zone ) ; + + /** + * Reset the location in terms of UPS/UPS coordinates. See + * GeoCoords(int zone, bool northp, double easting, double northing). + * + * @param[in] zone UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] easting (meters). + * @param[in] northing (meters). + * @exception GeographicErr if \e zone, \e easting, or \e northing is + * outside its allowed range. + **********************************************************************/ + void Reset(int zone, bool northp, double easting, double northing); + ///@} + + /** \name Querying the GeoCoords object + **********************************************************************/ + ///@{ + /** + * @return latitude (degrees) + **********************************************************************/ + property double Latitude { double get(); } + + /** + * @return longitude (degrees) + **********************************************************************/ + property double Longitude { double get(); } + + /** + * @return easting (meters) + **********************************************************************/ + property double Easting { double get(); } + + /** + * @return northing (meters) + **********************************************************************/ + property double Northing { double get(); } + + /** + * @return meridian convergence (degrees) for the UTM/UPS projection. + **********************************************************************/ + property double Convergence { double get(); } + + /** + * @return scale for the UTM/UPS projection. + **********************************************************************/ + property double Scale { double get(); } + + /** + * @return hemisphere (false means south, true means north). + **********************************************************************/ + property bool Northp { bool get(); } + + /** + * @return hemisphere letter N or S. + **********************************************************************/ + property char Hemisphere { char get(); } + + /** + * @return the zone corresponding to the input (return 0 for UPS). + **********************************************************************/ + property int Zone { int get(); } + + /** + * Gets/Sets the current alternate zone (0 = UPS). + * @exception GeographicErr if \e zone cannot be used for this location. + * + * See UTMUPS::zonespec for more information on the interpretation of \e + * zone. Note that \e zone == UTMUPS::STANDARD (the default) use the + * standard UPS or UTM zone, UTMUPS::MATCH does nothing retaining the + * existing alternate representation. Before this is called the alternate + * zone is the input zone. + **********************************************************************/ + property int AltZone + { + int get(); + void set( int zone ); + } + ///@} + + /** + * @return easting (meters) for alternate zone. + **********************************************************************/ + property double AltEasting { double get(); } + + /** + * @return northing (meters) for alternate zone. + **********************************************************************/ + property double AltNorthing { double get(); } + + /** + * @return meridian convergence (degrees) for alternate zone. + **********************************************************************/ + property double AltConvergence { double get(); } + + /** + * @return scale for alternate zone. + **********************************************************************/ + property double AltScale { double get(); } + ///@} + + /** \name String representations of the GeoCoords object + **********************************************************************/ + ///@{ + /** + * String representation with latitude and longitude as signed decimal + * degrees. + * + * @param[in] prec precision (relative to about 1m). + * @param[in] swaplatlong if true give longitude first (default = false) + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return decimal latitude/longitude string representation. + * + * Precision specifies accuracy of representation as follows: + * - prec = −5 (min), 1° + * - prec = 0, 10−5° (about 1m) + * - prec = 3, 10−8° + * - prec = 9 (max), 10−14° + **********************************************************************/ + System::String^ GeoRepresentation(int prec, bool swaplatlong ); + + /** + * String representation with latitude and longitude as degrees, minutes, + * seconds, and hemisphere. + * + * @param[in] prec precision (relative to about 1m) + * @param[in] swaplatlong if true give longitude first (default = false) + * @param[in] dmssep if non-null, use as the DMS separator character + * (instead of d, ', " delimiters). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return DMS latitude/longitude string representation. + * + * Precision specifies accuracy of representation as follows: + * - prec = −5 (min), 1° + * - prec = −4, 0.1° + * - prec = −3, 1' + * - prec = −2, 0.1' + * - prec = −1, 1" + * - prec = 0, 0.1" (about 3m) + * - prec = 1, 0.01" + * - prec = 10 (max), 10−11" + **********************************************************************/ + System::String^ DMSRepresentation(int prec, bool swaplatlong, + char dmssep ); + + /** + * MGRS string. + * + * @param[in] prec precision (relative to about 1m). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return MGRS string. + * + * This gives the coordinates of the enclosing grid square with size given + * by the precision. Thus 38N 444180 3684790 converted to a MGRS + * coordinate at precision −2 (100m) is 38SMB441847 and not + * 38SMB442848. \e prec specifies the precision of the MGRS string as + * follows: + * - prec = −5 (min), 100km + * - prec = −4, 10km + * - prec = −3, 1km + * - prec = −2, 100m + * - prec = −1, 10m + * - prec = 0, 1m + * - prec = 1, 0.1m + * - prec = 6 (max), 1μm + **********************************************************************/ + System::String^ MGRSRepresentation(int prec); + + /** + * UTM/UPS string. + * + * @param[in] prec precision (relative to about 1m) + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return UTM/UPS string representation: zone designator, easting, and + * northing. + * + * Precision specifies accuracy of representation as follows: + * - prec = −5 (min), 100km + * - prec = −3, 1km + * - prec = 0, 1m + * - prec = 3, 1mm + * - prec = 6, 1μm + * - prec = 9 (max), 1nm + **********************************************************************/ + System::String^ UTMUPSRepresentation(int prec); + + /** + * UTM/UPS string with hemisphere override. + * + * @param[in] prec precision (relative to about 1m) + * @param[in] northp hemisphere override + * @exception GeographicErr if the hemisphere override attempts to change + * UPS N to UPS S or vice verse. + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return UTM/UPS string representation: zone designator, easting, and + * northing. + **********************************************************************/ + System::String^ UTMUPSRepresentation(bool northp, int prec); + + /** + * MGRS string for the alternate zone. See GeoCoords::MGRSRepresentation. + * + * @param[in] prec precision (relative to about 1m). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return MGRS string. + **********************************************************************/ + System::String^ AltMGRSRepresentation(int prec); + + /** + * UTM/UPS string for the alternate zone. See + * GeoCoords::UTMUPSRepresentation. + * + * @param[in] prec precision (relative to about 1m) + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return UTM/UPS string representation: zone designator, easting, and + * northing. + **********************************************************************/ + System::String^ AltUTMUPSRepresentation(int prec); + + /** + * UTM/UPS string for the alternate zone, with hemisphere override. + * + * @param[in] prec precision (relative to about 1m) + * @param[in] northp hemisphere override + * @exception GeographicErr if the hemisphere override attempts to change + * UPS N to UPS S or vice verse. + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return UTM/UPS string representation: zone designator, easting, and + * northing. + **********************************************************************/ + System::String^ AltUTMUPSRepresentation(bool northp, int prec); + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the WGS84 ellipsoid (meters). + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the WGS84 ellipsoid. + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + property double Flattening { double get(); } + ///@} + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geocentric.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geocentric.cpp new file mode 100644 index 000000000..2bbfade68 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geocentric.cpp @@ -0,0 +1,151 @@ +/** + * \file NETGeographicLib/Geocentric.cpp + * \brief Implementation for NETGeographicLib::Geocentric class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/Geocentric.hpp" +#include "Geocentric.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Unable to allocate memory for a GeographicLib::Geocentric"; + +//***************************************************************************** +Geocentric::!Geocentric() +{ + if ( m_pGeocentric != NULL ) + { + delete m_pGeocentric; + m_pGeocentric = NULL; + } +} + +//***************************************************************************** +Geocentric::Geocentric(void) +{ + try + { + m_pGeocentric = new GeographicLib::Geocentric( + GeographicLib::Geocentric::WGS84 ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +Geocentric::Geocentric(double a, double f) +{ + try + { + m_pGeocentric = new GeographicLib::Geocentric( a, f ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch (std::exception err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +Geocentric::Geocentric( const GeographicLib::Geocentric& g ) +{ + try + { + m_pGeocentric = new GeographicLib::Geocentric( g ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void Geocentric::Forward(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% X, + [System::Runtime::InteropServices::Out] double% Y, + [System::Runtime::InteropServices::Out] double% Z) +{ + double lX, lY, lZ; + m_pGeocentric->Forward( lat, lon, h, lX, lY, lZ); + X = lX; + Y = lY; + Z = lZ; +} + +//***************************************************************************** +void Geocentric::Forward(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% X, + [System::Runtime::InteropServices::Out] double% Y, + [System::Runtime::InteropServices::Out] double% Z, + [System::Runtime::InteropServices::Out] array^% M) +{ + double lX, lY, lZ; + std::vector lM(9); + m_pGeocentric->Forward( lat, lon, h, lX, lY, lZ, lM); + X = lX; + Y = lY; + Z = lZ; + M = gcnew array( 3, 3 ); + for ( int i = 0; i < 3; i++ ) + for ( int j = 0; j < 3; j++ ) + M[i,j] = lM[3*i+j]; +} + +//***************************************************************************** +void Geocentric::Reverse(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% h) +{ + double llat, llon, lh; + m_pGeocentric->Reverse(X, Y, Z, llat, llon, lh); + lat = llat; + lon = llon; + h = lh; +} + +//***************************************************************************** +void Geocentric::Reverse(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% h, + [System::Runtime::InteropServices::Out] array^% M) +{ + std::vector lM(9); + double llat, llon, lh; + m_pGeocentric->Reverse(X, Y, Z, llat, llon, lh, lM); + lat = llat; + lon = llon; + h = lh; + M = gcnew array( 3, 3 ); + for ( int i = 0; i < 3; i++ ) + for ( int j = 0; j < 3; j++ ) + M[i,j] = lM[3*i+j]; +} + +//***************************************************************************** +System::IntPtr^ Geocentric::GetUnmanaged() +{ + return gcnew System::IntPtr( const_cast( + reinterpret_cast(m_pGeocentric) ) ); +} + +//***************************************************************************** +double Geocentric::MajorRadius::get() +{ return m_pGeocentric->MajorRadius(); } + +//***************************************************************************** +double Geocentric::Flattening::get() +{ return m_pGeocentric->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geocentric.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geocentric.h new file mode 100644 index 000000000..2052ac418 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geocentric.h @@ -0,0 +1,227 @@ +/** + * \file NETGeographicLib/Geocentric.h + * \brief Header for NETGeographicLib::Geocentric class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::Geocentric. + * + * This class allows .NET applications to access GeographicLib::Geocentric. + * + * Convert between geodetic coordinates latitude = \e lat, longitude = \e + * lon, height = \e h (measured vertically from the surface of the ellipsoid) + * to geocentric coordinates (\e X, \e Y, \e Z). The origin of geocentric + * coordinates is at the center of the earth. The \e Z axis goes thru the + * north pole, \e lat = 90°. The \e X axis goes thru \e lat = 0, + * \e lon = 0. %Geocentric coordinates are also known as earth centered, + * earth fixed (ECEF) coordinates. + * + * The conversion from geographic to geocentric coordinates is + * straightforward. For the reverse transformation we use + * - H. Vermeille, + * Direct + * transformation from geocentric coordinates to geodetic coordinates, + * J. Geodesy 76, 451--454 (2002). + * . + * Several changes have been made to ensure that the method returns accurate + * results for all finite inputs (even if \e h is infinite). The changes are + * described in Appendix B of + * - C. F. F. Karney, + * Geodesics + * on an ellipsoid of revolution, + * Feb. 2011; + * preprint + * arxiv:1102.1215v1. + * . + * See \ref geocentric for more information. + * + * The errors in these routines are close to round-off. Specifically, for + * points within 5000 km of the surface of the ellipsoid (either inside or + * outside the ellipsoid), the error is bounded by 7 nm (7 nanometers) for + * the WGS84 ellipsoid. See \ref geocentric for further information on the + * errors. + * + * C# Example: + * \include example-Geocentric.cs + * Managed C++ Example: + * \include example-Geocentric.cpp + * Visual Basic Example: + * \include example-Geocentric.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor is provided that assumes WGS84 parameters. + * + * The MajorRadius and Flattening functions are implemented as properties. + * + * The Forward and Reverse functions return rotation matrices as 2D, + * 3 × 3 arrays rather than vectors. + **********************************************************************/ + public ref class Geocentric + { + private: + // pointer to the unmanaged GeographicLib::Geocentric + const GeographicLib::Geocentric* m_pGeocentric; + + // The finalizer frees unmanaged memory when the object is destroyed. + !Geocentric(); + public: + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @exception GeographicErr if \e a or (1 − \e f ) \e a is not + * positive. + **********************************************************************/ + Geocentric(double a, double f); + + /** + * A default constructor which assumes WGS84. + **********************************************************************/ + Geocentric(); + + /** + * A constructor that is initialized from an unmanaged + * GeographicLib::Geocentric. For internal use only. + * @param[in] g An existing GeographicLib::Geocentric. + **********************************************************************/ + Geocentric( const GeographicLib::Geocentric& g ); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~Geocentric() + { this->!Geocentric(); } + + /** + * Convert from geodetic to geocentric coordinates. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] h height of point above the ellipsoid (meters). + * @param[out] X geocentric coordinate (meters). + * @param[out] Y geocentric coordinate (meters). + * @param[out] Z geocentric coordinate (meters). + * + * \e lat should be in the range [−90°, 90°]; \e lon + * should be in the range [−540°, 540°). + **********************************************************************/ + void Forward(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% X, + [System::Runtime::InteropServices::Out] double% Y, + [System::Runtime::InteropServices::Out] double% Z); + + /** + * Convert from geodetic to geocentric coordinates and return rotation + * matrix. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] h height of point above the ellipsoid (meters). + * @param[out] X geocentric coordinate (meters). + * @param[out] Y geocentric coordinate (meters). + * @param[out] Z geocentric coordinate (meters). + * @param[out] M a 3 × 3 rotation matrix. + * + * Let \e v be a unit vector located at (\e lat, \e lon, \e h). We can + * express \e v as \e column vectors in one of two ways + * - in east, north, up coordinates (where the components are relative to a + * local coordinate system at (\e lat, \e lon, \e h)); call this + * representation \e v1. + * - in geocentric \e X, \e Y, \e Z coordinates; call this representation + * \e v0. + * . + * Then we have \e v0 = \e M ⋅ \e v1. + **********************************************************************/ + void Forward(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% X, + [System::Runtime::InteropServices::Out] double% Y, + [System::Runtime::InteropServices::Out] double% Z, + [System::Runtime::InteropServices::Out] array^% M); + + /** + * Convert from geocentric to geodetic to coordinates. + * + * @param[in] X geocentric coordinate (meters). + * @param[in] Y geocentric coordinate (meters). + * @param[in] Z geocentric coordinate (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] h height of point above the ellipsoid (meters). + * + * In general there are multiple solutions and the result which maximizes + * \e h is returned. If there are still multiple solutions with different + * latitudes (applies only if \e Z = 0), then the solution with \e lat > 0 + * is returned. If there are still multiple solutions with different + * longitudes (applies only if \e X = \e Y = 0) then \e lon = 0 is + * returned. The value of \e h returned satisfies \e h ≥ − \e a + * (1 − e2) / sqrt(1 − e2 + * sin2\e lat). The value of \e lon returned is in the range + * [−180°, 180°). + **********************************************************************/ + void Reverse(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% h); + + /** + * Convert from geocentric to geodetic to coordinates. + * + * @param[in] X geocentric coordinate (meters). + * @param[in] Y geocentric coordinate (meters). + * @param[in] Z geocentric coordinate (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] h height of point above the ellipsoid (meters). + * @param[out] M a 3 × 3 rotation matrix. + * + * Let \e v be a unit vector located at (\e lat, \e lon, \e h). We can + * express \e v as \e column vectors in one of two ways + * - in east, north, up coordinates (where the components are relative to a + * local coordinate system at (\e lat, \e lon, \e h)); call this + * representation \e v1. + * - in geocentric \e X, \e Y, \e Z coordinates; call this representation + * \e v0. + * . + * Then we have \e v1 = \e MT ⋅ \e v0, where \e + * MT is the transpose of \e M. + **********************************************************************/ + void Reverse(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% h, + [System::Runtime::InteropServices::Out] array^% M); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return a pointer to the unmanaged GeographicLib::Geocentric. + **********************************************************************/ + System::IntPtr^ GetUnmanaged(); + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geodesic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geodesic.cpp new file mode 100644 index 000000000..dadd022c4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geodesic.cpp @@ -0,0 +1,483 @@ +/** + * \file NETGeographicLib/Geodesic.cpp + * \brief Implementation for NETGeographicLib::Geodesic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include +#include "Geodesic.h" +#include "GeodesicLine.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::Geodesic"; + +//***************************************************************************** +Geodesic::!Geodesic() +{ + if ( m_pGeodesic != NULL ) + { + delete m_pGeodesic; + m_pGeodesic = NULL; + } +} + +//***************************************************************************** +Geodesic::Geodesic(double a, double f) +{ + try + { + m_pGeodesic = new GeographicLib::Geodesic( a, f ); + } + catch ( std::bad_alloc err ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( GeographicLib::GeographicErr err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +Geodesic::Geodesic() +{ + try + { + m_pGeodesic = new GeographicLib::Geodesic( GeographicLib::Geodesic::WGS84 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +double Geodesic::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21, lS12; + double out = m_pGeodesic->Direct(lat1, lon1, azi1, s12, + llat2, llon2, lazi2, lm12, lM12, lM21, lS12); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double Geodesic::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2) +{ + double llat2, llon2; + double out = m_pGeodesic->Direct(lat1, lon1, azi1, s12, + llat2, llon2 ); + lat2 = llat2; + lon2 = llon2; + return out; +} + +//***************************************************************************** +double Geodesic::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double llat2, llon2, lazi2; + double out = m_pGeodesic->Direct(lat1, lon1, azi1, s12, + llat2, llon2, lazi2 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + return out; +} + +//***************************************************************************** +double Geodesic::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12) +{ + double llat2, llon2, lazi2, lm12; + double out = m_pGeodesic->Direct(lat1, lon1, azi1, s12, + llat2, llon2, lazi2, lm12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + return out; +} + +//***************************************************************************** +double Geodesic::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, lM12, lM21; + double out = m_pGeodesic->Direct(lat1, lon1, azi1, s12, + llat2, llon2, lazi2, lM12, lM21); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +double Geodesic::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21; + double out = m_pGeodesic->Direct(lat1, lon1, azi1, s12, + llat2, llon2, lazi2, lm12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +void Geodesic::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12; + m_pGeodesic->ArcDirect(lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; +} + +//***************************************************************************** +void Geodesic::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2) +{ + double llat2, llon2; + m_pGeodesic->ArcDirect(lat1, lon1, azi1, a12, llat2, llon2 ); + lat2 = llat2; + lon2 = llon2; +} + +//***************************************************************************** +void Geodesic::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double llat2, llon2, lazi2; + m_pGeodesic->ArcDirect(lat1, lon1, azi1, a12, llat2, llon2, lazi2 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; +} + +//***************************************************************************** +void Geodesic::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12) +{ + double llat2, llon2, lazi2, ls12; + m_pGeodesic->ArcDirect(lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; +} + +//***************************************************************************** +void Geodesic::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12) +{ + double llat2, llon2, lazi2, ls12, lm12; + m_pGeodesic->ArcDirect(lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12, lm12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; +} + +//***************************************************************************** +void Geodesic::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, ls12, lM12, lM21; + m_pGeodesic->ArcDirect(lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + M12 = lM12; + M21 = lM21; +} + +//***************************************************************************** +void Geodesic::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21; + m_pGeodesic->ArcDirect(lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12, lm12, lM12, lM21); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + s12 = ls12; + M12 = lM12; + M21 = lM21; +} + +//***************************************************************************** +double Geodesic::GenDirect(double lat1, double lon1, double azi1, + bool arcmode, double s12_a12, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21, ls12, lS12; + double out = m_pGeodesic->GenDirect(lat1, lon1, azi1, arcmode, s12_a12, + static_cast(outmask), + llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + s12 = ls12; + S12 = lS12; + return out; +} + +//***************************************************************************** +double Geodesic::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double ls12, lazi1, lazi2, lm12, lM12, lM21, lS12; + double out = m_pGeodesic->Inverse(lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2, lm12, lM12, lM21, lS12); + s12 = ls12; + azi1 = lazi1; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double Geodesic::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12) +{ + double ls12; + double out = m_pGeodesic->Inverse(lat1, lon1, lat2, lon2, ls12 ); + s12 = ls12; + return out; +} + +//***************************************************************************** +double Geodesic::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double lazi1, lazi2; + double out = m_pGeodesic->Inverse(lat1, lon1, lat2, lon2, lazi1, lazi2); + azi1 = lazi1; + azi2 = lazi2; + return out; +} + +//***************************************************************************** +double Geodesic::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double ls12, lazi1, lazi2; + double out = m_pGeodesic->Inverse(lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2 ); + azi1 = lazi1; + azi2 = lazi2; + s12 = ls12; + return out; +} + +//***************************************************************************** +double Geodesic::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12) +{ + double ls12, lazi1, lazi2, lm12; + double out = m_pGeodesic->Inverse(lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2, lm12 ); + azi1 = lazi1; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + return out; +} + +//***************************************************************************** +double Geodesic::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double ls12, lazi1, lazi2, lM12, lM21; + double out = m_pGeodesic->Inverse(lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2, lM12, lM21 ); + azi1 = lazi1; + azi2 = lazi2; + s12 = ls12; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +double Geodesic::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double ls12, lazi1, lazi2, lm12, lM12, lM21; + double out = m_pGeodesic->Inverse(lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2, lm12, lM12, lM21 ); + azi1 = lazi1; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +double Geodesic::GenInverse(double lat1, double lon1, double lat2, double lon2, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double ls12, lazi1, lazi2, lm12, lM12, lM21, lS12; + double out = m_pGeodesic->GenInverse(lat1, lon1, lat2, lon2, + static_cast(outmask), + ls12, lazi1, lazi2, lm12, lM12, lM21, lS12); + azi1 = lazi1; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +System::IntPtr^ Geodesic::GetUnmanaged() +{ + return gcnew System::IntPtr( const_cast(reinterpret_cast(m_pGeodesic)) ); +} + +//***************************************************************************** +GeodesicLine^ Geodesic::Line(double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps ) +{ + return gcnew GeodesicLine( this, lat1, lon1, azi1, caps ); +} + +//***************************************************************************** +double Geodesic::MajorRadius::get() { return m_pGeodesic->MajorRadius(); } + +//***************************************************************************** +double Geodesic::Flattening::get() { return m_pGeodesic->Flattening(); } + +//***************************************************************************** +double Geodesic::EllipsoidArea::get() { return m_pGeodesic->EllipsoidArea(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geodesic.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geodesic.h new file mode 100644 index 000000000..aba97e1ab --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geodesic.h @@ -0,0 +1,688 @@ +/** + * \file NETGeographicLib/Geodesic.h + * \brief Header for NETGeographicLib::Geodesic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once +#include "NETGeographicLib.h" + +namespace NETGeographicLib +{ + ref class GeodesicLine; + /** + * \brief .NET wrapper for GeographicLib::Geodesic. + * + * This class allows .NET applications to access GeographicLib::Geodesic. + * + * The shortest path between two points on a ellipsoid at (\e lat1, \e lon1) + * and (\e lat2, \e lon2) is called the geodesic. Its length is \e s12 and + * the geodesic from point 1 to point 2 has azimuths \e azi1 and \e azi2 at + * the two end points. (The azimuth is the heading measured clockwise from + * north. \e azi2 is the "forward" azimuth, i.e., the heading that takes you + * beyond point 2 not back to point 1.) + * + * Given \e lat1, \e lon1, \e azi1, and \e s12, we can determine \e lat2, \e + * lon2, and \e azi2. This is the \e direct geodesic problem and its + * solution is given by the function Geodesic::Direct. (If \e s12 is + * sufficiently large that the geodesic wraps more than halfway around the + * earth, there will be another geodesic between the points with a smaller \e + * s12.) + * + * Given \e lat1, \e lon1, \e lat2, and \e lon2, we can determine \e azi1, \e + * azi2, and \e s12. This is the \e inverse geodesic problem, whose solution + * is given by Geodesic::Inverse. Usually, the solution to the inverse + * problem is unique. In cases where there are multiple solutions (all with + * the same \e s12, of course), all the solutions can be easily generated + * once a particular solution is provided. + * + * The standard way of specifying the direct problem is the specify the + * distance \e s12 to the second point. However it is sometimes useful + * instead to specify the arc length \e a12 (in degrees) on the auxiliary + * sphere. This is a mathematical construct used in solving the geodesic + * problems. The solution of the direct problem in this form is provided by + * Geodesic::ArcDirect. An arc length in excess of 180° indicates that + * the geodesic is not a shortest path. In addition, the arc length between + * an equatorial crossing and the next extremum of latitude for a geodesic is + * 90°. + * + * This class can also calculate several other quantities related to + * geodesics. These are: + * - reduced length. If we fix the first point and increase \e azi1 + * by \e dazi1 (radians), the second point is displaced \e m12 \e dazi1 in + * the direction \e azi2 + 90°. The quantity \e m12 is called + * the "reduced length" and is symmetric under interchange of the two + * points. On a curved surface the reduced length obeys a symmetry + * relation, \e m12 + \e m21 = 0. On a flat surface, we have \e m12 = \e + * s12. The ratio s12/\e m12 gives the azimuthal scale for an + * azimuthal equidistant projection. + * - geodesic scale. Consider a reference geodesic and a second + * geodesic parallel to this one at point 1 and separated by a small + * distance \e dt. The separation of the two geodesics at point 2 is \e + * M12 \e dt where \e M12 is called the "geodesic scale". \e M21 is + * defined similarly (with the geodesics being parallel at point 2). On a + * flat surface, we have \e M12 = \e M21 = 1. The quantity 1/\e M12 gives + * the scale of the Cassini-Soldner projection. + + * - area. The area between the geodesic from point 1 to point 2 and + * the equation is represented by \e S12; it is the area, measured + * counter-clockwise, of the geodesic quadrilateral with corners + * (lat1,lon1), (0,lon1), (0,lon2), and + * (lat2,lon2). It can be used to compute the area of any + * simple geodesic polygon. + * + * Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and + * Geodesic::Inverse allow these quantities to be returned. In addition + * there are general functions Geodesic::GenDirect, and Geodesic::GenInverse + * which allow an arbitrary set of results to be computed. The quantities \e + * m12, \e M12, \e M21 which all specify the behavior of nearby geodesics + * obey addition rules. If points 1, 2, and 3 all lie on a single geodesic, + * then the following rules hold: + * - \e s13 = \e s12 + \e s23 + * - \e a13 = \e a12 + \e a23 + * - \e S13 = \e S12 + \e S23 + * - \e m13 = \e m12 \e M23 + \e m23 \e M21 + * - \e M13 = \e M12 \e M23 − (1 − \e M12 \e M21) \e m23 / \e m12 + * - \e M31 = \e M32 \e M21 − (1 − \e M23 \e M32) \e m12 / \e m23 + * + * Additional functionality is provided by the GeodesicLine class, which + * allows a sequence of points along a geodesic to be computed. + * + * The shortest distance returned by the solution of the inverse problem is + * (obviously) uniquely defined. However, in a few special cases there are + * multiple azimuths which yield the same shortest distance. Here is a + * catalog of those cases: + * - \e lat1 = −\e lat2 (with neither at a pole). If \e azi1 = \e + * azi2, the geodesic is unique. Otherwise there are two geodesics and the + * second one is obtained by setting [\e azi1, \e azi2] = [\e azi2, \e + * azi1], [\e M12, \e M21] = [\e M21, \e M12], \e S12 = −\e S12. + * (This occurs when the longitude difference is near ±180° for + * oblate ellipsoids.) + * - \e lon2 = \e lon1 ± 180° (with neither at a pole). If \e + * azi1 = 0° or ±180°, the geodesic is unique. Otherwise + * there are two geodesics and the second one is obtained by setting [\e + * azi1, \e azi2] = [−\e azi1, −\e azi2], \e S12 = −\e + * S12. (This occurs when the \e lat2 is near −\e lat1 for prolate + * ellipsoids.) + * - Points 1 and 2 at opposite poles. There are infinitely many geodesics + * which can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e + * azi2] + [\e d, −\e d], for arbitrary \e d. (For spheres, this + * prescription applies when points 1 and 2 are antipodal.) + * - s12 = 0 (coincident points). There are infinitely many geodesics which + * can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e azi2] + + * [\e d, \e d], for arbitrary \e d. + * + * The calculations are accurate to better than 15 nm (15 nanometers) for the + * WGS84 ellipsoid. See Sec. 9 of + * arXiv:1102.1215v1 for + * details. The algorithms used by this class are based on series expansions + * using the flattening \e f as a small parameter. These are only accurate + * for |f| < 0.02; however reasonably accurate results will be + * obtained for |f| < 0.2. Here is a table of the approximate + * maximum error (expressed as a distance) for an ellipsoid with the same + * major radius as the WGS84 ellipsoid and different values of the + * flattening.
+   *     |f|      error
+   *     0.01     25 nm
+   *     0.02     30 nm
+   *     0.05     10 um
+   *     0.1     1.5 mm
+   *     0.2     300 mm
+   * 
+ * For very eccentric ellipsoids, use GeodesicExact instead. + * + * The algorithms are described in + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * . + * For more information on geodesics see \ref geodesic. + * + * C# Example: + * \include example-Geodesic.cs + * Managed C++ Example: + * \include example-Geodesic.cpp + * Visual Basic Example: + * \include example-Geodesic.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor has been provided that assumes WGS84 parameters. + * + * The MajorRadius, Flattening, and EllipsoidArea functions are + * implemented as properties. + * + * The GenDirect, GenInverse, and Line functions accept the + * "capabilities mask" as a NETGeographicLib::Mask rather than an + * unsigned. + **********************************************************************/ + public ref class Geodesic + { + private: + // The pointer to the unmanaged GeographicLib::Geodesic. + const GeographicLib::Geodesic* m_pGeodesic; + + // Frees the unmanaged memory when this object is destroyed. + !Geodesic(); + public: + /** \name Constructor + **********************************************************************/ + ///@{ + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @exception GeographicErr if \e a or (1 − \e f ) \e a is not + * positive. + **********************************************************************/ + Geodesic(double a, double f); + + /** + * Constructor for the WGS84 ellipsoid. + **********************************************************************/ + Geodesic(); + ///@} + + /** + * \brief the destructor calls the finalizer. + **********************************************************************/ + ~Geodesic() { this->!Geodesic(); } + + /** \name Direct geodesic problem specified in terms of distance. + **********************************************************************/ + ///@{ + /** + * Solve the direct geodesic problem where the length of the geodesic + * is specified in terms of distance. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). The values of + * \e lon2 and \e azi2 returned are in the range [−180°, + * 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + * + * The following functions are overloaded versions of Geodesic::Direct + * which omit some of the output parameters. Note, however, that the arc + * length is always computed and returned as the function value. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2); + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + ///@} + + /** \name Direct geodesic problem specified in terms of arc length. + **********************************************************************/ + ///@{ + /** + * Solve the direct geodesic problem where the length of the geodesic + * is specified in terms of arc length. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] a12 arc length between point 1 and point 2 (degrees); it can + * be negative. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). The values of + * \e lon2 and \e azi2 returned are in the range [−180°, + * 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + * + * The following functions are overloaded versions of Geodesic::Direct + * which omit some of the output parameters. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2); + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12); + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + ///@} + + /** \name General version of the direct geodesic solution. + **********************************************************************/ + ///@{ + + /** + * The general direct geodesic problem. Geodesic::Direct and + * Geodesic::ArcDirect are defined in terms of this function. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] arcmode boolean flag determining the meaning of the \e + * s12_a12. + * @param[in] s12_a12 if \e arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be negative. + * @param[in] outmask a bitor'ed combination of NETGeographicLib::Mask values + * specifying which of the following parameters should be set. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The NETGeographicLib::Mask values possible for \e outmask are + * - \e outmask |= NETGeographicLib::Mask::LATITUDE for the latitude \e lat2; + * - \e outmask |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2; + * - \e outmask |= NETGeographicLib::Mask::AZIMUTH for the latitude \e azi2; + * - \e outmask |= NETGeographicLib::Mask::DISTANCE for the distance \e s12; + * - \e outmask |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= NETGeographicLib::Mask::AREA for the area \e S12; + * - \e outmask |= NETGeographicLib::Mask::ALL for all of the above. + * . + * The function value \e a12 is always computed and returned and this + * equals \e s12_a12 is \e arcmode is true. If \e outmask includes + * NETGeographicLib::Mask::DISTANCE and \e arcmode is false, then + * \e s12 = \e s12_a12. It is not necessary to include + * NETGeographicLib::Mask::DISTANCE_IN in \e outmask; this is + * automatically included is \e arcmode is false. + **********************************************************************/ + double GenDirect(double lat1, double lon1, double azi1, + bool arcmode, double s12_a12, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + ///@} + + /** \name Inverse geodesic problem. + **********************************************************************/ + ///@{ + /** + * Solve the inverse geodesic problem. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] azi1 azimuth at point 1 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e lat1 and \e lat2 should be in the range [−90°, 90°]; \e + * lon1 and \e lon2 should be in the range [−540°, 540°). + * The values of \e azi1 and \e azi2 returned are in the range + * [−180°, 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. + * + * The solution to the inverse problem is found using Newton's method. If + * this fails to converge (this is very unlikely in geodetic applications + * but does occur for very eccentric ellipsoids), then the bisection method + * is used to refine the solution. + * + * The following functions are overloaded versions of Geodesic::Inverse + * which omit some of the output parameters. Note, however, that the arc + * length is always computed and returned as the function value. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12); + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + ///@} + + /** \name General version of inverse geodesic solution. + **********************************************************************/ + ///@{ + /** + * The general inverse geodesic calculation. Geodesic::Inverse is defined + * in terms of this function. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[in] outmask a bitor'ed combination of Geodesic::mask values + * specifying which of the following parameters should be set. + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] azi1 azimuth at point 1 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The Geodesic::mask values possible for \e outmask are + * - \e outmask |= Geodesic::DISTANCE for the distance \e s12; + * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2; + * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= Geodesic::AREA for the area \e S12; + * - \e outmask |= Geodesic::ALL for all of the above. + * . + * The arc length is always computed and returned as the function value. + **********************************************************************/ + double GenInverse(double lat1, double lon1, double lat2, double lon2, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + ///@} + + /** \name Interface to GeodesicLine. + **********************************************************************/ + ///@{ + + /** + * Set up to compute several points on a single geodesic. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of NETGeographicLib::Mask values + * specifying the capabilities the GeodesicLine object should possess, + * i.e., which quantities can be returned in calls to + * GeodesicLine::Position. + * @return a GeodesicLine object. + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). + * + * The NETGeographicLib::Mask values are + * - \e caps |= NETGeographicLib::Mask::LATITUDE for the latitude \e lat2; this is + * added automatically; + * - \e caps |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2; + * - \e caps |= NETGeographicLib::Mask::AZIMUTH for the azimuth \e azi2; this is + * added automatically; + * - \e caps |= NETGeographicLib::Mask::DISTANCE for the distance \e s12; + * - \e caps |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e m12; + * - \e caps |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e M12 + * and \e M21; + * - \e caps |= NETGeographicLib::Mask::AREA for the area \e S12; + * - \e caps |= NETGeographicLib::Mask::DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length; + * - \e caps |= NETGeographicLib::Mask::ALL for all of the above. + * . + * + * If the point is at a pole, the azimuth is defined by keeping \e lon1 + * fixed, writing \e lat1 = ±(90 − ε), and taking the + * limit ε → 0+. + **********************************************************************/ + GeodesicLine^ Line(double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps ); + + ///@} + + /** \name Inspector functions. + **********************************************************************/ + ///@{ + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return total area of ellipsoid in meters2. The area of a + * polygon encircling a pole can be found by adding + * Geodesic::EllipsoidArea()/2 to the sum of \e S12 for each side of the + * polygon. + **********************************************************************/ + property double EllipsoidArea { double get(); } + + /** + * %return The unmanaged pointer to the GeographicLib::Geodesic. + * + * This function is for internal use only. + **********************************************************************/ + System::IntPtr^ GetUnmanaged(); + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicExact.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicExact.cpp new file mode 100644 index 000000000..aa4534761 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicExact.cpp @@ -0,0 +1,489 @@ +/** + * \file NETGeographicLib/GeodesicExact.cpp + * \brief Implementation for NETGeographicLib::GeodesicExact class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/GeodesicExact.hpp" +#include "GeodesicExact.h" +#include "GeodesicLineExact.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::GeodesicExact"; + +//***************************************************************************** +GeodesicExact::!GeodesicExact(void) +{ + if ( m_pGeodesicExact != NULL ) + { + delete m_pGeodesicExact; + m_pGeodesicExact = NULL; + } +} + +//***************************************************************************** +GeodesicExact::GeodesicExact() +{ + try + { + m_pGeodesicExact = new GeographicLib::GeodesicExact( GeographicLib::GeodesicExact::WGS84 ); + } + catch ( std::bad_alloc err ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +GeodesicExact::GeodesicExact(double a, double f) +{ + try + { + m_pGeodesicExact = new GeographicLib::GeodesicExact( a, f ); + } + catch ( std::bad_alloc err ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( GeographicLib::GeographicErr err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +double GeodesicExact::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21, lS12; + double out = m_pGeodesicExact->Direct( lat1, lon1, azi1, s12, + llat2, llon2, lazi2, lm12, lM12, lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double GeodesicExact::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2) +{ + double llat2, llon2; + double out = m_pGeodesicExact->Direct( lat1, lon1, azi1, s12, + llat2, llon2 ); + lat2 = llat2; + lon2 = llon2; + return out; +} + +//***************************************************************************** +double GeodesicExact::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double llat2, llon2, lazi2; + double out = m_pGeodesicExact->Direct( lat1, lon1, azi1, s12, + llat2, llon2, lazi2 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + return out; +} + +//***************************************************************************** +double GeodesicExact::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12) +{ + double llat2, llon2, lazi2, lm12; + double out = m_pGeodesicExact->Direct( lat1, lon1, azi1, s12, + llat2, llon2, lazi2, lm12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + return out; +} + +//***************************************************************************** +double GeodesicExact::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, lM12, lM21; + double out = m_pGeodesicExact->Direct( lat1, lon1, azi1, s12, + llat2, llon2, lazi2, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +double GeodesicExact::Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21; + double out = m_pGeodesicExact->Direct( lat1, lon1, azi1, s12, + llat2, llon2, lazi2, lm12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +void GeodesicExact::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12; + m_pGeodesicExact->ArcDirect( lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; +} + +//***************************************************************************** +void GeodesicExact::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2) +{ + double llat2, llon2; + m_pGeodesicExact->ArcDirect( lat1, lon1, azi1, a12, + llat2, llon2 ); + lat2 = llat2; + lon2 = llon2; +} + +//***************************************************************************** +void GeodesicExact::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double llat2, llon2, lazi2; + m_pGeodesicExact->ArcDirect( lat1, lon1, azi1, a12, + llat2, llon2, lazi2 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; +} + +//***************************************************************************** +void GeodesicExact::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12) +{ + double llat2, llon2, lazi2, ls12; + m_pGeodesicExact->ArcDirect( lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; +} + +//***************************************************************************** +void GeodesicExact::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12) +{ + double llat2, llon2, lazi2, ls12, lm12; + m_pGeodesicExact->ArcDirect( lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12, lm12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; +} + +//***************************************************************************** +void GeodesicExact::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, ls12, lM12, lM21; + m_pGeodesicExact->ArcDirect( lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + M12 = lM12; + M21 = lM21; +} + +//***************************************************************************** +void GeodesicExact::ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21; + m_pGeodesicExact->ArcDirect( lat1, lon1, azi1, a12, + llat2, llon2, lazi2, ls12, lm12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; +} + +//***************************************************************************** +double GeodesicExact::GenDirect(double lat1, double lon1, double azi1, + bool arcmode, double s12_a12, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12; + double out = m_pGeodesicExact->GenDirect( lat1, lon1, azi1, arcmode, s12_a12, + static_cast(outmask), llat2, llon2, lazi2, ls12, lm12, lM12, + lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double GeodesicExact::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double ls12, lazi1, lazi2, lm12, lM12, lM21, lS12; + double out = m_pGeodesicExact->Inverse( lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2, lm12, lM12, lM21, lS12 ); + s12 = ls12; + azi1 = lazi1; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double GeodesicExact::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12) +{ + double ls12; + double out = m_pGeodesicExact->Inverse( lat1, lon1, lat2, lon2, ls12 ); + s12 = ls12; + return out; +} + +//***************************************************************************** +double GeodesicExact::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double lazi1, lazi2; + double out = m_pGeodesicExact->Inverse( lat1, lon1, lat2, lon2, + lazi1, lazi2 ); + azi1 = lazi1; + azi2 = lazi2; + return out; +} + +//***************************************************************************** +double GeodesicExact::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double ls12, lazi1, lazi2; + double out = m_pGeodesicExact->Inverse( lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2 ); + s12 = ls12; + azi1 = lazi1; + azi2 = lazi2; + return out; +} + +//***************************************************************************** +double GeodesicExact::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12) +{ + double ls12, lazi1, lazi2, lm12; + double out = m_pGeodesicExact->Inverse( lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2, lm12 ); + s12 = ls12; + azi1 = lazi1; + azi2 = lazi2; + m12 = lm12; + return out; +} + +//***************************************************************************** +double GeodesicExact::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double ls12, lazi1, lazi2, lM12, lM21; + double out = m_pGeodesicExact->Inverse( lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2, lM12, lM21 ); + s12 = ls12; + azi1 = lazi1; + azi2 = lazi2; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +double GeodesicExact::Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double ls12, lazi1, lazi2, lm12, lM12, lM21; + double out = m_pGeodesicExact->Inverse( lat1, lon1, lat2, lon2, + ls12, lazi1, lazi2, lm12, lM12, lM21 ); + s12 = ls12; + azi1 = lazi1; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +double GeodesicExact::GenInverse(double lat1, double lon1, double lat2, double lon2, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double ls12, lazi1, lazi2, lm12, lM12, lM21, lS12; + double out = m_pGeodesicExact->GenInverse( lat1, lon1, lat2, lon2, + static_cast(outmask), ls12, lazi1, lazi2, lm12, lM12, + lM21, lS12 ); + s12 = ls12; + azi1 = lazi1; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +System::IntPtr^ GeodesicExact::GetUnmanaged() +{ + return gcnew System::IntPtr( const_cast( + reinterpret_cast(m_pGeodesicExact) ) ); +} + +//***************************************************************************** +GeodesicLineExact^ GeodesicExact::Line(double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps ) +{ + return gcnew GeodesicLineExact( this, lat1, lon1, azi1, caps ); +} + +//***************************************************************************** +double GeodesicExact::MajorRadius::get() +{ return m_pGeodesicExact->MajorRadius(); } + +//***************************************************************************** +double GeodesicExact::Flattening::get() +{ return m_pGeodesicExact->Flattening(); } + +//***************************************************************************** +double GeodesicExact::EllipsoidArea::get() +{ return m_pGeodesicExact->EllipsoidArea(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicExact.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicExact.h new file mode 100644 index 000000000..f52a0eb94 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicExact.h @@ -0,0 +1,603 @@ +#pragma once +/** + * \file NETGeographicLib/GeodesicExact.h + * \brief Header for NETGeographicLib::GeodesicExact class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "NETGeographicLib.h" + +namespace NETGeographicLib +{ + ref class GeodesicLineExact; + /*! + \brief .NET wrapper for GeographicLib::GeodesicExact. + + This class allows .NET applications to access GeographicLib::GeodesicExact. + */ + /** + * \brief .NET wrapper for GeographicLib::GeodesicExact. + * + * This class allows .NET applications to access GeographicLib::GeodesicExact. + * + * The equations for geodesics on an ellipsoid can be expressed in terms of + * incomplete elliptic integrals. The Geodesic class expands these integrals + * in a series in the flattening \e f and this provides an accurate solution + * for \e f &isin [-0.01, 0.01]. The GeodesicExact class computes the + * ellitpic integrals directly and so provides a solution which is valid for + * all \e f. However, in practice, its use should be limited to about \e + * b/\e a ∈ [0.01, 100] or \e f ∈ [-99, 0.99]. + * + * For the WGS84 ellipsoid, these classes are 2--3 times \e slower than the + * series solution and 2--3 times \e less \e accurate (because it's less easy + * to control round-off errors with the elliptic integral formulation); i.e., + * the error is about 40 nm (40 nanometers) instead of 15 nm. However the + * error in the series solution scales as f7 while the + * error in the elliptic integral solution depends weakly on \e f. If the + * quarter meridian distance is 10000 km and the ratio \e b/\e a = 1 − + * \e f is varied then the approximate maximum error (expressed as a + * distance) is
+   *       1 - f  error (nm)
+   *       1/128     387
+   *       1/64      345
+   *       1/32      269
+   *       1/16      210
+   *       1/8       115
+   *       1/4        69
+   *       1/2        36
+   *         1        15
+   *         2        25
+   *         4        96
+   *         8       318
+   *        16       985
+   *        32      2352
+   *        64      6008
+   *       128     19024
+   * 
+ * + * The computation of the area in these classes is via a 30th order series. + * This gives accurate results for \e b/\e a ∈ [1/2, 2]; the accuracy is + * about 8 decimal digits for \e b/\e a ∈ [1/4, 4]. + * + * See \ref geodellip for the formulation. See the documentation on the + * Geodesic class for additional information on the geodesics problems. + * + * C# Example: + * \include example-GeodesicExact.cs + * Managed C++ Example: + * \include example-GeodesicExact.cpp + * Visual Basic Example: + * \include example-GeodesicExact.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor is provided that assumes WGS84 parameters. + * + * The MajorRadius, Flattening, and EllipsoidArea functions are + * implemented as properties. + * + * The GenDirect, GenInverse, and Line functions accept the + * "capabilities mask" as a NETGeographicLib::Mask rather than an + * unsigned. + **********************************************************************/ + public ref class GeodesicExact + { + private: + // pointer to the unmanaged GeographicLib::GeodesicExact. + const GeographicLib::GeodesicExact* m_pGeodesicExact; + + // the finalizer deletes the unmanaged memory. + !GeodesicExact(); + public: + /** \name Constructor + **********************************************************************/ + ///@{ + /** + * Constructor for a WGS84 ellipsoid + **********************************************************************/ + GeodesicExact(); + + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @exception GeographicErr if \e a or (1 − \e f ) \e a is not + * positive. + **********************************************************************/ + GeodesicExact(double a, double f); + ///@} + + /** + * The desstructor calls the finalizer. + **********************************************************************/ + ~GeodesicExact() + { this->!GeodesicExact(); } + + /** \name Direct geodesic problem specified in terms of distance. + **********************************************************************/ + ///@{ + /** + * Perform the direct geodesic calculation where the length of the geodesic + * is specified in terms of distance. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * signed. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). The values of + * \e lon2 and \e azi2 returned are in the range [−180°, + * 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + * + * The following functions are overloaded versions of GeodesicExact::Direct + * which omit some of the output parameters. Note, however, that the arc + * length is always computed and returned as the function value. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2); + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + double Direct(double lat1, double lon1, double azi1, double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + ///@} + + /** \name Direct geodesic problem specified in terms of arc length. + **********************************************************************/ + ///@{ + /** + * Perform the direct geodesic calculation where the length of the geodesic + * is specified in terms of arc length. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] a12 arc length between point 1 and point 2 (degrees); it can + * be signed. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). The values of + * \e lon2 and \e azi2 returned are in the range [−180°, + * 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + * + * The following functions are overloaded versions of GeodesicExact::Direct + * which omit some of the output parameters. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2); + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12); + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(double lat1, double lon1, double azi1, double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + ///@} + + /** \name General version of the direct geodesic solution. + **********************************************************************/ + ///@{ + + /** + * The general direct geodesic calculation. GeodesicExact::Direct and + * GeodesicExact::ArcDirect are defined in terms of this function. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] arcmode boolean flag determining the meaning of the second + * parameter. + * @param[in] s12_a12 if \e arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be signed. + * @param[in] outmask a bitor'ed combination of NETGeographicLib::Mask values + * specifying which of the following parameters should be set. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The NETGeographicLib::Mask values possible for \e outmask are + * - \e outmask |= NETGeographicLib::Mask::LATITUDE for the latitude \e lat2; + * - \e outmask |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2; + * - \e outmask |= NETGeographicLib::Mask::AZIMUTH for the latitude \e azi2; + * - \e outmask |= NETGeographicLib::Mask::DISTANCE for the distance \e s12; + * - \e outmask |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= NETGeographicLib::Mask::AREA for the area \e S12; + * - \e outmask |= NETGeographicLib::Mask::ALL for all of the above. + * . + * The function value \e a12 is always computed and returned and this + * equals \e s12_a12 is \e arcmode is true. If \e outmask includes + * GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e + * s12_a12. It is not necessary to include NETGeographicLib::Mask::DISTANCE_IN in + * \e outmask; this is automatically included is \e arcmode is false. + **********************************************************************/ + double GenDirect(double lat1, double lon1, double azi1, + bool arcmode, double s12_a12, NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + ///@} + + /** \name Inverse geodesic problem. + **********************************************************************/ + ///@{ + /** + * Perform the inverse geodesic calculation. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] azi1 azimuth at point 1 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e lat1 and \e lat2 should be in the range [−90°, 90°]; \e + * lon1 and \e lon2 should be in the range [−540°, 540°). + * The values of \e azi1 and \e azi2 returned are in the range + * [−180°, 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. + * + * The following functions are overloaded versions of GeodesicExact::Inverse + * which omit some of the output parameters. Note, however, that the arc + * length is always computed and returned as the function value. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12); + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + double Inverse(double lat1, double lon1, double lat2, double lon2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + ///@} + + /** \name General version of inverse geodesic solution. + **********************************************************************/ + ///@{ + /** + * The general inverse geodesic calculation. GeodesicExact::Inverse is + * defined in terms of this function. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[in] outmask a bitor'ed combination of NETGeographicLib::Mask values + * specifying which of the following parameters should be set. + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] azi1 azimuth at point 1 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The NETGeographicLib::Mask values possible for \e outmask are + * - \e outmask |= NETGeographicLib::Mask::DISTANCE for the distance \e s12; + * - \e outmask |= NETGeographicLib::Mask::AZIMUTH for the latitude \e azi2; + * - \e outmask |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= NETGeographicLib::Mask::AREA for the area \e S12; + * - \e outmask |= NETGeographicLib::Mask::ALL for all of the above. + * . + * The arc length is always computed and returned as the function value. + **********************************************************************/ + double GenInverse(double lat1, double lon1, double lat2, double lon2, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% azi1, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + ///@} + + /** \name Interface to GeodesicLineExact. + **********************************************************************/ + ///@{ + + /** + * Set up to compute several points on a single geodesic. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of NETGeographicLib::Mask values + * specifying the capabilities the GeodesicLineExact object should + * possess, i.e., which quantities can be returned in calls to + * GeodesicLineExact::Position. + * @return a GeodesicLineExact object. + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). + * + * The GeodesicExact::mask values are + * - \e caps |= NETGeographicLib::Mask::LATITUDE for the latitude \e lat2; this is + * added automatically; + * - \e caps |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2; + * - \e caps |= NETGeographicLib::Mask::AZIMUTH for the azimuth \e azi2; this is + * added automatically; + * - \e caps |= NETGeographicLib::Mask::DISTANCE for the distance \e s12; + * - \e caps |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e m12; + * - \e caps |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e M12 + * and \e M21; + * - \e caps |= NETGeographicLib::Mask::AREA for the area \e S12; + * - \e caps |= NETGeographicLib::Mask::DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length; + * - \e caps |= GeodesicExact::ALL for all of the above. + * . + * The default value of \e caps is GeodesicExact::ALL which turns on all + * the capabilities. + * + * If the point is at a pole, the azimuth is defined by keeping \e lon1 + * fixed, writing \e lat1 = ±(90 − ε), and taking the + * limit ε → 0+. + **********************************************************************/ + GeodesicLineExact^ Line(double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps ); + + ///@} + + /** \name Inspector functions. + **********************************************************************/ + ///@{ + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return total area of ellipsoid in meters2. The area of a + * polygon encircling a pole can be found by adding + * GeodesicExact::EllipsoidArea()/2 to the sum of \e S12 for each side of + * the polygon. + **********************************************************************/ + property double EllipsoidArea { double get(); } + ///@} + + /** + * @return A pointer to the unmanaged GeographicLib::GeodesicExact. + * + * This function is for internal use only. + **********************************************************************/ + System::IntPtr^ GetUnmanaged(); + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLine.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLine.cpp new file mode 100644 index 000000000..2c6d683f4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLine.cpp @@ -0,0 +1,350 @@ +/** + * \file NETGeographicLib/GeodesicLine.cpp + * \brief Implementation for NETGeographicLib::GeodesicLine class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/GeodesicLine.hpp" +#include "Geodesic.h" +#include "GeodesicLine.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::GeodesicLine"; + +//***************************************************************************** +GeodesicLine::!GeodesicLine(void) +{ + if ( m_pGeodesicLine != NULL ) + { + delete m_pGeodesicLine; + m_pGeodesicLine = NULL; + } +} + +//***************************************************************************** +GeodesicLine::GeodesicLine( Geodesic^ g, double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps ) +{ + try + { + const GeographicLib::Geodesic* pGeodesic = + reinterpret_cast( + g->GetUnmanaged()->ToPointer() ); + m_pGeodesicLine = new GeographicLib::GeodesicLine( *pGeodesic, + lat1, lon1, azi1, static_cast(caps) ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +GeodesicLine::GeodesicLine(double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps) +{ + try + { + m_pGeodesicLine = new GeographicLib::GeodesicLine( + GeographicLib::Geodesic::WGS84, lat1, lon1, azi1, + static_cast(caps) ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +double GeodesicLine::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21, lS12; + double out = m_pGeodesicLine->Position( s12, llat2, llon2, lazi2, lm12, + lM12, lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double GeodesicLine::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2) +{ + double llat2, llon2; + double out = m_pGeodesicLine->Position( s12, llat2, llon2); + lat2 = llat2; + lon2 = llon2; + return out; +} + +//***************************************************************************** +double GeodesicLine::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double llat2, llon2, lazi2; + double out = m_pGeodesicLine->Position( s12, llat2, llon2, lazi2 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + return out; +} + +//***************************************************************************** +double GeodesicLine::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12) +{ + double llat2, llon2, lazi2, lm12; + double out = m_pGeodesicLine->Position( s12, llat2, llon2, lazi2, + lm12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + return out; +} + +//***************************************************************************** +double GeodesicLine::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, lM12, lM21; + double out = m_pGeodesicLine->Position( s12, llat2, llon2, lazi2, + lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +double GeodesicLine::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21; + double out = m_pGeodesicLine->Position( s12, llat2, llon2, lazi2, lm12, + lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +void GeodesicLine::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12; + m_pGeodesicLine->ArcPosition( a12, llat2, llon2, lazi2, + ls12, lm12, lM12, lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; +} + +//***************************************************************************** +void GeodesicLine::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2) +{ + double llat2, llon2; + m_pGeodesicLine->ArcPosition( a12, llat2, llon2 ); + lat2 = llat2; + lon2 = llon2; +} + +//***************************************************************************** +void GeodesicLine::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double llat2, llon2, lazi2; + m_pGeodesicLine->ArcPosition( a12, llat2, llon2, lazi2 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; +} + +//***************************************************************************** +void GeodesicLine::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12) +{ + double llat2, llon2, lazi2, ls12; + m_pGeodesicLine->ArcPosition( a12, llat2, llon2, lazi2, ls12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; +} + +//***************************************************************************** +void GeodesicLine::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12) +{ + double llat2, llon2, lazi2, ls12, lm12; + m_pGeodesicLine->ArcPosition( a12, llat2, llon2, lazi2, ls12, lm12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; +} + +//***************************************************************************** +void GeodesicLine::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, ls12, lM12, lM21; + m_pGeodesicLine->ArcPosition( a12, llat2, llon2, lazi2, + ls12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + M12 = lM12; + M21 = lM21; +} + +//***************************************************************************** +void GeodesicLine::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21; + m_pGeodesicLine->ArcPosition( a12, llat2, llon2, lazi2, + ls12, lm12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; +} + +//***************************************************************************** +double GeodesicLine::GenPosition(bool arcmode, double s12_a12, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12; + double out = m_pGeodesicLine->GenPosition( arcmode, s12_a12, + static_cast(outmask), + llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double GeodesicLine::Latitude::get() { return m_pGeodesicLine->Latitude(); } + +//***************************************************************************** +double GeodesicLine::Longitude::get() { return m_pGeodesicLine->Longitude(); } + +//***************************************************************************** +double GeodesicLine::Azimuth::get() { return m_pGeodesicLine->Azimuth(); } + +//***************************************************************************** +double GeodesicLine::EquatorialAzimuth::get() +{ return m_pGeodesicLine->EquatorialAzimuth(); } + +//***************************************************************************** +double GeodesicLine::EquatorialArc::get() +{ return m_pGeodesicLine->EquatorialArc(); } + +//***************************************************************************** +double GeodesicLine::MajorRadius::get() +{ return m_pGeodesicLine->MajorRadius(); } + +//***************************************************************************** +double GeodesicLine::Flattening::get() +{ return m_pGeodesicLine->Flattening(); } + +//***************************************************************************** +NETGeographicLib::Mask GeodesicLine::Capabilities() +{ return static_cast(m_pGeodesicLine->Capabilities()); } + +//***************************************************************************** +bool GeodesicLine::Capabilities(NETGeographicLib::Mask testcaps) +{ return m_pGeodesicLine->Capabilities( static_cast(testcaps) ); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLine.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLine.h new file mode 100644 index 000000000..b2a916caf --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLine.h @@ -0,0 +1,471 @@ +#pragma once +/** + * \file NETGeographicLib/GeodesicLine.h + * \brief Header for NETGeographicLib::GeodesicLine class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "NETGeographicLib.h" + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::GeodesicLine. + * + * This class allows .NET applications to access GeographicLib::GeodesicLine. + * + * GeodesicLine facilitates the determination of a series of points on a + * single geodesic. The starting point (\e lat1, \e lon1) and the azimuth \e + * azi1 are specified in the constructor. GeodesicLine.Position returns the + * location of point 2 a distance \e s12 along the geodesic. Alternatively + * GeodesicLine.ArcPosition gives the position of point 2 an arc length \e + * a12 along the geodesic. + * + * The default copy constructor and assignment operators work with this + * class. Similarly, a vector can be used to hold GeodesicLine objects. + * + * The calculations are accurate to better than 15 nm (15 nanometers). See + * Sec. 9 of + * arXiv:1102.1215v1 for + * details. The algorithms used by this class are based on series expansions + * using the flattening \e f as a small parameter. These are only accurate + * for |f| < 0.02; however reasonably accurate results will be + * obtained for |f| < 0.2. For very eccentric ellipsoids, use + * GeodesicLineExact instead. + * + * The algorithms are described in + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * . + * For more information on geodesics see \ref geodesic. + * + * C# Example: + * \include example-GeodesicLine.cs + * Managed C++ Example: + * \include example-GeodesicLine.cpp + * Visual Basic Example: + * \include example-GeodesicLine.vb + * + * INTERFACE DIFFERENCES:
+ * A constructor has been provided which assumes WGS84 parameters. + * + * The following functions are implemented as properties: + * Latitude, Longitude, Azimuth, EquatorialAzimuth, EquatorialArc, + * MajorRadius, and Flattening. + * + * The constructors, Capabilities, and GenPosition functions accept the + * "capabilities mask" as a NETGeographicLib::Mask rather than an + * unsigned. The Capabilities function returns a NETGeographicLib::Mask + * rather than an unsigned. + **********************************************************************/ + public ref class GeodesicLine + { + private: + // pointer to the unmanaged GeographicLib::GeodesicLine. + const GeographicLib::GeodesicLine* m_pGeodesicLine; + + // The finalizer frees the unmanaged memory when this object is destroyed. + !GeodesicLine(void); + public: + /** \name Constructors + **********************************************************************/ + ///@{ + + /** + * Constructor for a geodesic line staring at latitude \e lat1, longitude + * \e lon1, and azimuth \e azi1 (all in degrees). + * + * @param[in] g A Geodesic object used to compute the necessary information + * about the GeodesicLine. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of NETGeographicLib::Mask values + * specifying the capabilities the GeodesicLine object should possess, + * i.e., which quantities can be returned in calls to + * GeodesicLine::Position. + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). + * + * The NETGeographicLib::Mask values are + * - \e caps |= GeodesicLine::LATITUDE for the latitude \e lat2; this is + * added automatically; + * - \e caps |= GeodesicLine::LONGITUDE for the latitude \e lon2; + * - \e caps |= GeodesicLine::AZIMUTH for the latitude \e azi2; this is + * added automatically; + * - \e caps |= GeodesicLine::DISTANCE for the distance \e s12; + * - \e caps |= GeodesicLine::REDUCEDLENGTH for the reduced length \e m12; + * - \e caps |= GeodesicLine::GEODESICSCALE for the geodesic scales \e M12 + * and \e M21; + * - \e caps |= GeodesicLine::AREA for the area \e S12; + * - \e caps |= GeodesicLine::DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length; + * - \e caps |= GeodesicLine::ALL for all of the above. + * . + * The default value of \e caps is GeodesicLine::ALL. + * + * If the point is at a pole, the azimuth is defined by keeping \e lon1 + * fixed, writing \e lat1 = ±(90° − ε), and taking + * the limit ε → 0+. + **********************************************************************/ + GeodesicLine( Geodesic^ g, double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps ); + + /** + * A constructor which assumes the WGS84 ellipsoid. + **********************************************************************/ + GeodesicLine(double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps); + ///@} + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~GeodesicLine() + { this->!GeodesicLine(); } + + /** \name Position in terms of distance + **********************************************************************/ + ///@{ + + /** + * Compute the position of point 2 which is a distance \e s12 (meters) from + * point 1. + * + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLine object was constructed with \e caps |= + * GeodesicLine::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLine object was constructed with \e caps |= + * GeodesicLine::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= GeodesicLine::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= GeodesicLine::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLine object was constructed with \e caps |= + * GeodesicLine::AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The values of \e lon2 and \e azi2 returned are in the range + * [−180°, 180°). + * + * The GeodesicLine object \e must have been constructed with \e caps |= + * GeodesicLine::DISTANCE_IN; otherwise Math::NaN() is returned and no + * parameters are set. Requesting a value which the GeodesicLine object is + * not capable of computing is not an error; the corresponding argument + * will not be altered. + * + * The following functions are overloaded versions of + * GeodesicLine::Position which omit some of the output parameters. Note, + * however, that the arc length is always computed and returned as the + * function value. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2); + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + ///@} + + /** \name Position in terms of arc length + **********************************************************************/ + ///@{ + + /** + * Compute the position of point 2 which is an arc length \e a12 (degrees) + * from point 1. + * + * @param[in] a12 arc length between point 1 and point 2 (degrees); it can + * be negative. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLine object was constructed with \e caps |= + * NETGeographicLib::Mask::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters); requires + * that the GeodesicLine object was constructed with \e caps |= + * NETGeographicLib::Mask::DISTANCE. + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLine object was constructed with \e caps |= + * NETGeographicLib::Mask::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= NETGeographicLib::Mask::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= NETGeographicLib::Mask::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLine object was constructed with \e caps |= + * NETGeographicLib::Mask::AREA. + * + * The values of \e lon2 and \e azi2 returned are in the range + * [−180°, 180°). + * + * Requesting a value which the GeodesicLine object is not capable of + * computing is not an error; the corresponding argument will not be + * altered. + * + * The following functions are overloaded versions of + * GeodesicLine::ArcPosition which omit some of the output parameters. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2); + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12); + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + ///@} + + /** \name The general position function. + **********************************************************************/ + ///@{ + + /** + * The general position function. GeodesicLine::Position and + * GeodesicLine::ArcPosition are defined in terms of this function. + * + * @param[in] arcmode boolean flag determining the meaning of the second + * parameter; if arcmode is false, then the GeodesicLine object must have + * been constructed with \e caps |= GeodesicLine::DISTANCE_IN. + * @param[in] s12_a12 if \e arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be negative. + * @param[in] outmask a bitor'ed combination of NETGeographicLib::Mask values + * specifying which of the following parameters should be set. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLine object was constructed with \e caps |= + * NETGeographicLib::Mask::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters); requires + * that the GeodesicLine object was constructed with \e caps |= + * NETGeographicLib::Mask::DISTANCE. + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLine object was constructed with \e caps |= + * NETGeographicLib::Mask::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= NETGeographicLib::Mask::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= NETGeographicLib::Mask::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLine object was constructed with \e caps |= + * NETGeographicLib::Mask::AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The GeodesicLine::mask values possible for \e outmask are + * - \e outmask |= NETGeographicLib::Mask::LATITUDE for the latitude \e lat2; + * - \e outmask |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2; + * - \e outmask |= NETGeographicLib::Mask::AZIMUTH for the latitude \e azi2; + * - \e outmask |= NETGeographicLib::Mask::DISTANCE for the distance \e s12; + * - \e outmask |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= NETGeographicLib::Mask::AREA for the area \e S12; + * - \e outmask |= NETGeographicLib::Mask::ALL for all of the above. + * . + * Requesting a value which the GeodesicLine object is not capable of + * computing is not an error; the corresponding argument will not be + * altered. Note, however, that the arc length is always computed and + * returned as the function value. + **********************************************************************/ + double GenPosition(bool arcmode, double s12_a12, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + + /** + * @return \e lat1 the latitude of point 1 (degrees). + **********************************************************************/ + property double Latitude { double get(); } + + /** + * @return \e lon1 the longitude of point 1 (degrees). + **********************************************************************/ + property double Longitude { double get(); } + + /** + * @return \e azi1 the azimuth (degrees) of the geodesic line at point 1. + **********************************************************************/ + property double Azimuth { double get(); } + + /** + * @return \e azi0 the azimuth (degrees) of the geodesic line as it crosses + * the equator in a northward direction. + **********************************************************************/ + property double EquatorialAzimuth { double get(); } + + /** + * @return \e a1 the arc length (degrees) between the northward equatorial + * crossing and point 1. + **********************************************************************/ + property double EquatorialArc { double get(); } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return \e caps the computational capabilities that this object was + * constructed with. LATITUDE and AZIMUTH are always included. + **********************************************************************/ + NETGeographicLib::Mask Capabilities(); + + /** + * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values. + * @return true if the GeodesicLine object has all these capabilities. + **********************************************************************/ + bool Capabilities(NETGeographicLib::Mask testcaps); + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLineExact.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLineExact.cpp new file mode 100644 index 000000000..fb8ab72fc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLineExact.cpp @@ -0,0 +1,354 @@ +/** + * \file NETGeographicLib/GeodesicLineExact.cpp + * \brief Implementation for NETGeographicLib::GeodesicLineExact class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/GeodesicLineExact.hpp" +#include "GeodesicLineExact.h" +#include "GeodesicExact.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::GeodesicLineExact"; + +//***************************************************************************** +GeodesicLineExact::!GeodesicLineExact(void) +{ + if ( m_pGeodesicLineExact != NULL ) + { + delete m_pGeodesicLineExact; + m_pGeodesicLineExact = NULL; + } +} + +//***************************************************************************** +GeodesicLineExact::GeodesicLineExact(GeodesicExact^ g, double lat1, + double lon1, double azi1, NETGeographicLib::Mask caps ) +{ + try + { + const GeographicLib::GeodesicExact* pGeodesicExact= + reinterpret_cast( + g->GetUnmanaged()->ToPointer() ); + m_pGeodesicLineExact = new GeographicLib::GeodesicLineExact( + *pGeodesicExact, lat1, lon1, azi1, static_cast(caps) ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +GeodesicLineExact::GeodesicLineExact(double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps) +{ + try + { + m_pGeodesicLineExact = new GeographicLib::GeodesicLineExact( + GeographicLib::GeodesicExact::WGS84, lat1, lon1, azi1, + static_cast(caps) ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +double GeodesicLineExact::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21, lS12; + double out = m_pGeodesicLineExact->Position( s12, llat2, llon2, lazi2, + lm12, lM12, lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double GeodesicLineExact::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2) +{ + double llat2, llon2; + double out = m_pGeodesicLineExact->Position( s12, llat2, llon2); + lat2 = llat2; + lon2 = llon2; + return out; +} + +//***************************************************************************** +double GeodesicLineExact::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double llat2, llon2, lazi2; + double out = m_pGeodesicLineExact->Position( s12, llat2, llon2, lazi2); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + return out; +} + +//***************************************************************************** +double GeodesicLineExact::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12) +{ + double llat2, llon2, lazi2, lm12; + double out = m_pGeodesicLineExact->Position( s12, llat2, llon2, lazi2, + lm12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + return out; +} + +//***************************************************************************** +double GeodesicLineExact::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, lM12, lM21; + double out = m_pGeodesicLineExact->Position( s12, llat2, llon2, lazi2, + lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +double GeodesicLineExact::Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, lm12, lM12, lM21; + double out = m_pGeodesicLineExact->Position( s12, llat2, llon2, lazi2, + lm12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + m12 = lm12; + M12 = lM12; + M21 = lM21; + return out; +} + +//***************************************************************************** +void GeodesicLineExact::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12; + m_pGeodesicLineExact->ArcPosition( a12, llat2, llon2, lazi2, ls12, + lm12, lM12, lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; +} + +//***************************************************************************** +void GeodesicLineExact::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2) +{ + double llat2, llon2; + m_pGeodesicLineExact->ArcPosition( a12, llat2, llon2 ); + lat2 = llat2; + lon2 = llon2; +} + +//***************************************************************************** +void GeodesicLineExact::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2) +{ + double llat2, llon2, lazi2; + m_pGeodesicLineExact->ArcPosition( a12, llat2, llon2, lazi2 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; +} + +//***************************************************************************** +void GeodesicLineExact::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12) +{ + double llat2, llon2, lazi2, ls12; + m_pGeodesicLineExact->ArcPosition( a12, llat2, llon2, lazi2, ls12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; +} + +//***************************************************************************** +void GeodesicLineExact::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12) +{ + double llat2, llon2, lazi2, ls12, lm12; + m_pGeodesicLineExact->ArcPosition( a12, llat2, llon2, lazi2, ls12, + lm12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; +} + +//***************************************************************************** +void GeodesicLineExact::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, ls12, lM12, lM21; + m_pGeodesicLineExact->ArcPosition( a12, llat2, llon2, lazi2, ls12, + lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + M12 = lM12; + M21 = lM21; +} + +//***************************************************************************** +void GeodesicLineExact::ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21; + m_pGeodesicLineExact->ArcPosition( a12, llat2, llon2, lazi2, ls12, + lm12, lM12, lM21 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; +} + +//***************************************************************************** +double GeodesicLineExact::GenPosition(bool arcmode, double s12_a12, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12) +{ + double llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12; + double out = m_pGeodesicLineExact->GenPosition( arcmode, s12_a12, + static_cast(outmask), + llat2, llon2, lazi2, ls12, lm12, lM12, lM21, lS12 ); + lat2 = llat2; + lon2 = llon2; + azi2 = lazi2; + s12 = ls12; + m12 = lm12; + M12 = lM12; + M21 = lM21; + S12 = lS12; + return out; +} + +//***************************************************************************** +double GeodesicLineExact::Latitude::get() +{ return m_pGeodesicLineExact->Latitude(); } + +//***************************************************************************** +double GeodesicLineExact::Longitude::get() +{ return m_pGeodesicLineExact->Longitude(); } + +//***************************************************************************** +double GeodesicLineExact::Azimuth::get() +{ return m_pGeodesicLineExact->Azimuth(); } + +//***************************************************************************** +double GeodesicLineExact::EquatorialAzimuth::get() +{ return m_pGeodesicLineExact->EquatorialAzimuth(); } + +//***************************************************************************** +double GeodesicLineExact::EquatorialArc::get() +{ return m_pGeodesicLineExact->EquatorialArc(); } + +//***************************************************************************** +double GeodesicLineExact::MajorRadius::get() +{ return m_pGeodesicLineExact->MajorRadius(); } + +//***************************************************************************** +double GeodesicLineExact::Flattening::get() +{ return m_pGeodesicLineExact->Flattening(); } + +//***************************************************************************** +NETGeographicLib::Mask GeodesicLineExact::Capabilities() +{ return static_cast(m_pGeodesicLineExact->Capabilities()); } + +//***************************************************************************** +bool GeodesicLineExact::Capabilities(NETGeographicLib::Mask testcaps) +{ return m_pGeodesicLineExact->Capabilities(static_cast(testcaps)); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLineExact.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLineExact.h new file mode 100644 index 000000000..750bf8ac9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GeodesicLineExact.h @@ -0,0 +1,448 @@ +#pragma once +/** + * \file NETGeographicLib/GeodesicLineExact.h + * \brief Header for NETGeographicLib::GeodesicLineExact class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "NETGeographicLib.h" + +namespace NETGeographicLib +{ + ref class GeodesicExact; + /** + * \brief .NET wrapper for GeographicLib::GeodesicLineExact. + * + * This class allows .NET applications to access GeographicLib::GeodesicLineExact. + * + * GeodesicLineExact facilitates the determination of a series of points on a + * single geodesic. This is a companion to the GeodesicExact class. For + * additional information on this class see the documentation on the + * GeodesicLine class. + * + * C# Example: + * \include example-GeodesicLineExact.cs + * Managed C++ Example: + * \include example-GeodesicLineExact.cpp + * Visual Basic Example: + * \include example-GeodesicLineExact.vb + * + * INTERFACE DIFFERENCES:
+ * A constructor has been provided that assumes WGS84 parameters. + * + * The following functions are implemented as properties: + * Latitude, Longitude, Azimuth, EquatorialAzimuth, EquatorialArc, + * MajorRadius, and Flattening. + * + * The constructors, GenPosition, and Capabilities functions accept the + * "capabilities mask" as a NETGeographicLib::Mask rather than an + * unsigned. The Capabilities function returns a NETGeographicLib::Mask + * rather than an unsigned. + **********************************************************************/ + public ref class GeodesicLineExact + { + private: + // a pointer to the GeographicLib::GeodesicLineExact. + const GeographicLib::GeodesicLineExact* m_pGeodesicLineExact; + + // the finalizer frees the unmanaged memory when the object is destroyed. + !GeodesicLineExact(void); + public: + + /** \name Constructors + **********************************************************************/ + ///@{ + + /** + * Constructor for a geodesic line staring at latitude \e lat1, longitude + * \e lon1, and azimuth \e azi1 (all in degrees). + * + * @param[in] g A GeodesicExact object used to compute the necessary + * information about the GeodesicLineExact. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of NETGeographicLib::Mask values + * specifying the capabilities the GeodesicLineExact object should + * possess, i.e., which quantities can be returned in calls to + * GeodesicLine::Position. + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). + * + * The NETGeographicLib::Mask values are + * - \e caps |= GeodesicLineExact::LATITUDE for the latitude \e lat2; this + * is added automatically; + * - \e caps |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2; + * - \e caps |= NETGeographicLib::Mask::AZIMUTH for the latitude \e azi2; this is + * added automatically; + * - \e caps |= NETGeographicLib::Mask::DISTANCE for the distance \e s12; + * - \e caps |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length \e + m12; + * - \e caps |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e caps |= NETGeographicLib::Mask::AREA for the area \e S12; + * - \e caps |= NETGeographicLib::Mask::DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length; + * - \e caps |= NETGeographicLib::Mask::ALL for all of the above. + * . + * + * If the point is at a pole, the azimuth is defined by keeping \e lon1 + * fixed, writing \e lat1 = ±(90° − ε), and taking + * the limit ε → 0+. + **********************************************************************/ + GeodesicLineExact(GeodesicExact^ g, double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps ); + + /** + * A default constructor which assumes the WGS84 ellipsoid. See + * constructor comments for details. + **********************************************************************/ + GeodesicLineExact(double lat1, double lon1, double azi1, + NETGeographicLib::Mask caps); + ///@} + + /** + * The destructor calls the finalizer + **********************************************************************/ + ~GeodesicLineExact() + { this->!GeodesicLineExact(); } + + /** \name Position in terms of distance + **********************************************************************/ + ///@{ + + /** + * Compute the position of point 2 which is a distance \e s12 (meters) + * from point 1. + * + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * signed. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The values of \e lon2 and \e azi2 returned are in the range + * [−180°, 180°). + * + * The GeodesicLineExact object \e must have been constructed with \e caps + * |= GeodesicLineExact::DISTANCE_IN; otherwise Math::NaN() is returned and + * no parameters are set. Requesting a value which the GeodesicLineExact + * object is not capable of computing is not an error; the corresponding + * argument will not be altered. + * + * The following functions are overloaded versions of + * GeodesicLineExact::Position which omit some of the output parameters. + * Note, however, that the arc length is always computed and returned as + * the function value. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2); + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + double Position(double s12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + ///@} + + /** \name Position in terms of arc length + **********************************************************************/ + ///@{ + + /** + * Compute the position of point 2 which is an arc length \e a12 (degrees) + * from point 1. + * + * @param[in] a12 arc length between point 1 and point 2 (degrees); it can + * be signed. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::DISTANCE. + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::AREA. + * + * The values of \e lon2 and \e azi2 returned are in the range + * [−180°, 180°). + * + * Requesting a value which the GeodesicLineExact object is not capable of + * computing is not an error; the corresponding argument will not be + * altered. + * + * The following functions are overloaded versions of + * GeodesicLineExact::ArcPosition which omit some of the output parameters. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2); + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2); + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12); + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12); + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(double a12, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21); + ///@} + + /** \name The general position function. + **********************************************************************/ + ///@{ + + /** + * The general position function. GeodesicLineExact::Position and + * GeodesicLineExact::ArcPosition are defined in terms of this function. + * + * @param[in] arcmode boolean flag determining the meaning of the second + * parameter; if arcmode is false, then the GeodesicLineExact object must + * have been constructed with \e caps |= GeodesicLineExact::DISTANCE_IN. + * @param[in] s12_a12 if \e arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be signed. + * @param[in] outmask a bitor'ed combination of NETGeographicLib::Mask + * values specifying which of the following parameters should be set. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::DISTANCE. + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The NETGeographicLib::Mask values possible for \e outmask are + * - \e outmask |= NETGeographicLib::Mask::LATITUDE for the latitude \e lat2; + * - \e outmask |= NETGeographicLib::Mask::LONGITUDE for the latitude \e lon2; + * - \e outmask |= NETGeographicLib::Mask::AZIMUTH for the latitude \e azi2; + * - \e outmask |= NETGeographicLib::Mask::DISTANCE for the distance \e s12; + * - \e outmask |= NETGeographicLib::Mask::REDUCEDLENGTH for the reduced length + * \e m12; + * - \e outmask |= NETGeographicLib::Mask::GEODESICSCALE for the geodesic scales + * \e M12 and \e M21; + * - \e outmask |= NETGeographicLib::Mask::AREA for the area \e S12; + * - \e outmask |= NETGeographicLib::Mask::ALL for all of the above. + * . + * Requesting a value which the GeodesicLineExact object is not capable of + * computing is not an error; the corresponding argument will not be + * altered. Note, however, that the arc length is always computed and + * returned as the function value. + **********************************************************************/ + double GenPosition(bool arcmode, double s12_a12, + NETGeographicLib::Mask outmask, + [System::Runtime::InteropServices::Out] double% lat2, + [System::Runtime::InteropServices::Out] double% lon2, + [System::Runtime::InteropServices::Out] double% azi2, + [System::Runtime::InteropServices::Out] double% s12, + [System::Runtime::InteropServices::Out] double% m12, + [System::Runtime::InteropServices::Out] double% M12, + [System::Runtime::InteropServices::Out] double% M21, + [System::Runtime::InteropServices::Out] double% S12); + + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e lat1 the latitude of point 1 (degrees). + **********************************************************************/ + property double Latitude { double get(); } + + /** + * @return \e lon1 the longitude of point 1 (degrees). + **********************************************************************/ + property double Longitude { double get(); } + + /** + * @return \e azi1 the azimuth (degrees) of the geodesic line at point 1. + **********************************************************************/ + property double Azimuth { double get(); } + + /** + * @return \e azi0 the azimuth (degrees) of the geodesic line as it crosses + * the equator in a northward direction. + **********************************************************************/ + property double EquatorialAzimuth { double get(); } + + /** + * @return \e a1 the arc length (degrees) between the northward equatorial + * crossing and point 1. + **********************************************************************/ + property double EquatorialArc { double get(); } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the GeodesicExact object used in the + * constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the GeodesicExact object used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return \e caps the computational capabilities that this object was + * constructed with. LATITUDE and AZIMUTH are always included. + **********************************************************************/ + NETGeographicLib::Mask Capabilities(); + + /** + * @param[in] testcaps a set of bitor'ed GeodesicLineExact::mask values. + * @return true if the GeodesicLineExact object has all these capabilities. + **********************************************************************/ + bool Capabilities(NETGeographicLib::Mask testcaps); + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geohash.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geohash.cpp new file mode 100644 index 000000000..08c31c8db --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geohash.cpp @@ -0,0 +1,84 @@ +/** + * \file NETGeographicLib/Geohash.cpp + * \brief Implementation for NETGeographicLib::Geohash class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/Geohash.hpp" +#include "Geohash.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +void Geohash::Forward(double lat, double lon, int len, System::String^% geohash) +{ + try + { + std::string l; + GeographicLib::Geohash::Forward( lat, lon, len, l ); + geohash = gcnew System::String( l.c_str() ); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } +} + +//***************************************************************************** +void Geohash::Reverse(System::String^ geohash, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] int% len, + bool centerp ) +{ + try + { + double llat, llon; + int llen; + GeographicLib::Geohash::Reverse( StringConvert::ManagedToUnmanaged( geohash ), + llat, llon, llen, centerp ); + lat = llat; + lon = llon; + len = llen; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +double Geohash::LatitudeResolution(int len) +{ + return GeographicLib::Geohash::LatitudeResolution( len ); +} + +//***************************************************************************** +double Geohash::LongitudeResolution(int len) +{ + return GeographicLib::Geohash::LongitudeResolution( len ); +} + +//***************************************************************************** +int Geohash::GeohashLength(double res) +{ + return GeographicLib::Geohash::GeohashLength( res ); +} + +//***************************************************************************** +int Geohash::GeohashLength(double latres, double lonres) +{ + return GeographicLib::Geohash::GeohashLength( latres, lonres ); +} + +//***************************************************************************** +int Geohash::DecimalPrecision(int len) +{ + return GeographicLib::Geohash::DecimalPrecision( len ); +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geohash.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geohash.h new file mode 100644 index 000000000..c198776a1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geohash.h @@ -0,0 +1,139 @@ +#pragma once +/** + * \file NETGeographicLib/Geohash.h + * \brief Header for NETGeographicLib::Geohash class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::Geohash. + * + * Geohashes are described in + * - http://en.wikipedia.org/wiki/Geohash + * - http://geohash.org/ + * . + * They provide a compact string representation of a particular geographic + * location (expressed as latitude and longitude), with the property that if + * trailing characters are dropped from the string the geographic location + * remains nearby. + * + * C# Example: + * \include example-Geohash.cs + * Managed C++ Example: + * \include example-Geohash.cpp + * Visual Basic Example: + * \include example-Geohash.vb + **********************************************************************/ + public ref class Geohash + { + private: + // hide the constructor since all members of this class are static. + Geohash() {} + public: + + /** + * Convert from geographic coordinates to a geohash. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] len the length of the resulting geohash. + * @param[out] geohash the geohash. + * @exception GeographicErr if \e la is not in [−90°, + * 90°]. + * @exception GeographicErr if \e lon is not in [−540°, + * 540°). + * @exception std::bad_alloc if memory for \e geohash can't be allocated. + * + * Internally, \e len is first put in the range [0, 18]. + * + * If \e lat or \e lon is NaN, the returned geohash is "nan". + **********************************************************************/ + static void Forward(double lat, double lon, int len, + [System::Runtime::InteropServices::Out] System::String^% geohash); + + /** + * Convert from a geohash to geographic coordinates. + * + * @param[in] geohash the geohash. + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] len the length of the geohash. + * @param[in] centerp if true (the default) return the center of the + * geohash location, otherwise return the south-west corner. + * @exception GeographicErr if \e geohash contains illegal characters. + * + * Only the first 18 characters for \e geohash are considered. The case of + * the letters in \e geohash is ignored. + * + * If the first three characters in \e geohash are "nan", then \e lat and + * \e lon are set to NaN. + **********************************************************************/ + static void Reverse(System::String^ geohash, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] int% len, + bool centerp); + + /** + * The latitude resolution of a geohash. + * + * @param[in] len the length of the geohash. + * @return the latitude resolution (degrees). + * + * Internally, \e len is first put in the range [0, 18]. + **********************************************************************/ + static double LatitudeResolution(int len); + + /** + * The longitude resolution of a geohash. + * + * @param[in] len the length of the geohash. + * @return the longitude resolution (degrees). + * + * Internally, \e len is first put in the range [0, 18]. + **********************************************************************/ + static double LongitudeResolution(int len); + + /** + * The geohash length required to meet a given geographic resolution. + * + * @param[in] res the minimum of resolution in latitude and longitude + * (degrees). + * @return geohash length. + * + * The returned length is in the range [0, 18]. + **********************************************************************/ + static int GeohashLength(double res); + + /** + * The geohash length required to meet a given geographic resolution. + * + * @param[in] latres the resolution in latitude (degrees). + * @param[in] lonres the resolution in longitude (degrees). + * @return geohash length. + * + * The returned length is in the range [0, 18]. + **********************************************************************/ + static int GeohashLength(double latres, double lonres); + + /** + * The decimal geographic precision required to match a given geohash + * length. This is the number of digits needed after decimal point in a + * decimal degrees representation. + * + * @param[in] len the length of the geohash. + * @return the decimal precision (may be negative). + * + * Internally, \e len is first put in the range [0, 18]. The returned + * decimal precision is in the range [−2, 12]. + **********************************************************************/ + static int DecimalPrecision(int len); + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geoid.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geoid.cpp new file mode 100644 index 000000000..9814d166d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geoid.cpp @@ -0,0 +1,215 @@ +/** + * \file NETGeographicLib/Geoid.cpp + * \brief Implementation for NETGeographicLib::Geoid class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/Geoid.hpp" +#include "Geoid.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +Geoid::!Geoid(void) +{ + if ( m_pGeoid != NULL ) + { + delete m_pGeoid; + m_pGeoid = NULL; + } +} + +//***************************************************************************** +Geoid::Geoid(System::String^ name, System::String^ path, + bool cubic, bool threadsafe) +{ + if ( name == nullptr ) throw gcnew GeographicErr("name cannot be a null pointer."); + if ( path == nullptr ) throw gcnew GeographicErr("path cannot be a null pointer."); + try + { + m_pGeoid = new GeographicLib::Geoid( + StringConvert::ManagedToUnmanaged( name ), + StringConvert::ManagedToUnmanaged( path ), + cubic, threadsafe ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::Geoid" ); + } + catch ( const GeographicLib::GeographicErr& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} +//***************************************************************************** +void Geoid::CacheArea(double south, double west, double north, double east) +{ + try + { + m_pGeoid->CacheArea( south, west, north, east ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void Geoid::CacheAll() +{ + try + { + m_pGeoid->CacheAll(); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void Geoid::CacheClear() +{ + m_pGeoid->CacheClear(); +} + +//***************************************************************************** +double Geoid::Height(double lat, double lon) +{ + try + { + return m_pGeoid->operator()( lat, lon ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +double Geoid::Height(double lat, double lon, + [System::Runtime::InteropServices::Out] double% gradn, + [System::Runtime::InteropServices::Out] double% grade) +{ + try + { + double lgradn, lgrade; + double out = m_pGeoid->operator()( lat, lon, lgradn, lgrade ); + gradn = lgradn; + grade = lgrade; + return out; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +double Geoid::ConvertHeight(double lat, double lon, double h, + ConvertFlag d) +{ + try + { + return m_pGeoid->ConvertHeight( lat, lon, h, + static_cast(d) ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +System::String^ Geoid::DefaultGeoidPath() +{ + try + { + return StringConvert::UnmanagedToManaged( + GeographicLib::Geoid::DefaultGeoidPath() ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +System::String^ Geoid::DefaultGeoidName() +{ + try + { + return StringConvert::UnmanagedToManaged( + GeographicLib::Geoid::DefaultGeoidName() ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +System::String^ Geoid::Description::get() +{ return StringConvert::UnmanagedToManaged(m_pGeoid->Description()); } + +//***************************************************************************** +System::String^ Geoid::DateTime::get() +{ return StringConvert::UnmanagedToManaged(m_pGeoid->DateTime()); } + +//***************************************************************************** +System::String^ Geoid::GeoidFile::get() +{ return StringConvert::UnmanagedToManaged(m_pGeoid->GeoidFile()); } + +//***************************************************************************** +System::String^ Geoid::GeoidName::get() +{ return StringConvert::UnmanagedToManaged(m_pGeoid->GeoidName()); } + +//***************************************************************************** +System::String^ Geoid::GeoidDirectory::get() +{ return StringConvert::UnmanagedToManaged(m_pGeoid->GeoidDirectory()); } + +//***************************************************************************** +System::String^ Geoid::Interpolation::get() +{ return StringConvert::UnmanagedToManaged(m_pGeoid->Interpolation()); } + +//***************************************************************************** +double Geoid::MaxError::get() { return m_pGeoid->MaxError(); } + +//***************************************************************************** +double Geoid::RMSError::get() { return m_pGeoid->RMSError(); } + +//***************************************************************************** +double Geoid::Offset::get() { return m_pGeoid->Offset(); } + +//***************************************************************************** +double Geoid::Scale::get() { return m_pGeoid->Scale(); } + +//***************************************************************************** +bool Geoid::ThreadSafe::get() { return m_pGeoid->ThreadSafe(); } + +//***************************************************************************** +bool Geoid::Cache::get() { return m_pGeoid->Cache(); } + +//***************************************************************************** +double Geoid::CacheWest::get() { return m_pGeoid->CacheWest(); } + +//***************************************************************************** +double Geoid::CacheEast::get() { return m_pGeoid->CacheEast(); } + +//***************************************************************************** +double Geoid::CacheNorth::get() { return m_pGeoid->CacheNorth(); } + +//***************************************************************************** +double Geoid::CacheSouth::get() { return m_pGeoid->CacheSouth(); } + +//***************************************************************************** +double Geoid::MajorRadius::get() { return m_pGeoid->MajorRadius(); } + +//***************************************************************************** +double Geoid::Flattening::get() { return m_pGeoid->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geoid.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geoid.h new file mode 100644 index 000000000..a3b9b81f8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Geoid.h @@ -0,0 +1,379 @@ +#pragma once +/** + * \file NETGeographicLib/Geoid.h + * \brief Header for NETGeographicLib::Geoid class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::Geoid. + * + * This class allows .NET applications to access GeographicLib::Geoid. + * + * This class evaluated the height of one of the standard geoids, EGM84, + * EGM96, or EGM2008 by bilinear or cubic interpolation into a rectangular + * grid of data. These geoid models are documented in + * - EGM84: + * http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html + * - EGM96: + * http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html + * - EGM2008: + * http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008 + * + * The geoids are defined in terms of spherical harmonics. However in order + * to provide a quick and flexible method of evaluating the geoid heights, + * this class evaluates the height by interpolation into a grid of + * precomputed values. + * + * See \ref geoid for details of how to install the data sets, the data + * format, estimates of the interpolation errors, and how to use caching. + * + * In addition to returning the geoid height, the gradient of the geoid can + * be calculated. The gradient is defined as the rate of change of the geoid + * as a function of position on the ellipsoid. This uses the parameters for + * the WGS84 ellipsoid. The gradient defined in terms of the interpolated + * heights. As a result of the way that the geoid data is stored, the + * calculation of gradients can result in large quantization errors. This is + * particularly acute for fine grids, at high latitudes, and for the easterly + * gradient. + * + * This class is typically \e not thread safe in that a single instantiation + * cannot be safely used by multiple threads because of the way the object + * reads the data set and because it maintains a single-cell cache. If + * multiple threads need to calculate geoid heights they should all construct + * thread-local instantiations. Alternatively, set the optional \e + * threadsafe parameter to true in the constructor. This causes the + * constructor to read all the data into memory and to turn off the + * single-cell caching which results in a Geoid object which \e is thread + * safe. + * + * C# Example: + * \include example-Geoid.cs + * Managed C++ Example: + * \include example-Geoid.cpp + * Visual Basic Example: + * \include example-Geoid.vb + * + * INTERFACE DIFFERENCES:
+ * The () operator has been replaced with Height method. + * + * The following functions are implemented as properties: + * Description, DateTime, GeoidFile, GeoidName, GeoidDirectory, + * Interpolation, MaxError, RMSError, Offset, Scale, ThreadSafe, + * Cache, CacheWest, CacheEast, CacheNorth, CacheSouth, MajorRadius, + * and Flattening. + **********************************************************************/ + public ref class Geoid + { + private: + // a pointer to the unmanaged GeographicLib::Geoid. + const GeographicLib::Geoid* m_pGeoid; + + // the finalizer frees hthe unmanaged memory when the object is destroyed. + !Geoid(void); + public: + /** + * Flags indicating conversions between heights above the geoid and heights + * above the ellipsoid. + **********************************************************************/ + enum class ConvertFlag { + /** + * The multiplier for converting from heights above the geoid to heights + * above the ellipsoid. + **********************************************************************/ + ELLIPSOIDTOGEOID = -1, + /** + * No conversion. + **********************************************************************/ + NONE = 0, + /** + * The multiplier for converting from heights above the ellipsoid to + * heights above the geoid. + **********************************************************************/ + GEOIDTOELLIPSOID = 1, + }; + + /** \name Setting up the geoid + **********************************************************************/ + ///@{ + /** + * Construct a geoid. + * + * @param[in] name the name of the geoid. + * @param[in] path (optional) directory for data file. + * @param[in] cubic (optional) interpolation method; false means bilinear, + * true (the default) means cubic. + * @param[in] threadsafe (optional), if true, construct a thread safe + * object. The default is false + * @exception GeographicErr if the data file cannot be found, is + * unreadable, or is corrupt. + * @exception GeographicErr if \e threadsafe is true but the memory + * necessary for caching the data can't be allocated. + * + * The data file is formed by appending ".pgm" to the name. If \e path is + * specified (and is non-empty), then the file is loaded from directory, \e + * path. Otherwise the path is given by DefaultGeoidPath(). If the \e + * threadsafe parameter is true, the data set is read into memory, the data + * file is closed, and single-cell caching is turned off; this results in a + * Geoid object which \e is thread safe. + **********************************************************************/ + Geoid(System::String^ name, System::String^ path, + bool cubic, bool threadsafe); + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~Geoid() + { this->!Geoid(); } + + /** + * Set up a cache. + * + * @param[in] south latitude (degrees) of the south edge of the cached area. + * @param[in] west longitude (degrees) of the west edge of the cached area. + * @param[in] north latitude (degrees) of the north edge of the cached area. + * @param[in] east longitude (degrees) of the east edge of the cached area. + * @exception GeographicErr if the memory necessary for caching the data + * can't be allocated (in this case, you will have no cache and can try + * again with a smaller area). + * @exception GeographicErr if there's a problem reading the data. + * @exception GeographicErr if this is called on a threadsafe Geoid. + * + * Cache the data for the specified "rectangular" area bounded by the + * parallels \e south and \e north and the meridians \e west and \e east. + * \e east is always interpreted as being east of \e west, if necessary by + * adding 360° to its value. \e south and \e north should be in + * the range [−90°, 90°]; \e west and \e east should + * be in the range [−540°, 540°). + **********************************************************************/ + void CacheArea(double south, double west, double north, double east); + + /** + * Cache all the data. + * + * @exception GeographicErr if the memory necessary for caching the data + * can't be allocated (in this case, you will have no cache and can try + * again with a smaller area). + * @exception GeographicErr if there's a problem reading the data. + * @exception GeographicErr if this is called on a threadsafe Geoid. + * + * On most computers, this is fast for data sets with grid resolution of 5' + * or coarser. For a 1' grid, the required RAM is 450MB; a 2.5' grid needs + * 72MB; and a 5' grid needs 18MB. + **********************************************************************/ + void CacheAll(); + + /** + * Clear the cache. This never throws an error. (This does nothing with a + * thread safe Geoid.) + **********************************************************************/ + void CacheClear(); + + ///@} + + /** \name Compute geoid heights + **********************************************************************/ + ///@{ + /** + * Compute the geoid height at a point + * + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @exception GeographicErr if there's a problem reading the data; this + * never happens if (\e lat, \e lon) is within a successfully cached area. + * @return geoid height (meters). + * + * The latitude should be in [−90°, 90°] and + * longitude should be in [−540°, 540°). + **********************************************************************/ + double Height(double lat, double lon); + + /** + * Compute the geoid height and gradient at a point + * + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @param[out] gradn northerly gradient (dimensionless). + * @param[out] grade easterly gradient (dimensionless). + * @exception GeographicErr if there's a problem reading the data; this + * never happens if (\e lat, \e lon) is within a successfully cached area. + * @return geoid height (meters). + * + * The latitude should be in [−90°, 90°] and + * longitude should be in [−540°, 540°). As a result + * of the way that the geoid data is stored, the calculation of gradients + * can result in large quantization errors. This is particularly acute for + * fine grids, at high latitudes, and for the easterly gradient. If you + * need to compute the direction of the acceleration due to gravity + * accurately, you should use GravityModel::Gravity. + **********************************************************************/ + double Height(double lat, double lon, + [System::Runtime::InteropServices::Out] double% gradn, + [System::Runtime::InteropServices::Out] double% grade); + + /** + * Convert a height above the geoid to a height above the ellipsoid and + * vice versa. + * + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @param[in] h height of the point (degrees). + * @param[in] d a Geoid::convertflag specifying the direction of the + * conversion; Geoid::GEOIDTOELLIPSOID means convert a height above the + * geoid to a height above the ellipsoid; Geoid::ELLIPSOIDTOGEOID means + * convert a height above the ellipsoid to a height above the geoid. + * @exception GeographicErr if there's a problem reading the data; this + * never happens if (\e lat, \e lon) is within a successfully cached area. + * @return converted height (meters). + **********************************************************************/ + double ConvertHeight(double lat, double lon, double h, + ConvertFlag d); + + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return geoid description, if available, in the data file; if + * absent, return "NONE". + **********************************************************************/ + property System::String^ Description { System::String^ get(); } + + /** + * @return date of the data file; if absent, return "UNKNOWN". + **********************************************************************/ + property System::String^ DateTime { System::String^ get(); } + + /** + * @return full file name used to load the geoid data. + **********************************************************************/ + property System::String^ GeoidFile { System::String^ get(); } + + /** + * @return "name" used to load the geoid data (from the first argument of + * the constructor). + **********************************************************************/ + property System::String^ GeoidName { System::String^ get(); } + + /** + * @return directory used to load the geoid data. + **********************************************************************/ + property System::String^ GeoidDirectory { System::String^ get(); } + + /** + * @return interpolation method ("cubic" or "bilinear"). + **********************************************************************/ + property System::String^ Interpolation { System::String^ get(); } + + /** + * @return estimate of the maximum interpolation and quantization error + * (meters). + * + * This relies on the value being stored in the data file. If the value is + * absent, return −1. + **********************************************************************/ + property double MaxError { double get(); } + + /** + * @return estimate of the RMS interpolation and quantization error + * (meters). + * + * This relies on the value being stored in the data file. If the value is + * absent, return −1. + **********************************************************************/ + property double RMSError { double get(); } + + /** + * @return offset (meters). + * + * This in used in converting from the pixel values in the data file to + * geoid heights. + **********************************************************************/ + property double Offset { double get(); } + + /** + * @return scale (meters). + * + * This in used in converting from the pixel values in the data file to + * geoid heights. + **********************************************************************/ + property double Scale { double get(); } + + /** + * @return true if the object is constructed to be thread safe. + **********************************************************************/ + property bool ThreadSafe { bool get(); } + + /** + * @return true if a data cache is active. + **********************************************************************/ + property bool Cache { bool get(); } + + /** + * @return west edge of the cached area; the cache includes this edge. + **********************************************************************/ + property double CacheWest { double get(); } + + /** + * @return east edge of the cached area; the cache excludes this edge. + **********************************************************************/ + property double CacheEast { double get(); } + + /** + * @return north edge of the cached area; the cache includes this edge. + **********************************************************************/ + property double CacheNorth { double get(); } + + /** + * @return south edge of the cached area; the cache excludes this edge + * unless it's the south pole. + **********************************************************************/ + property double CacheSouth { double get(); } + + /** + * @return \e a the equatorial radius of the WGS84 ellipsoid (meters). + * + * (The WGS84 value is returned because the supported geoid models are all + * based on this ellipsoid.) + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the WGS84 ellipsoid. + * + * (The WGS84 value is returned because the supported geoid models are all + * based on this ellipsoid.) + **********************************************************************/ + property double Flattening { double get(); } + ///@} + + /** + * @return the default path for geoid data files. + * + * This is the value of the environment variable GEOID_PATH, if set; + * otherwise, it is $GEOGRAPHICLIB_DATA/geoids if the environment variable + * GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default + * (/usr/local/share/GeographicLib/geoids on non-Windows systems and + * C:/Documents and Settings/All Users/Application + * Data/GeographicLib/geoids on Windows systems). + **********************************************************************/ + static System::String^ DefaultGeoidPath(); + + /** + * @return the default name for the geoid. + * + * This is the value of the environment variable GEOID_NAME, if set, + * otherwise, it is "egm96-5". The Geoid class does not use this function; + * it is just provided as a convenience for a calling program when + * constructing a Geoid object. + **********************************************************************/ + static System::String^ DefaultGeoidName(); + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Gnomonic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Gnomonic.cpp new file mode 100644 index 000000000..5cfee2807 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Gnomonic.cpp @@ -0,0 +1,116 @@ +/** + * \file NETGeographicLib/Gnomonic.cpp + * \brief Implementation for NETGeographicLib::Gnomonic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/Gnomonic.hpp" +#include "Gnomonic.h" +#include "Geodesic.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::Gnomonic"; + +//***************************************************************************** +Gnomonic::!Gnomonic(void) +{ + if ( m_pGnomonic != NULL ) + { + delete m_pGnomonic; + m_pGnomonic = NULL; + } +} + +//***************************************************************************** +Gnomonic::Gnomonic( Geodesic^ earth ) +{ + try + { + const GeographicLib::Geodesic* pGeodesic = + reinterpret_cast( + earth->GetUnmanaged()->ToPointer() ); + m_pGnomonic = new GeographicLib::Gnomonic( *pGeodesic ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +Gnomonic::Gnomonic() +{ + try + { + m_pGnomonic = new GeographicLib::Gnomonic( GeographicLib::Geodesic::WGS84 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void Gnomonic::Forward(double lat0, double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk) +{ + double lx, ly, lazi, lrk; + m_pGnomonic->Forward( lat0, lon0, lat, lon, lx, ly, lazi, lrk ); + x = lx; + y = ly; + azi = lazi; + rk = lrk; +} + +//***************************************************************************** +void Gnomonic::Reverse(double lat0, double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk) +{ + double llat, llon, lazi, lrk; + m_pGnomonic->Reverse( lat0, lon0, x, y, llat, llon, lazi, lrk ); + lat = llat; + lon = llon; + azi = lazi; + rk = lrk; +} + +//***************************************************************************** +void Gnomonic::Forward(double lat0, double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y) +{ + double lx, ly; + m_pGnomonic->Forward( lat0, lon0, lat, lon, lx, ly ); + x = lx; + y = ly; +} + +//***************************************************************************** +void Gnomonic::Reverse(double lat0, double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon; + m_pGnomonic->Reverse( lat0, lon0, x, y, llat, llon ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double Gnomonic::MajorRadius::get() { return m_pGnomonic->MajorRadius(); } + +//***************************************************************************** +double Gnomonic::Flattening::get() { return m_pGnomonic->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Gnomonic.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Gnomonic.h new file mode 100644 index 000000000..67ef1a798 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/Gnomonic.h @@ -0,0 +1,219 @@ +#pragma once +/** + * \file NETGeographicLib/Gnomonic.h + * \brief Header for NETGeographicLib::Gnomonic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class Geodesic; + /** + * \brief .NET wrapper for GeographicLib::Gnomonic. + * + * This class allows .NET applications to access GeographicLib::Gnomonic. + * + * %Gnomonic projection centered at an arbitrary position \e C on the + * ellipsoid. This projection is derived in Section 8 of + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * . + * The projection of \e P is defined as follows: compute the geodesic line + * from \e C to \e P; compute the reduced length \e m12, geodesic scale \e + * M12, and ρ = m12/\e M12; finally \e x = ρ sin \e azi1; \e + * y = ρ cos \e azi1, where \e azi1 is the azimuth of the geodesic at \e + * C. The Gnomonic::Forward and Gnomonic::Reverse methods also return the + * azimuth \e azi of the geodesic at \e P and reciprocal scale \e rk in the + * azimuthal direction. The scale in the radial direction if + * 1/rk2. + * + * For a sphere, ρ is reduces to \e a tan(s12/a), where \e + * s12 is the length of the geodesic from \e C to \e P, and the gnomonic + * projection has the property that all geodesics appear as straight lines. + * For an ellipsoid, this property holds only for geodesics interesting the + * centers. However geodesic segments close to the center are approximately + * straight. + * + * Consider a geodesic segment of length \e l. Let \e T be the point on the + * geodesic (extended if necessary) closest to \e C the center of the + * projection and \e t be the distance \e CT. To lowest order, the maximum + * deviation (as a true distance) of the corresponding gnomonic line segment + * (i.e., with the same end points) from the geodesic is
+ *
+ * (K(T) - K(C)) + * l2 \e t / 32.
+ *
+ * where \e K is the Gaussian curvature. + * + * This result applies for any surface. For an ellipsoid of revolution, + * consider all geodesics whose end points are within a distance \e r of \e + * C. For a given \e r, the deviation is maximum when the latitude of \e C + * is 45°, when endpoints are a distance \e r away, and when their + * azimuths from the center are ± 45° or ± 135°. + * To lowest order in \e r and the flattening \e f, the deviation is \e f + * (r/2a)3 \e r. + * + * The conversions all take place using a Geodesic object (by default + * Geodesic::WGS84). For more information on geodesics see \ref geodesic. + * + * CAUTION: The definition of this projection for a sphere is + * standard. However, there is no standard for how it should be extended to + * an ellipsoid. The choices are: + * - Declare that the projection is undefined for an ellipsoid. + * - Project to a tangent plane from the center of the ellipsoid. This + * causes great ellipses to appear as straight lines in the projection; + * i.e., it generalizes the spherical great circle to a great ellipse. + * This was proposed by independently by Bowring and Williams in 1997. + * - Project to the conformal sphere with the constant of integration chosen + * so that the values of the latitude match for the center point and + * perform a central projection onto the plane tangent to the conformal + * sphere at the center point. This causes normal sections through the + * center point to appear as straight lines in the projection; i.e., it + * generalizes the spherical great circle to a normal section. This was + * proposed by I. G. Letoval'tsev, Generalization of the %Gnomonic + * Projection for a Spheroid and the Principal Geodetic Problems Involved + * in the Alignment of Surface Routes, Geodesy and Aerophotography (5), + * 271--274 (1963). + * - The projection given here. This causes geodesics close to the center + * point to appear as straight lines in the projection; i.e., it + * generalizes the spherical great circle to a geodesic. + * + * C# Example: + * \include example-Gnomonic.cs + * Managed C++ Example: + * \include example-Gnomonic.cpp + * Visual Basic Example: + * \include example-Gnomonic.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor has been provided that assumes WGS84 parameters. + * + * The MajorRadius and Flattening functions are implemented as properties. + **********************************************************************/ + public ref class Gnomonic + { + private: + // the pointer to the unmanaged GeographicLib::Gnomonic. + const GeographicLib::Gnomonic* m_pGnomonic; + + // The finalizer frees the unmanaged memory when the object is destroyed. + !Gnomonic(void); + public: + /** + * Constructor for Gnomonic. + * + * @param[in] earth the Geodesic object to use for geodesic calculations. + **********************************************************************/ + Gnomonic( Geodesic^ earth ); + + /** + * The default constructor assumes a WGS84 ellipsoid.. + **********************************************************************/ + Gnomonic(); + + /** + * The destructor calls the finalizer + **********************************************************************/ + ~Gnomonic() + { this->!Gnomonic(); } + + /** + * Forward projection, from geographic to gnomonic. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] azi azimuth of geodesic at point (degrees). + * @param[out] rk reciprocal of azimuthal scale at point. + * + * \e lat0 and \e lat should be in the range [−90°, 90°] and + * \e lon0 and \e lon should be in the range [−540°, 540°). + * The scale of the projection is 1/rk2 in the "radial" + * direction, \e azi clockwise from true north, and is 1/\e rk in the + * direction perpendicular to this. If the point lies "over the horizon", + * i.e., if \e rk ≤ 0, then NaNs are returned for \e x and \e y (the + * correct values are returned for \e azi and \e rk). A call to Forward + * followed by a call to Reverse will return the original (\e lat, \e lon) + * (to within roundoff) provided the point in not over the horizon. + **********************************************************************/ + void Forward(double lat0, double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk); + + /** + * Reverse projection, from gnomonic to geographic. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] azi azimuth of geodesic at point (degrees). + * @param[out] rk reciprocal of azimuthal scale at point. + * + * \e lat0 should be in the range [−90°, 90°] and \e + * lon0 should be in the range [−540°, 540°). \e lat + * will be in the range [−90°, 90°] and \e lon will + * be in the range [−180°, 180°). The scale of the + * projection is 1/\e rk2 in the "radial" direction, \e azi + * clockwise from true north, and is 1/\e rk in the direction perpendicular + * to this. Even though all inputs should return a valid \e lat and \e + * lon, it's possible that the procedure fails to converge for very large + * \e x or \e y; in this case NaNs are returned for all the output + * arguments. A call to Reverse followed by a call to Forward will return + * the original (\e x, \e y) (to roundoff). + **********************************************************************/ + void Reverse(double lat0, double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% azi, + [System::Runtime::InteropServices::Out] double% rk); + + /** + * Gnomonic::Forward without returning the azimuth and scale. + **********************************************************************/ + void Forward(double lat0, double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * Gnomonic::Reverse without returning the azimuth and scale. + **********************************************************************/ + void Reverse(double lat0, double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityCircle.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityCircle.cpp new file mode 100644 index 000000000..3b155cd21 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityCircle.cpp @@ -0,0 +1,178 @@ +/** + * \file NETGeographicLib/GravityCircle.cpp + * \brief Implementation for NETGeographicLib::GravityCircle class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/GravityCircle.hpp" +#include "GravityModel.h" +#include "GravityCircle.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +GravityCircle::!GravityCircle(void) +{ + if ( m_pGravityCircle != NULL ) + { + delete m_pGravityCircle; + m_pGravityCircle = NULL; + } +} + +//***************************************************************************** +GravityCircle::GravityCircle( const GeographicLib::GravityCircle& gc ) +{ + try + { + m_pGravityCircle = new GeographicLib::GravityCircle(gc); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::GravityCircle" ); + } +} + +//***************************************************************************** +double GravityCircle::Gravity(double lon, + [System::Runtime::InteropServices::Out] double% gx, + [System::Runtime::InteropServices::Out] double% gy, + [System::Runtime::InteropServices::Out] double% gz) +{ + double lgx, lgy, lgz; + double out = m_pGravityCircle->Gravity( lon, lgx, lgy, lgz ); + gx = lgx; + gy = lgy; + gz = lgz; + return out; +} + +//***************************************************************************** +double GravityCircle::Disturbance(double lon, + [System::Runtime::InteropServices::Out] double% deltax, + [System::Runtime::InteropServices::Out] double% deltay, + [System::Runtime::InteropServices::Out] double% deltaz) +{ + double ldeltax, ldeltay, ldeltaz; + double out = m_pGravityCircle->Disturbance( lon, ldeltax, ldeltay, ldeltaz ); + deltax = ldeltax; + deltay = ldeltay; + deltaz = ldeltaz; + return out; +} + +//***************************************************************************** +double GravityCircle::GeoidHeight(double lon) +{ + return m_pGravityCircle->GeoidHeight( lon ); +} + +//***************************************************************************** +void GravityCircle::SphericalAnomaly(double lon, + [System::Runtime::InteropServices::Out] double% Dg01, + [System::Runtime::InteropServices::Out] double% xi, + [System::Runtime::InteropServices::Out] double% eta) +{ + double lDg01, lxi, leta; + m_pGravityCircle->SphericalAnomaly( lon, lDg01, lxi, leta ); + Dg01 = lDg01; + xi = lxi; + eta = leta; +} + +//***************************************************************************** +double GravityCircle::W(double lon, + [System::Runtime::InteropServices::Out] double% gX, + [System::Runtime::InteropServices::Out] double% gY, + [System::Runtime::InteropServices::Out] double% gZ) +{ + double lgx, lgy, lgz; + double out = m_pGravityCircle->W( lon, lgx, lgy, lgz ); + gX = lgx; + gY = lgy; + gZ = lgz; + return out; +} + +//***************************************************************************** +double GravityCircle::V(double lon, + [System::Runtime::InteropServices::Out] double% GX, + [System::Runtime::InteropServices::Out] double% GY, + [System::Runtime::InteropServices::Out] double% GZ) +{ + double lgx, lgy, lgz; + double out = m_pGravityCircle->V( lon, lgx, lgy, lgz ); + GX = lgx; + GY = lgy; + GZ = lgz; + return out; +} + +//***************************************************************************** +double GravityCircle::T(double lon, + [System::Runtime::InteropServices::Out] double% deltaX, + [System::Runtime::InteropServices::Out] double% deltaY, + [System::Runtime::InteropServices::Out] double% deltaZ) +{ + double lgx, lgy, lgz; + double out = m_pGravityCircle->T( lon, lgx, lgy, lgz ); + deltaX = lgx; + deltaY = lgy; + deltaZ = lgz; + return out; +} + +//***************************************************************************** +double GravityCircle::T(double lon) +{ + return m_pGravityCircle->T( lon ); +} + +//***************************************************************************** +double GravityCircle::MajorRadius::get() +{ + if ( m_pGravityCircle->Init() ) + return m_pGravityCircle->MajorRadius(); + throw gcnew GeographicErr("GravityCircle::MajorRadius failed because the GravityCircle is not initialized."); +} + +//***************************************************************************** +double GravityCircle::Flattening::get() +{ + if ( m_pGravityCircle->Init() ) + return m_pGravityCircle->Flattening(); + throw gcnew GeographicErr("GravityCircle::Flattening failed because the GravityCircle is not initialized."); +} + +//***************************************************************************** +double GravityCircle::Latitude::get() +{ + if ( m_pGravityCircle->Init() ) + return m_pGravityCircle->Latitude(); + throw gcnew GeographicErr("GravityCircle::Latitude failed because the GravityCircle is not initialized."); +} + +//***************************************************************************** +double GravityCircle::Height::get() +{ + if ( m_pGravityCircle->Init() ) + return m_pGravityCircle->Height(); + throw gcnew GeographicErr("GravityCircle::Height failed because the GravityCircle is not initialized."); +} + +//***************************************************************************** +bool GravityCircle::Init::get() { return m_pGravityCircle->Init(); } + +//***************************************************************************** +GravityModel::Mask GravityCircle::Capabilities() +{ return static_cast(m_pGravityCircle->Capabilities()); } + +//***************************************************************************** +bool GravityCircle::Capabilities(GravityModel::Mask testcaps) +{ return m_pGravityCircle->Capabilities( (unsigned int)testcaps ); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityCircle.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityCircle.h new file mode 100644 index 000000000..8a789f6d5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityCircle.h @@ -0,0 +1,256 @@ +#pragma once +/** + * \file NETGeographicLib/GravityCircle.h + * \brief Header for NETGeographicLib::GravityCircle class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::GravityCircle. + * + * This class allows .NET applications to access GeographicLib::GravityCircle. + * + * Evaluate the earth's gravity field on a circle of constant height and + * latitude. This uses a CircularEngine to pre-evaluate the inner sum of the + * spherical harmonic sum, allowing the values of the field at several + * different longitudes to be evaluated rapidly. + * + * Use GravityModel::Circle to create a GravityCircle object. (The + * constructor for this class is for internal use only.) + * + * C# Example: + * \include example-GravityCircle.cs + * Managed C++ Example: + * \include example-GravityCircle.cpp + * Visual Basic Example: + * \include example-GravityCircle.vb + * + * INTERFACE DIFFERENCES:
+ * The following functions are implemented as properties: + * Init, MajorRadius, Flattening, Latitude, and Height. + * + * The Capabilities functions accept and return the "capabilities mask" + * as a NETGeographicLib::GravityModel::Mask rather than an unsigned. + **********************************************************************/ + public ref class GravityCircle + { + private: + // the pointer to the unmanaged GeographicLib::GravityCircle. + const GeographicLib::GravityCircle* m_pGravityCircle; + + // the finalizer frees the unmanaged memory when the object is destroyed. + !GravityCircle(void); + public: + /** + * A constructor that is initialized from an unmanaged + * GeographicLib::GravityCircle. For internal use only. Developers + * should use GravityModel::Circle to create a GavityCircle object. + **********************************************************************/ + GravityCircle( const GeographicLib::GravityCircle& gc ); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~GravityCircle() + { this->!GravityCircle(); } + + /** \name Compute the gravitational field + **********************************************************************/ + ///@{ + /** + * Evaluate the gravity. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] gx the easterly component of the acceleration + * (m s−2). + * @param[out] gy the northerly component of the acceleration + * (m s−2). + * @param[out] gz the upward component of the acceleration + * (m s−2); this is usually negative. + * @return \e W the sum of the gravitational and centrifugal potentials. + * + * The function includes the effects of the earth's rotation. + **********************************************************************/ + double Gravity(double lon, + [System::Runtime::InteropServices::Out] double% gx, + [System::Runtime::InteropServices::Out] double% gy, + [System::Runtime::InteropServices::Out] double% gz); + + /** + * Evaluate the gravity disturbance vector. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] deltax the easterly component of the disturbance vector + * (m s−2). + * @param[out] deltay the northerly component of the disturbance vector + * (m s−2). + * @param[out] deltaz the upward component of the disturbance vector + * (m s−2). + * @return \e T the corresponding disturbing potential. + **********************************************************************/ + double Disturbance(double lon, + [System::Runtime::InteropServices::Out] double% deltax, + [System::Runtime::InteropServices::Out] double% deltay, + [System::Runtime::InteropServices::Out] double% deltaz); + + /** + * Evaluate the geoid height. + * + * @param[in] lon the geographic longitude (degrees). + * @return \e N the height of the geoid above the reference ellipsoid + * (meters). + * + * Some approximations are made in computing the geoid height so that the + * results of the NGA codes are reproduced accurately. Details are given + * in \ref gravitygeoid. + **********************************************************************/ + double GeoidHeight(double lon); + + /** + * Evaluate the components of the gravity anomaly vector using the + * spherical approximation. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] Dg01 the gravity anomaly (m s−2). + * @param[out] xi the northerly component of the deflection of the vertical + * (degrees). + * @param[out] eta the easterly component of the deflection of the vertical + * (degrees). + * + * The spherical approximation (see Heiskanen and Moritz, Sec 2-14) is used + * so that the results of the NGA codes are reproduced accurately. + * approximations used here. Details are given in \ref gravitygeoid. + **********************************************************************/ + void SphericalAnomaly(double lon, + [System::Runtime::InteropServices::Out] double% Dg01, + [System::Runtime::InteropServices::Out] double% xi, + [System::Runtime::InteropServices::Out] double% eta); + + /** + * Evaluate the components of the acceleration due to gravity and the + * centrifugal acceleration in geocentric coordinates. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] gX the \e X component of the acceleration + * (m s−2). + * @param[out] gY the \e Y component of the acceleration + * (m s−2). + * @param[out] gZ the \e Z component of the acceleration + * (m s−2). + * @return \e W = \e V + Φ the sum of the gravitational and + * centrifugal potentials (m2 s−2). + **********************************************************************/ + double W(double lon, + [System::Runtime::InteropServices::Out] double% gX, + [System::Runtime::InteropServices::Out] double% gY, + [System::Runtime::InteropServices::Out] double% gZ); + + /** + * Evaluate the components of the acceleration due to gravity in geocentric + * coordinates. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] GX the \e X component of the acceleration + * (m s−2). + * @param[out] GY the \e Y component of the acceleration + * (m s−2). + * @param[out] GZ the \e Z component of the acceleration + * (m s−2). + * @return \e V = \e W - Φ the gravitational potential + * (m2 s−2). + **********************************************************************/ + double V(double lon, + [System::Runtime::InteropServices::Out] double% GX, + [System::Runtime::InteropServices::Out] double% GY, + [System::Runtime::InteropServices::Out] double% GZ); + + /** + * Evaluate the components of the gravity disturbance in geocentric + * coordinates. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] deltaX the \e X component of the gravity disturbance + * (m s−2). + * @param[out] deltaY the \e Y component of the gravity disturbance + * (m s−2). + * @param[out] deltaZ the \e Z component of the gravity disturbance + * (m s−2). + * @return \e T = \e W - \e U the disturbing potential (also called the + * anomalous potential) (m2 s−2). + **********************************************************************/ + double T(double lon, + [System::Runtime::InteropServices::Out] double% deltaX, + [System::Runtime::InteropServices::Out] double% deltaY, + [System::Runtime::InteropServices::Out] double% deltaZ); + + /** + * Evaluate disturbing potential in geocentric coordinates. + * + * @param[in] lon the geographic longitude (degrees). + * @return \e T = \e W - \e U the disturbing potential (also called the + * anomalous potential) (m2 s−2). + **********************************************************************/ + double T(double lon); + + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return true if the object has been initialized. + **********************************************************************/ + property bool Init { bool get(); } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the GravityModel object used in the + * constructor. + * This property throws an exception if the GravityCircles has not + * been initialized. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the GravityModel object used in the constructor. + * This property throws an exception if the GravityCircles has not + * been initialized. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return the latitude of the circle (degrees). + * This property throws an exception if the GravityCircles has not + * been initialized. + **********************************************************************/ + property double Latitude { double get(); } + + /** + * @return the height of the circle (meters). + * This property throws an exception if the GravityCircles has not + * been initialized. + **********************************************************************/ + property double Height { double get(); } + + /** + * @return \e caps the computational capabilities that this object was + * constructed with. + **********************************************************************/ + GravityModel::Mask Capabilities(); + + /** + * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values. + * @return true if the GeodesicLine object has all these capabilities. + **********************************************************************/ + bool Capabilities(GravityModel::Mask testcaps); + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityModel.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityModel.cpp new file mode 100644 index 000000000..7504a9de9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityModel.cpp @@ -0,0 +1,266 @@ +/** + * \file NETGeographicLib/GravityModel.cpp + * \brief Implementation for NETGeographicLib::GravityModel class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/GravityModel.hpp" +#include "GravityModel.h" +#include "GeographicLib/GravityCircle.hpp" +#include "GravityCircle.h" +#include "NormalGravity.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +GravityModel::!GravityModel(void) +{ + if ( m_pGravityModel != NULL ) + { + delete m_pGravityModel; + m_pGravityModel = NULL; + } +} + +//***************************************************************************** +GravityModel::GravityModel(System::String^ name, System::String^ path) +{ + if ( name == nullptr ) throw gcnew GeographicErr("name cannot be a null pointer."); + if ( path == nullptr ) throw gcnew GeographicErr("path cannot be a null pointer."); + try + { + m_pGravityModel = new GeographicLib::GravityModel( + StringConvert::ManagedToUnmanaged( name ), + StringConvert::ManagedToUnmanaged( path )); + } + catch ( std::bad_alloc err ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::GravityModel" ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +double GravityModel::Gravity(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% gx, + [System::Runtime::InteropServices::Out] double% gy, + [System::Runtime::InteropServices::Out] double% gz) +{ + double lgx, lgy, lgz; + double out = m_pGravityModel->Gravity( lat, lon, h, lgx, lgy, lgz ); + gx = lgx; + gy = lgy; + gz = lgz; + return out; +} + +//***************************************************************************** +double GravityModel::Disturbance(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% deltax, + [System::Runtime::InteropServices::Out] double% deltay, + [System::Runtime::InteropServices::Out] double% deltaz) +{ + double lgx, lgy, lgz; + double out = m_pGravityModel->Disturbance( lat, lon, h, lgx, lgy, lgz ); + deltax = lgx; + deltay = lgy; + deltaz = lgz; + return out; +} + +//***************************************************************************** +double GravityModel::GeoidHeight(double lat, double lon) +{ + return m_pGravityModel->GeoidHeight( lat, lon ); +} + +//***************************************************************************** +void GravityModel::SphericalAnomaly(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% Dg01, + [System::Runtime::InteropServices::Out] double% xi, + [System::Runtime::InteropServices::Out] double% eta) +{ + double lgx, lgy, lgz; + m_pGravityModel->SphericalAnomaly( lat, lon, h, lgx, lgy, lgz ); + Dg01 = lgx; + xi = lgy; + eta = lgz; +} + +//***************************************************************************** +double GravityModel::W(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% gX, + [System::Runtime::InteropServices::Out] double% gY, + [System::Runtime::InteropServices::Out] double% gZ) +{ + double lgx, lgy, lgz; + double out = m_pGravityModel->W( X, Y, Z, lgx, lgy, lgz ); + gX = lgx; + gY = lgy; + gZ = lgz; + return out; +} + +//***************************************************************************** +double GravityModel::V(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% GX, + [System::Runtime::InteropServices::Out] double% GY, + [System::Runtime::InteropServices::Out] double% GZ) +{ + double lgx, lgy, lgz; + double out = m_pGravityModel->V( X, Y, Z, lgx, lgy, lgz ); + GX = lgx; + GY = lgy; + GZ = lgz; + return out; +} + +//***************************************************************************** +double GravityModel::T(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% deltaX, + [System::Runtime::InteropServices::Out] double% deltaY, + [System::Runtime::InteropServices::Out] double% deltaZ) +{ + double lgx, lgy, lgz; + double out = m_pGravityModel->T( X, Y, Z, lgx, lgy, lgz ); + deltaX = lgx; + deltaY = lgy; + deltaZ = lgz; + return out; +} + +//***************************************************************************** +double GravityModel::T(double X, double Y, double Z) +{ + return m_pGravityModel->T( X, Y, Z ); +} + +//***************************************************************************** +double GravityModel::U(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% gammaX, + [System::Runtime::InteropServices::Out] double% gammaY, + [System::Runtime::InteropServices::Out] double% gammaZ) +{ + double lgx, lgy, lgz; + double out = m_pGravityModel->U( X, Y, Z, lgx, lgy, lgz ); + gammaX = lgx; + gammaY = lgy; + gammaZ = lgz; + return out; +} + +//***************************************************************************** +double GravityModel::Phi(double X, double Y, + [System::Runtime::InteropServices::Out] double% fX, + [System::Runtime::InteropServices::Out] double% fY) +{ + double lgx, lgy; + double out = m_pGravityModel->Phi( X, Y, lgx, lgy ); + fX = lgx; + fY = lgy; + return out; +} + +//***************************************************************************** +GravityCircle^ GravityModel::Circle(double lat, double h, Mask caps ) +{ + try + { + return gcnew GravityCircle( m_pGravityModel->Circle( lat, h, (unsigned)caps ) ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +System::String^ GravityModel::Description::get() +{ + return StringConvert::UnmanagedToManaged( m_pGravityModel->Description() ); +} + +//***************************************************************************** +System::String^ GravityModel::DateTime::get() +{ + return StringConvert::UnmanagedToManaged( m_pGravityModel->DateTime() ); +} + +//***************************************************************************** +System::String^ GravityModel::GravityFile::get() +{ + return StringConvert::UnmanagedToManaged( m_pGravityModel->GravityFile() ); +} + +//***************************************************************************** +System::String^ GravityModel::GravityModelName::get() +{ + return StringConvert::UnmanagedToManaged( m_pGravityModel->GravityModelName() ); +} + +//***************************************************************************** +System::String^ GravityModel::GravityModelDirectory::get() +{ + return StringConvert::UnmanagedToManaged( m_pGravityModel->GravityModelDirectory() ); +} + +//***************************************************************************** +System::String^ GravityModel::DefaultGravityPath() +{ + try + { + return StringConvert::UnmanagedToManaged( GeographicLib::GravityModel::DefaultGravityPath() ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +System::String^ GravityModel::DefaultGravityName() +{ + try + { + return StringConvert::UnmanagedToManaged( GeographicLib::GravityModel::DefaultGravityName() ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +NormalGravity^ GravityModel::ReferenceEllipsoid() +{ + return gcnew NormalGravity( m_pGravityModel->ReferenceEllipsoid() ); +} + +//***************************************************************************** +double GravityModel::MajorRadius::get() +{ return m_pGravityModel->MajorRadius(); } + +//***************************************************************************** +double GravityModel::MassConstant::get() +{ return m_pGravityModel->MassConstant(); } + +//***************************************************************************** +double GravityModel::ReferenceMassConstant::get() +{ return m_pGravityModel->ReferenceMassConstant(); } + +//***************************************************************************** +double GravityModel::AngularVelocity::get() +{ return m_pGravityModel->AngularVelocity(); } + +//***************************************************************************** +double GravityModel::Flattening::get() +{ return m_pGravityModel->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityModel.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityModel.h new file mode 100644 index 000000000..b56d5f0e6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/GravityModel.h @@ -0,0 +1,513 @@ +#pragma once +/** + * \file NETGeographicLib/GravityModel.h + * \brief Header for NETGeographicLib::GravityModel class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class GravityCircle; + ref class NormalGravity; + /** + * \brief .NET wrapper for GeographicLib::GravityModel. + * + * This class allows .NET applications to access GeographicLib::GravityModel. + * + * Evaluate the earth's gravity field according to a model. The supported + * models treat only the gravitational field exterior to the mass of the + * earth. When computing the field at points near (but above) the surface of + * the earth a small correction can be applied to account for the mass of the + * atomsphere above the point in question; see \ref gravityatmos. + * Determining the geoid height entails correcting for the mass of the earth + * above the geoid. The egm96 and egm2008 include separate correction terms + * to account for this mass. + * + * Definitions and terminology (from Heiskanen and Moritz, Sec 2-13): + * - \e V = gravitational potential; + * - Φ = rotational potential; + * - \e W = \e V + Φ = \e T + \e U = total potential; + * - V0 = normal gravitation potential; + * - \e U = V0 + Φ = total normal potential; + * - \e T = \e W − \e U = \e V − V0 = anomalous + * or disturbing potential; + * - g = ∇\e W = γ + δ; + * - f = ∇Φ; + * - Γ = ∇V0; + * - γ = ∇\e U; + * - δ = ∇\e T = gravity disturbance vector + * = gPγP; + * - δ\e g = gravity disturbance = \e gP − + * γP; + * - Δg = gravity anomaly vector = gP + * − γQ; here the line \e PQ is + * perpendicular to ellipsoid and the potential at \e P equals the normal + * potential at \e Q; + * - Δ\e g = gravity anomaly = \e gP − + * γQ; + * - (ξ, η) deflection of the vertical, the difference in + * directions of gP and + * γQ, ξ = NS, η = EW. + * - \e X, \e Y, \e Z, geocentric coordinates; + * - \e x, \e y, \e z, local cartesian coordinates used to denote the east, + * north and up directions. + * + * See \ref gravity for details of how to install the gravity model and the + * data format. + * + * References: + * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San + * Francisco, 1967). + * + * C# Example: + * \include example-GravityModel.cs + * Managed C++ Example: + * \include example-GravityModel.cpp + * Visual Basic Example: + * \include example-GravityModel.vb + * + * INTERFACE DIFFERENCES:
+ * The following functions are implemented as properties: + * Description, DateTime, GravityFile, GravityModelName, + * GravityModelDirectory, MajorRadius, MassConstant, + * ReferenceMassConstant, AngularVelocity, and Flattening. + * + * The Circle function accepts the "capabilities mask" as a + * NETGeographicLib::GravityModel::Mask rather than an unsigned. + **********************************************************************/ + public ref class GravityModel + { + private: + // pointer to the unmanaged GeographicLib::GravityModel. + const GeographicLib::GravityModel* m_pGravityModel; + + // the finalizer frees the unmanaged memory when the object is destroyed. + !GravityModel(void); + + enum class CapType { + CAP_NONE = 0U, + CAP_G = 1U<<0, // implies potentials W and V + CAP_T = 1U<<1, + CAP_DELTA = 1U<<2 | CapType::CAP_T, // delta implies T? + CAP_C = 1U<<3, + CAP_GAMMA0 = 1U<<4, + CAP_GAMMA = 1U<<5, + CAP_ALL = 0x3FU, + }; + + public: + + /** + * Bit masks for the capabilities to be given to the GravityCircle object + * produced by Circle. + **********************************************************************/ + enum class Mask { + /** + * No capabilities. + * @hideinitializer + **********************************************************************/ + NONE = 0U, + /** + * Allow calls to GravityCircle::Gravity, GravityCircle::W, and + * GravityCircle::V. + * @hideinitializer + **********************************************************************/ + GRAVITY = CapType::CAP_G, + /** + * Allow calls to GravityCircle::Disturbance and GravityCircle::T. + * @hideinitializer + **********************************************************************/ + DISTURBANCE = CapType::CAP_DELTA, + /** + * Allow calls to GravityCircle::T(double lon) (i.e., computing the + * disturbing potential and not the gravity disturbance vector). + * @hideinitializer + **********************************************************************/ + DISTURBING_POTENTIAL = CapType::CAP_T, + /** + * Allow calls to GravityCircle::SphericalAnomaly. + * @hideinitializer + **********************************************************************/ + SPHERICAL_ANOMALY = CapType::CAP_DELTA | CapType::CAP_GAMMA, + /** + * Allow calls to GravityCircle::GeoidHeight. + * @hideinitializer + **********************************************************************/ + GEOID_HEIGHT = CapType::CAP_T | CapType::CAP_C | CapType::CAP_GAMMA0, + /** + * All capabilities. + * @hideinitializer + **********************************************************************/ + ALL = CapType::CAP_ALL, + }; + /** \name Setting up the gravity model + **********************************************************************/ + ///@{ + /** + * Construct a gravity model. + * + * @param[in] name the name of the model. + * @param[in] path (optional) directory for data file. + * @exception GeographicErr if the data file cannot be found, is + * unreadable, or is corrupt. + * @exception std::bad_alloc if the memory necessary for storing the model + * can't be allocated. + * + * A filename is formed by appending ".egm" (World Gravity Model) to the + * name. If \e path is specified (and is non-empty), then the file is + * loaded from directory, \e path. Otherwise the path is given by + * DefaultGravityPath(). + * + * This file contains the metadata which specifies the properties of the + * model. The coefficients for the spherical harmonic sums are obtained + * from a file obtained by appending ".cof" to metadata file (so the + * filename ends in ".egm.cof"). + **********************************************************************/ + GravityModel(System::String^ name, System::String^ path); + ///@} + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~GravityModel() + { this->!GravityModel(); } + + /** \name Compute gravity in geodetic coordinates + **********************************************************************/ + ///@{ + /** + * Evaluate the gravity at an arbitrary point above (or below) the + * ellipsoid. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] lon the geographic longitude (degrees). + * @param[in] h the height above the ellipsoid (meters). + * @param[out] gx the easterly component of the acceleration + * (m s−2). + * @param[out] gy the northerly component of the acceleration + * (m s−2). + * @param[out] gz the upward component of the acceleration + * (m s−2); this is usually negative. + * @return \e W the sum of the gravitational and centrifugal potentials. + * + * The function includes the effects of the earth's rotation. + **********************************************************************/ + double Gravity(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% gx, + [System::Runtime::InteropServices::Out] double% gy, + [System::Runtime::InteropServices::Out] double% gz); + + /** + * Evaluate the gravity disturbance vector at an arbitrary point above (or + * below) the ellipsoid. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] lon the geographic longitude (degrees). + * @param[in] h the height above the ellipsoid (meters). + * @param[out] deltax the easterly component of the disturbance vector + * (m s−2). + * @param[out] deltay the northerly component of the disturbance vector + * (m s−2). + * @param[out] deltaz the upward component of the disturbance vector + * (m s−2). + * @return \e T the corresponding disturbing potential. + **********************************************************************/ + double Disturbance(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% deltax, + [System::Runtime::InteropServices::Out] double% deltay, + [System::Runtime::InteropServices::Out] double% deltaz); + + /** + * Evaluate the geoid height. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] lon the geographic longitude (degrees). + * @return \e N the height of the geoid above the ReferenceEllipsoid() + * (meters). + * + * This calls NormalGravity::U for ReferenceEllipsoid(). Some + * approximations are made in computing the geoid height so that the + * results of the NGA codes are reproduced accurately. Details are given + * in \ref gravitygeoid. + **********************************************************************/ + double GeoidHeight(double lat, double lon); + + /** + * Evaluate the components of the gravity anomaly vector using the + * spherical approximation. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] lon the geographic longitude (degrees). + * @param[in] h the height above the ellipsoid (meters). + * @param[out] Dg01 the gravity anomaly (m s−2). + * @param[out] xi the northerly component of the deflection of the vertical + * (degrees). + * @param[out] eta the easterly component of the deflection of the vertical + * (degrees). + * + * The spherical approximation (see Heiskanen and Moritz, Sec 2-14) is used + * so that the results of the NGA codes are reproduced accurately. + * approximations used here. Details are given in \ref gravitygeoid. + **********************************************************************/ + void SphericalAnomaly(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% Dg01, + [System::Runtime::InteropServices::Out] double% xi, + [System::Runtime::InteropServices::Out] double% eta); + ///@} + + /** \name Compute gravity in geocentric coordinates + **********************************************************************/ + ///@{ + /** + * Evaluate the components of the acceleration due to gravity and the + * centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] gX the \e X component of the acceleration + * (m s−2). + * @param[out] gY the \e Y component of the acceleration + * (m s−2). + * @param[out] gZ the \e Z component of the acceleration + * (m s−2). + * @return \e W = \e V + Φ the sum of the gravitational and + * centrifugal potentials (m2 s−2). + * + * This calls NormalGravity::U for ReferenceEllipsoid(). + **********************************************************************/ + double W(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% gX, + [System::Runtime::InteropServices::Out] double% gY, + [System::Runtime::InteropServices::Out] double% gZ); + + /** + * Evaluate the components of the acceleration due to gravity in geocentric + * coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] GX the \e X component of the acceleration + * (m s−2). + * @param[out] GY the \e Y component of the acceleration + * (m s−2). + * @param[out] GZ the \e Z component of the acceleration + * (m s−2). + * @return \e V = \e W - Φ the gravitational potential + * (m2 s−2). + **********************************************************************/ + double V(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% GX, + [System::Runtime::InteropServices::Out] double% GY, + [System::Runtime::InteropServices::Out] double% GZ); + + /** + * Evaluate the components of the gravity disturbance in geocentric + * coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] deltaX the \e X component of the gravity disturbance + * (m s−2). + * @param[out] deltaY the \e Y component of the gravity disturbance + * (m s−2). + * @param[out] deltaZ the \e Z component of the gravity disturbance + * (m s−2). + * @return \e T = \e W - \e U the disturbing potential (also called the + * anomalous potential) (m2 s−2). + **********************************************************************/ + double T(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% deltaX, + [System::Runtime::InteropServices::Out] double% deltaY, + [System::Runtime::InteropServices::Out] double% deltaZ); + + /** + * Evaluate disturbing potential in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @return \e T = \e W - \e U the disturbing potential (also called the + * anomalous potential) (m2 s−2). + **********************************************************************/ + double T(double X, double Y, double Z); + + /** + * Evaluate the components of the acceleration due to normal gravity and + * the centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] gammaX the \e X component of the normal acceleration + * (m s−2). + * @param[out] gammaY the \e Y component of the normal acceleration + * (m s−2). + * @param[out] gammaZ the \e Z component of the normal acceleration + * (m s−2). + * @return \e U = V0 + Φ the sum of the + * normal gravitational and centrifugal potentials + * (m2 s−2). + * + * This calls NormalGravity::U for ReferenceEllipsoid(). + **********************************************************************/ + double U(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% gammaX, + [System::Runtime::InteropServices::Out] double% gammaY, + [System::Runtime::InteropServices::Out] double% gammaZ); + + /** + * Evaluate the centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[out] fX the \e X component of the centrifugal acceleration + * (m s−2). + * @param[out] fY the \e Y component of the centrifugal acceleration + * (m s−2). + * @return Φ the centrifugal potential (m2 + * s−2). + * + * This calls NormalGravity::Phi for ReferenceEllipsoid(). + **********************************************************************/ + double Phi(double X, double Y, + [System::Runtime::InteropServices::Out] double% fX, + [System::Runtime::InteropServices::Out] double% fY); + ///@} + + /** \name Compute gravity on a circle of constant latitude + **********************************************************************/ + ///@{ + /** + * Create a GravityCircle object to allow the gravity field at many points + * with constant \e lat and \e h and varying \e lon to be computed + * efficiently. + * + * @param[in] lat latitude of the point (degrees). + * @param[in] h the height of the point above the ellipsoid (meters). + * @param[in] caps bitor'ed combination of GravityModel::mask values + * specifying the capabilities of the resulting GravityCircle object. + * @exception std::bad_alloc if the memory necessary for creating a + * GravityCircle can't be allocated. + * @return a GravityCircle object whose member functions computes the + * gravitational field at a particular values of \e lon. + * + * The GravityModel::mask values are + * - \e caps |= GravityModel::GRAVITY + * - \e caps |= GravityModel::DISTURBANCE + * - \e caps |= GravityModel::DISTURBING_POTENTIAL + * - \e caps |= GravityModel::SPHERICAL_ANOMALY + * - \e caps |= GravityModel::GEOID_HEIGHT + * . + * The default value of \e caps is GravityModel::ALL which turns on all the + * capabilities. If an unsupported function is invoked, it will return + * NaNs. Note that GravityModel::GEOID_HEIGHT will only be honored if \e h + * = 0. + * + * If the field at several points on a circle of latitude need to be + * calculated then creating a GravityCircle object and using its member + * functions will be substantially faster, especially for high-degree + * models. See \ref gravityparallel for an example of using GravityCircle + * (together with OpenMP) to speed up the computation of geoid heights. + **********************************************************************/ + GravityCircle^ Circle(double lat, double h, Mask caps ); + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + + /** + * @return the NormalGravity object for the reference ellipsoid. + **********************************************************************/ + NormalGravity^ ReferenceEllipsoid(); + + /** + * @return the description of the gravity model, if available, in the data + * file; if absent, return "NONE". + **********************************************************************/ + property System::String^ Description { System::String^ get(); } + + /** + * @return date of the model; if absent, return "UNKNOWN". + **********************************************************************/ + property System::String^ DateTime { System::String^ get(); } + + /** + * @return full file name used to load the gravity model. + **********************************************************************/ + property System::String^ GravityFile { System::String^ get(); } + + /** + * @return "name" used to load the gravity model (from the first argument + * of the constructor, but this may be overridden by the model file). + **********************************************************************/ + property System::String^ GravityModelName { System::String^ get(); } + + /** + * @return directory used to load the gravity model. + **********************************************************************/ + property System::String^ GravityModelDirectory + { System::String^ get(); } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e GM the mass constant of the model (m3 + * s−2); this is the product of \e G the gravitational + * constant and \e M the mass of the earth (usually including the mass of + * the earth's atmosphere). + **********************************************************************/ + property double MassConstant { double get(); } + + /** + * @return \e GM the mass constant of the ReferenceEllipsoid() + * (m3 s−2). + **********************************************************************/ + property double ReferenceMassConstant { double get(); } + + /** + * @return ω the angular velocity of the model and the + * ReferenceEllipsoid() (rad s−1). + **********************************************************************/ + property double AngularVelocity { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. + **********************************************************************/ + property double Flattening { double get(); } + ///@} + + /** + * @return the default path for gravity model data files. + * + * This is the value of the environment variable GRAVITY_PATH, if set; + * otherwise, it is $GEOGRAPHICLIB_DATA/gravity if the environment variable + * GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default + * (/usr/local/share/GeographicLib/gravity on non-Windows systems and + * C:/Documents and Settings/All Users/Application + * Data/GeographicLib/gravity on Windows systems). + **********************************************************************/ + static System::String^ DefaultGravityPath(); + + /** + * @return the default name for the gravity model. + * + * This is the value of the environment variable GRAVITY_NAME, if set, + * otherwise, it is "egm96". The GravityModel class does not use + * this function; it is just provided as a convenience for a calling + * program when constructing a GravityModel object. + **********************************************************************/ + static System::String^ DefaultGravityName(); + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LambertConformalConic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LambertConformalConic.cpp new file mode 100644 index 000000000..42fd4cb8a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LambertConformalConic.cpp @@ -0,0 +1,183 @@ +/** + * \file NETGeographicLib/LambertConformalConic.cpp + * \brief Implementation for NETGeographicLib::LambertConformalConic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/LambertConformalConic.hpp" +#include "LambertConformalConic.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocte memory for a GeographicLib::LambertConformalConic"; + +//***************************************************************************** +LambertConformalConic::!LambertConformalConic(void) +{ + if ( m_pLambertConformalConic != NULL ) + { + delete m_pLambertConformalConic; + m_pLambertConformalConic = NULL; + } +} + +//***************************************************************************** +LambertConformalConic::LambertConformalConic(double a, double f, double stdlat, + double k0) +{ + try + { + m_pLambertConformalConic = + new GeographicLib::LambertConformalConic( a, f, stdlat, k0 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +LambertConformalConic::LambertConformalConic(double a, double f, + double stdlat1, double stdlat2, double k1) +{ + try + { + m_pLambertConformalConic = + new GeographicLib::LambertConformalConic( a, f, stdlat1, stdlat2, k1 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +LambertConformalConic::LambertConformalConic(double a, double f, + double sinlat1, double coslat1, + double sinlat2, double coslat2, + double k1) +{ + try + { + m_pLambertConformalConic = + new GeographicLib::LambertConformalConic( a, f, sinlat1, coslat1, + sinlat2, coslat2, k1 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +LambertConformalConic::LambertConformalConic() +{ + try + { + m_pLambertConformalConic = new GeographicLib::LambertConformalConic( + GeographicLib::LambertConformalConic::Mercator ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void LambertConformalConic::SetScale(double lat, double k) +{ + try + { + m_pLambertConformalConic->SetScale( lat, k ); + } + catch ( std::exception err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void LambertConformalConic::Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double lx, ly, lgamma, lk; + m_pLambertConformalConic->Forward( lon0, lat, lon, lx, ly, lgamma, lk ); + x = lx; + y = ly; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void LambertConformalConic::Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double llat, llon, lgamma, lk; + m_pLambertConformalConic->Reverse( lon0, x, y, llat, llon, lgamma, lk ); + lat = llat; + lon = llon; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void LambertConformalConic::Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y) +{ + double lx, ly; + m_pLambertConformalConic->Forward( lon0, lat, lon, lx, ly ); + x = lx; + y = ly; +} + +//***************************************************************************** +void LambertConformalConic::Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon; + m_pLambertConformalConic->Reverse( lon0, x, y, llat, llon ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double LambertConformalConic::MajorRadius::get() +{ return m_pLambertConformalConic->MajorRadius(); } + +//***************************************************************************** +double LambertConformalConic::Flattening::get() +{ return m_pLambertConformalConic->Flattening(); } + +//***************************************************************************** +double LambertConformalConic::OriginLatitude::get() +{ return m_pLambertConformalConic->OriginLatitude(); } + +//***************************************************************************** +double LambertConformalConic::CentralScale::get() +{ return m_pLambertConformalConic->CentralScale(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LambertConformalConic.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LambertConformalConic.h new file mode 100644 index 000000000..63fa877f6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LambertConformalConic.h @@ -0,0 +1,263 @@ +#pragma once +/** + * \file NETGeographicLib/LambertConformalConic.h + * \brief Header for NETGeographicLib::LambertConformalConic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::LambertConformalConic. + * + * This class allows .NET applications to access GeographicLib::LambertConformalConic. + * + * Implementation taken from the report, + * - J. P. Snyder, + * Map Projections: A + * Working Manual, USGS Professional Paper 1395 (1987), + * pp. 107--109. + * + * This is a implementation of the equations in Snyder except that divided + * differences have been used to transform the expressions into ones which + * may be evaluated accurately and that Newton's method is used to invert the + * projection. In this implementation, the projection correctly becomes the + * Mercator projection or the polar stereographic projection when the + * standard latitude is the equator or a pole. The accuracy of the + * projections is about 10 nm (10 nanometers). + * + * The ellipsoid parameters, the standard parallels, and the scale on the + * standard parallels are set in the constructor. Internally, the case with + * two standard parallels is converted into a single standard parallel, the + * latitude of tangency (also the latitude of minimum scale), with a scale + * specified on this parallel. This latitude is also used as the latitude of + * origin which is returned by LambertConformalConic::OriginLatitude. The + * scale on the latitude of origin is given by + * LambertConformalConic::CentralScale. The case with two distinct standard + * parallels where one is a pole is singular and is disallowed. The central + * meridian (which is a trivial shift of the longitude) is specified as the + * \e lon0 argument of the LambertConformalConic::Forward and + * LambertConformalConic::Reverse functions. There is no provision in this + * class for specifying a false easting or false northing or a different + * latitude of origin. However these are can be simply included by the + * calling function. For example the Pennsylvania South state coordinate + * system ( + * EPSG:3364) is obtained by: + * C# Example: + * \include example-LambertConformalConic.cs + * Managed C++ Example: + * \include example-LambertConformalConic.cpp + * Visual Basic Example: + * \include example-LambertConformalConic.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor has been provided that assumes a Mercator + * projection. + * + * The MajorRadius, Flattening, OriginLatitude, and CentralScale + * functions are implemented as properties. + **********************************************************************/ + public ref class LambertConformalConic + { + private: + // Pointer to the unmanaged GeographicLib::LambertConformalConic. + GeographicLib::LambertConformalConic* m_pLambertConformalConic; + + // the finalizer frres the unmanaged memory when the object is destroyed. + !LambertConformalConic(void); + public: + + /** + * Constructor with a single standard parallel. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] stdlat standard parallel (degrees), the circle of tangency. + * @param[in] k0 scale on the standard parallel. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k0 is + * not positive. + * @exception GeographicErr if \e stdlat is not in [−90°, + * 90°]. + **********************************************************************/ + LambertConformalConic(double a, double f, double stdlat, double k0); + + /** + * Constructor with two standard parallels. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] stdlat1 first standard parallel (degrees). + * @param[in] stdlat2 second standard parallel (degrees). + * @param[in] k1 scale on the standard parallels. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k1 is + * not positive. + * @exception GeographicErr if \e stdlat1 or \e stdlat2 is not in + * [−90°, 90°], or if either \e stdlat1 or \e + * stdlat2 is a pole and \e stdlat1 is not equal \e stdlat2. + **********************************************************************/ + LambertConformalConic(double a, double f, double stdlat1, double stdlat2, double k1); + + /** + * Constructor with two standard parallels specified by sines and cosines. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] sinlat1 sine of first standard parallel. + * @param[in] coslat1 cosine of first standard parallel. + * @param[in] sinlat2 sine of second standard parallel. + * @param[in] coslat2 cosine of second standard parallel. + * @param[in] k1 scale on the standard parallels. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k1 is + * not positive. + * @exception GeographicErr if \e stdlat1 or \e stdlat2 is not in + * [−90°, 90°], or if either \e stdlat1 or \e + * stdlat2 is a pole and \e stdlat1 is not equal \e stdlat2. + * + * This allows parallels close to the poles to be specified accurately. + * This routine computes the latitude of origin and the scale at this + * latitude. In the case where \e lat1 and \e lat2 are different, the + * errors in this routines are as follows: if \e dlat = abs(\e lat2 − + * \e lat1) ≤ 160° and max(abs(\e lat1), abs(\e lat2)) ≤ 90 + * − min(0.0002, 2.2 × 10−6(180 − \e + * dlat), 6 × 10−8 dlat2) (in + * degrees), then the error in the latitude of origin is less than 4.5 + * × 10−14d and the relative error in the scale is + * less than 7 × 10−15. + **********************************************************************/ + LambertConformalConic(double a, double f, + double sinlat1, double coslat1, + double sinlat2, double coslat2, + double k1); + + /** + * The default constructor assumes a Mercator projection. + **********************************************************************/ + LambertConformalConic(); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~LambertConformalConic() + { this->!LambertConformalConic(); } + + /** + * Set the scale for the projection. + * + * @param[in] lat (degrees). + * @param[in] k scale at latitude \e lat (default 1). + * @exception GeographicErr \e k is not positive. + * @exception GeographicErr if \e lat is not in [−90°, + * 90°]. + **********************************************************************/ + void SetScale(double lat, double k); + + /** + * Forward projection, from geographic to Lambert conformal conic. + * + * @param[in] lon0 central meridian longitude (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * The latitude origin is given by LambertConformalConic::LatitudeOrigin(). + * No false easting or northing is added and \e lat should be in the range + * [−90°, 90°]; \e lon and \e lon0 should be in the + * range [−540°, 540°). The error in the projection + * is less than about 10 nm (10 nanometers), true distance, and the errors + * in the meridian convergence and scale are consistent with this. The + * values of \e x and \e y returned for points which project to infinity + * (i.e., one or both of the poles) will be large but finite. + **********************************************************************/ + void Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * Reverse projection, from Lambert conformal conic to geographic. + * + * @param[in] lon0 central meridian longitude (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * The latitude origin is given by LambertConformalConic::LatitudeOrigin(). + * No false easting or northing is added. \e lon0 should be in the range + * [−540°, 540°). The value of \e lon returned is in + * the range [−180°, 180°). The error in the + * projection is less than about 10 nm (10 nanometers), true distance, and + * the errors in the meridian convergence and scale are consistent with + * this. + **********************************************************************/ + void Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * LambertConformalConic::Forward without returning the convergence and + * scale. + **********************************************************************/ + void Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * LambertConformalConic::Reverse without returning the convergence and + * scale. + **********************************************************************/ + void Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return latitude of the origin for the projection (degrees). + * + * This is the latitude of minimum scale and equals the \e stdlat in the + * 1-parallel constructor and lies between \e stdlat1 and \e stdlat2 in the + * 2-parallel constructors. + **********************************************************************/ + property double OriginLatitude { double get(); } + + /** + * @return central scale for the projection. This is the scale on the + * latitude of origin. + **********************************************************************/ + property double CentralScale { double get(); } + ///@} + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LocalCartesian.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LocalCartesian.cpp new file mode 100644 index 000000000..0bcb37b72 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LocalCartesian.cpp @@ -0,0 +1,180 @@ +/** + * \file NETGeographicLib/LocalCartesian.cpp + * \brief Implementation for NETGeographicLib::LocalCartesian class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/LocalCartesian.hpp" +#include "LocalCartesian.h" +#include "Geocentric.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::LocalCartesian"; + +//***************************************************************************** +LocalCartesian::!LocalCartesian(void) +{ + if ( m_pLocalCartesian != NULL ) + { + delete m_pLocalCartesian; + m_pLocalCartesian = NULL; + } +} + +//***************************************************************************** +LocalCartesian::LocalCartesian(double lat0, double lon0, double h0, + Geocentric^ earth ) +{ + try + { + const GeographicLib::Geocentric* pGeocentric = + reinterpret_cast( + earth->GetUnmanaged()->ToPointer() ); + m_pLocalCartesian = new GeographicLib::LocalCartesian( lat0, lon0, h0, *pGeocentric ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +LocalCartesian::LocalCartesian(double lat0, double lon0, double h0 ) +{ + try + { + m_pLocalCartesian = new GeographicLib::LocalCartesian( lat0, lon0, h0, + GeographicLib::Geocentric::WGS84 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +LocalCartesian::LocalCartesian(Geocentric^ earth) +{ + try + { + const GeographicLib::Geocentric* pGeocentric = + reinterpret_cast( + earth->GetUnmanaged()->ToPointer() ); + m_pLocalCartesian = new GeographicLib::LocalCartesian( *pGeocentric ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +LocalCartesian::LocalCartesian() +{ + try + { + m_pLocalCartesian = new GeographicLib::LocalCartesian( + GeographicLib::Geocentric::WGS84 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void LocalCartesian::Reset(double lat0, double lon0, double h0 ) +{ + m_pLocalCartesian->Reset( lat0, lon0, h0 ); +} + +//***************************************************************************** +void LocalCartesian::Forward(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% z) +{ + double lx, ly, lz; + m_pLocalCartesian->Forward( lat, lon, h, lx, ly, lz ); + x = lx; + y = ly; + z = lz; +} + +//***************************************************************************** +void LocalCartesian::Forward(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% z, + [System::Runtime::InteropServices::Out] array^% M) +{ + double lx, ly, lz; + std::vector lM(9); + m_pLocalCartesian->Forward( lat, lon, h, lx, ly, lz, lM ); + x = lx; + y = ly; + z = lz; + M = gcnew array(3,3); + for ( int i = 0; i < 3; i++ ) + for ( int j = 0; j < 3; j++ ) + M[i,j] = lM[3*i+j]; +} + +//***************************************************************************** +void LocalCartesian::Reverse(double x, double y, double z, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% h) +{ + double llat, llon, lh; + m_pLocalCartesian->Reverse( x, y, z, llat, llon, lh ); + lat = llat; + lon = llon; + h = lh; +} + +//***************************************************************************** +void LocalCartesian::Reverse(double x, double y, double z, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% h, + [System::Runtime::InteropServices::Out] array^% M) +{ + double llat, llon, lh; + std::vector lM(9); + m_pLocalCartesian->Reverse( x, y, z, llat, llon, lh, lM ); + lat = llat; + lon = llon; + h = lh; + M = gcnew array(3,3); + for ( int i = 0; i < 3; i++ ) + for ( int j = 0; j < 3; j++ ) + M[i,j] = lM[3*i+j]; +} + +//***************************************************************************** +double LocalCartesian::LatitudeOrigin::get() +{ return m_pLocalCartesian->LatitudeOrigin(); } + +//***************************************************************************** +double LocalCartesian::LongitudeOrigin::get() +{ return m_pLocalCartesian->LongitudeOrigin(); } + +//***************************************************************************** +double LocalCartesian::HeightOrigin::get() +{ return m_pLocalCartesian->HeightOrigin(); } + +//***************************************************************************** +double LocalCartesian::MajorRadius::get() +{ return m_pLocalCartesian->MajorRadius(); } + +//***************************************************************************** +double LocalCartesian::Flattening::get() +{ return m_pLocalCartesian->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LocalCartesian.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LocalCartesian.h new file mode 100644 index 000000000..6f7c31386 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/LocalCartesian.h @@ -0,0 +1,250 @@ +#pragma once +/** + * \file NETGeographicLib/LocalCartesian.h + * \brief Header for NETGeographicLib::LocalCartesian class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class Geocentric; + /** + * \brief .NET wrapper for GeographicLib::LocalCartesian. + * + * This class allows .NET applications to access GeographicLib::LocalCartesian. + * + * Convert between geodetic coordinates latitude = \e lat, longitude = \e + * lon, height = \e h (measured vertically from the surface of the ellipsoid) + * to local cartesian coordinates (\e x, \e y, \e z). The origin of local + * cartesian coordinate system is at \e lat = \e lat0, \e lon = \e lon0, \e h + * = \e h0. The \e z axis is normal to the ellipsoid; the \e y axis points + * due north. The plane \e z = - \e h0 is tangent to the ellipsoid. + * + * The conversions all take place via geocentric coordinates using a + * Geocentric object. + * + * C# Example: + * \include example-LocalCartesian.cs + * Managed C++ Example: + * \include example-LocalCartesian.cpp + * Visual Basic Example: + * \include example-LocalCartesian.vb + * + * INTERFACE DIFFERENCES:
+ * Constructors have been provided that assume WGS84 parameters. + * + * The following functions are implemented as properties: + * LatitudeOrigin, LongitudeOrigin, HeightOrigin, MajorRadius, + * and Flattening. + * + * The rotation matrices returned by the Forward and Reverse functions + * are 2D, 3 × 3 arrays rather than vectors. + **********************************************************************/ + public ref class LocalCartesian + { + private: + // the pointer to the GeographicLib::LocalCartesian. + GeographicLib::LocalCartesian* m_pLocalCartesian; + + // the finalizer frees the unmanaged memory when the object is destroyed. + !LocalCartesian(void); + public: + + /** + * Constructor setting the origin. + * + * @param[in] lat0 latitude at origin (degrees). + * @param[in] lon0 longitude at origin (degrees). + * @param[in] h0 height above ellipsoid at origin (meters); default 0. + * @param[in] earth Geocentric object for the transformation; default + * Geocentric::WGS84. + * + * \e lat0 should be in the range [−90°, 90°]; \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + LocalCartesian(double lat0, double lon0, double h0, + Geocentric^ earth ); + + /** + * Constructor setting the origin and assuming a WGS84 ellipsoid. + * + * @param[in] lat0 latitude at origin (degrees). + * @param[in] lon0 longitude at origin (degrees). + * @param[in] h0 height above ellipsoid at origin (meters); default 0. + * + * \e lat0 should be in the range [−90°, 90°]; \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + LocalCartesian(double lat0, double lon0, double h0 ); + + /** + * Constructor that uses the provided ellipsoid. + * + * @param[in] earth Geocentric object for the transformation; default + * Geocentric::WGS84. + * + * Sets \e lat0 = 0, \e lon0 = 0, \e h0 = 0. + **********************************************************************/ + LocalCartesian(Geocentric^ earth); + + /** + * The default constructor assumes the WGS84 ellipsoid. + * + * Sets \e lat0 = 0, \e lon0 = 0, \e h0 = 0. + **********************************************************************/ + LocalCartesian(); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~LocalCartesian() + { this->!LocalCartesian(); } + + /** + * Reset the origin. + * + * @param[in] lat0 latitude at origin (degrees). + * @param[in] lon0 longitude at origin (degrees). + * @param[in] h0 height above ellipsoid at origin (meters); default 0. + * + * \e lat0 should be in the range [−90°, 90°]; \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + void Reset(double lat0, double lon0, double h0 ); + + /** + * Convert from geodetic to local cartesian coordinates. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] h height of point above the ellipsoid (meters). + * @param[out] x local cartesian coordinate (meters). + * @param[out] y local cartesian coordinate (meters). + * @param[out] z local cartesian coordinate (meters). + * + * \e lat should be in the range [−90°, 90°]; \e lon + * should be in the range [−540°, 540°). + **********************************************************************/ + void Forward(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% z); + + /** + * Convert from geodetic to local cartesian coordinates and return rotation + * matrix. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] h height of point above the ellipsoid (meters). + * @param[out] x local cartesian coordinate (meters). + * @param[out] y local cartesian coordinate (meters). + * @param[out] z local cartesian coordinate (meters). + * @param[out] M a 3 × 3 rotation matrix. + * + * \e lat should be in the range [−90°, 90°]; \e lon + * should be in the range [−540°, 540°). + * + * Let \e v be a unit vector located at (\e lat, \e lon, \e h). We can + * express \e v as \e column vectors in one of two ways + * - in east, north, up coordinates (where the components are relative to a + * local coordinate system at (\e lat, \e lon, \e h)); call this + * representation \e v1. + * - in \e x, \e y, \e z coordinates (where the components are relative to + * the local coordinate system at (\e lat0, \e lon0, \e h0)); call this + * representation \e v0. + * . + * Then we have \e v0 = \e M ⋅ \e v1. + **********************************************************************/ + void Forward(double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% z, + [System::Runtime::InteropServices::Out] array^% M); + + /** + * Convert from local cartesian to geodetic coordinates. + * + * @param[in] x local cartesian coordinate (meters). + * @param[in] y local cartesian coordinate (meters). + * @param[in] z local cartesian coordinate (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] h height of point above the ellipsoid (meters). + * + * The value of \e lon returned is in the range [−180°, + * 180°). + **********************************************************************/ + void Reverse(double x, double y, double z, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% h); + + /** + * Convert from local cartesian to geodetic coordinates and return rotation + * matrix. + * + * @param[in] x local cartesian coordinate (meters). + * @param[in] y local cartesian coordinate (meters). + * @param[in] z local cartesian coordinate (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] h height of point above the ellipsoid (meters). + * @param[out] M a 3 × 3 rotation matrix. + * + * Let \e v be a unit vector located at (\e lat, \e lon, \e h). We can + * express \e v as \e column vectors in one of two ways + * - in east, north, up coordinates (where the components are relative to a + * local coordinate system at (\e lat, \e lon, \e h)); call this + * representation \e v1. + * - in \e x, \e y, \e z coordinates (where the components are relative to + * the local coordinate system at (\e lat0, \e lon0, \e h0)); call this + * representation \e v0. + * . + * Then we have \e v1 = \e MT ⋅ \e v0, where \e + * MT is the transpose of \e M. + **********************************************************************/ + void Reverse(double x, double y, double z, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% h, + [System::Runtime::InteropServices::Out] array^% M); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return latitude of the origin (degrees). + **********************************************************************/ + property double LatitudeOrigin { double get(); } + + /** + * @return longitude of the origin (degrees). + **********************************************************************/ + property double LongitudeOrigin { double get(); } + + /** + * @return height of the origin (meters). + **********************************************************************/ + property double HeightOrigin { double get(); } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value of \e a inherited from the Geocentric object used in the + * constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geocentric object used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MGRS.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MGRS.cpp new file mode 100644 index 000000000..753a7f199 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MGRS.cpp @@ -0,0 +1,83 @@ +/** + * \file NETGeographicLib/MGRS.cpp + * \brief Implementation for NETGeographicLib::MGRS class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/MGRS.hpp" +#include "MGRS.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +void MGRS::Forward(int zone, bool northp, double x, double y, + int prec, + [System::Runtime::InteropServices::Out] System::String^% mgrs) +{ + try + { + std::string lmgrs; + GeographicLib::MGRS::Forward( zone, northp, x, y, prec, lmgrs ); + mgrs = gcnew System::String( lmgrs.c_str() ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void MGRS::Forward(int zone, bool northp, double x, double y, double lat, + int prec, System::String^% mgrs) +{ + try + { + std::string lmgrs; + GeographicLib::MGRS::Forward( zone, northp, x, y, lat, prec, lmgrs ); + mgrs = gcnew System::String( lmgrs.c_str() ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void MGRS::Reverse(System::String^ mgrs, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] int% prec, + bool centerp ) +{ + try + { + double lx, ly; + int lzone, lprec; + bool lnorthp; + GeographicLib::MGRS::Reverse( StringConvert::ManagedToUnmanaged( mgrs ), + lzone, lnorthp, lx, ly, lprec, centerp ); + x = lx; + y = ly; + zone = lzone; + prec = lprec; + northp = lnorthp; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +double MGRS::MajorRadius() { return GeographicLib::UTMUPS::MajorRadius(); } + +//***************************************************************************** +double MGRS::Flattening() { return GeographicLib::UTMUPS::Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MGRS.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MGRS.h new file mode 100644 index 000000000..e3c0a61c6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MGRS.h @@ -0,0 +1,235 @@ +#pragma once +/** + * \file NETGeographicLib/MGRS.h + * \brief Header for NETGeographicLib::MGRS class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::MGRS. + * + * This class allows .NET applications to access GeographicLib::MGRS. + * + * MGRS is defined in Chapter 3 of + * - J. W. Hager, L. L. Fry, S. S. Jacks, D. R. Hill, + * + + * Datums, Ellipsoids, Grids, and Grid Reference Systems, + * Defense Mapping Agency, Technical Manual TM8358.1 (1990). + * + * This implementation has the following properties: + * - The conversions are closed, i.e., output from Forward is legal input for + * Reverse and vice versa. Conversion in both directions preserve the + * UTM/UPS selection and the UTM zone. + * - Forward followed by Reverse and vice versa is approximately the + * identity. (This is affected in predictable ways by errors in + * determining the latitude band and by loss of precision in the MGRS + * coordinates.) + * - All MGRS coordinates truncate to legal 100 km blocks. All MGRS + * coordinates with a legal 100 km block prefix are legal (even though the + * latitude band letter may now belong to a neighboring band). + * - The range of UTM/UPS coordinates allowed for conversion to MGRS + * coordinates is the maximum consistent with staying within the letter + * ranges of the MGRS scheme. + * - All the transformations are implemented as static methods in the MGRS + * class. + * + * The NGA software package + * geotrans + * also provides conversions to and from MGRS. Version 3.0 (and earlier) + * suffers from some drawbacks: + * - Inconsistent rules are used to determine the whether a particular MGRS + * coordinate is legal. A more systematic approach is taken here. + * - The underlying projections are not very accurately implemented. + * + * C# Example: + * \include example-MGRS.cs + * Managed C++ Example: + * \include example-MGRS.cpp + * Visual Basic Example: + * \include example-MGRS.vb + * + **********************************************************************/ + public ref class MGRS + { + private: + // Hide the constructor since all members are static. + MGRS(void) {} + public: + + /** + * Convert UTM or UPS coordinate to an MGRS coordinate. + * + * @param[in] zone UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[in] prec precision relative to 100 km. + * @param[out] mgrs MGRS string. + * @exception GeographicErr if \e zone, \e x, or \e y is outside its + * allowed range. + * @exception GeographicErr if the memory for the MGRS string can't be + * allocated. + * + * \e prec specifies the precision of the MGRS string as follows: + * - prec = 0 (min), 100 km + * - prec = 1, 10 km + * - prec = 2, 1 km + * - prec = 3, 100 m + * - prec = 4, 10 m + * - prec = 5, 1 m + * - prec = 6, 0.1 m + * - prec = 11 (max), 1 μm + * + * UTM eastings are allowed to be in the range [100 km, 900 km], northings + * are allowed to be in in [0 km, 9500 km] for the northern hemisphere and + * in [1000 km, 10000 km] for the southern hemisphere. (However UTM + * northings can be continued across the equator. So the actual limits on + * the northings are [−9000 km, 9500 km] for the "northern" + * hemisphere and [1000 km, 19500 km] for the "southern" hemisphere.) + * + * UPS eastings/northings are allowed to be in the range [1300 km, 2700 km] + * in the northern hemisphere and in [800 km, 3200 km] in the southern + * hemisphere. + * + * The ranges are 100 km more restrictive that for the conversion between + * geographic coordinates and UTM and UPS given by UTMUPS. These + * restrictions are dictated by the allowed letters in MGRS coordinates. + * The choice of 9500 km for the maximum northing for northern hemisphere + * and of 1000 km as the minimum northing for southern hemisphere provide + * at least 0.5 degree extension into standard UPS zones. The upper ends + * of the ranges for the UPS coordinates is dictated by requiring symmetry + * about the meridians 0E and 90E. + * + * All allowed UTM and UPS coordinates may now be converted to legal MGRS + * coordinates with the proviso that eastings and northings on the upper + * boundaries are silently reduced by about 4 nm (4 nanometers) to place + * them \e within the allowed range. (This includes reducing a southern + * hemisphere northing of 10000 km by 4 nm so that it is placed in latitude + * band M.) The UTM or UPS coordinates are truncated to requested + * precision to determine the MGRS coordinate. Thus in UTM zone 38N, the + * square area with easting in [444 km, 445 km) and northing in [3688 km, + * 3689 km) maps to MGRS coordinate 38SMB4488 (at \e prec = 2, 1 km), + * Khulani Sq., Baghdad. + * + * The UTM/UPS selection and the UTM zone is preserved in the conversion to + * MGRS coordinate. Thus for \e zone > 0, the MGRS coordinate begins with + * the zone number followed by one of [C--M] for the southern + * hemisphere and [N--X] for the northern hemisphere. For \e zone = + * 0, the MGRS coordinates begins with one of [AB] for the southern + * hemisphere and [XY] for the northern hemisphere. + * + * The conversion to the MGRS is exact for prec in [0, 5] except that a + * neighboring latitude band letter may be given if the point is within 5nm + * of a band boundary. For prec in [6, 11], the conversion is accurate to + * roundoff. + * + * If \e x or \e y is NaN or if \e zone is UTMUPS::INVALID, the returned + * MGRS string is "INVALID". + * + * Return the result via a reference argument to avoid the overhead of + * allocating a potentially large number of small strings. If an error is + * thrown, then \e mgrs is unchanged. + **********************************************************************/ + static void Forward(int zone, bool northp, double x, double y, + int prec, + [System::Runtime::InteropServices::Out] System::String^% mgrs); + + /** + * Convert UTM or UPS coordinate to an MGRS coordinate when the latitude is + * known. + * + * @param[in] zone UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[in] lat latitude (degrees). + * @param[in] prec precision relative to 100 km. + * @param[out] mgrs MGRS string. + * @exception GeographicErr if \e zone, \e x, or \e y is outside its + * allowed range. + * @exception GeographicErr if \e lat is inconsistent with the given UTM + * coordinates. + * + * The latitude is ignored for \e zone = 0 (UPS); otherwise the latitude is + * used to determine the latitude band and this is checked for consistency + * using the same tests as Reverse. + **********************************************************************/ + static void Forward(int zone, bool northp, double x, double y, double lat, + int prec, + [System::Runtime::InteropServices::Out] System::String^% mgrs); + + /** + * Convert a MGRS coordinate to UTM or UPS coordinates. + * + * @param[in] mgrs MGRS string. + * @param[out] zone UTM zone (zero means UPS). + * @param[out] northp hemisphere (true means north, false means south). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] prec precision relative to 100 km. + * @param[in] centerp if true (default), return center of the MGRS square, + * else return SW (lower left) corner. + * @exception GeographicErr if \e mgrs is illegal. + * + * All conversions from MGRS to UTM/UPS are permitted provided the MGRS + * coordinate is a possible result of a conversion in the other direction. + * (The leading 0 may be dropped from an input MGRS coordinate for UTM + * zones 1--9.) In addition, MGRS coordinates with a neighboring + * latitude band letter are permitted provided that some portion of the + * 100 km block is within the given latitude band. Thus + * - 38VLS and 38WLS are allowed (latitude 64N intersects the square + * 38[VW]LS); but 38VMS is not permitted (all of 38VMS is north of 64N) + * - 38MPE and 38NPF are permitted (they straddle the equator); but 38NPE + * and 38MPF are not permitted (the equator does not intersect either + * block). + * - Similarly ZAB and YZB are permitted (they straddle the prime + * meridian); but YAB and ZZB are not (the prime meridian does not + * intersect either block). + * + * The UTM/UPS selection and the UTM zone is preserved in the conversion + * from MGRS coordinate. The conversion is exact for prec in [0, 5]. With + * centerp = true the conversion from MGRS to geographic and back is + * stable. This is not assured if \e centerp = false. + * + * If the first 3 characters of \e mgrs are "INV", then \e x and \e y are + * set to NaN and \e zone is set to UTMUPS::INVALID. + * + * If an exception is thrown, then the arguments are unchanged. + **********************************************************************/ + static void Reverse(System::String^ mgrs, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] int% prec, + bool centerp ); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the WGS84 ellipsoid (meters). + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + static double MajorRadius(); + + /** + * @return \e f the flattening of the WGS84 ellipsoid. + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + static double Flattening(); + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticCircle.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticCircle.cpp new file mode 100644 index 000000000..bef0ff095 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticCircle.cpp @@ -0,0 +1,114 @@ +/** + * \file NETGeographicLib/MagneticCircle.cpp + * \brief Implementation for NETGeographicLib::MagneticCircle class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/MagneticCircle.hpp" +#include "MagneticCircle.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +MagneticCircle::!MagneticCircle(void) +{ + if ( m_pMagneticCircle != NULL ) + { + delete m_pMagneticCircle; + m_pMagneticCircle = NULL; + } +} + +//***************************************************************************** +MagneticCircle::MagneticCircle( const GeographicLib::MagneticCircle& c ) +{ + try + { + m_pMagneticCircle = new GeographicLib::MagneticCircle( c ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::MagneticCircle" ); + } +} + +//***************************************************************************** +void MagneticCircle::Field(double lon, + [System::Runtime::InteropServices::Out] double% Bx, + [System::Runtime::InteropServices::Out] double% By, + [System::Runtime::InteropServices::Out] double% Bz) +{ + double lx, ly, lz; + m_pMagneticCircle->operator()( lon, lx, ly, lz ); + Bx = lx; + By = ly; + Bz = lz; +} + +//***************************************************************************** +void MagneticCircle::Field(double lon, + [System::Runtime::InteropServices::Out] double% Bx, + [System::Runtime::InteropServices::Out] double% By, + [System::Runtime::InteropServices::Out] double% Bz, + [System::Runtime::InteropServices::Out] double% Bxt, + [System::Runtime::InteropServices::Out] double% Byt, + [System::Runtime::InteropServices::Out] double% Bzt) +{ + double lx, ly, lz, lxt, lyt, lzt; + m_pMagneticCircle->operator()( lon, lx, ly, lz, lxt, lyt, lzt ); + Bx = lx; + By = ly; + Bz = lz; + Bxt = lxt; + Byt = lyt; + Bzt = lzt; +} + +//***************************************************************************** +double MagneticCircle::MajorRadius::get() +{ + if ( m_pMagneticCircle->Init() ) + return m_pMagneticCircle->MajorRadius(); + throw gcnew GeographicErr("MagneticCircle::MajorRadius failed because the MagneticCircle is not initialized."); +} + +//***************************************************************************** +double MagneticCircle::Flattening::get() +{ + if ( m_pMagneticCircle->Init() ) + return m_pMagneticCircle->Flattening(); + throw gcnew GeographicErr("MagneticCircle::Flattening failed because the MagneticCircle is not initialized."); +} + +//***************************************************************************** +double MagneticCircle::Latitude::get() +{ + if ( m_pMagneticCircle->Init() ) + return m_pMagneticCircle->Latitude(); + throw gcnew GeographicErr("MagneticCircle::Latitude failed because the MagneticCircle is not initialized."); +} + +//***************************************************************************** +double MagneticCircle::Height::get() +{ + if ( m_pMagneticCircle->Init() ) + return m_pMagneticCircle->Height(); + throw gcnew GeographicErr("MagneticCircle::Height failed because the MagneticCircle is not initialized."); +} + +//***************************************************************************** +double MagneticCircle::Time::get() +{ + if ( m_pMagneticCircle->Init() ) + return m_pMagneticCircle->Height(); + throw gcnew GeographicErr("MagneticCircle::Height failed because the MagneticCircle is not initialized."); +} + +//***************************************************************************** +bool MagneticCircle::Init::get() { return m_pMagneticCircle->Init(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticCircle.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticCircle.h new file mode 100644 index 000000000..a60298e26 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticCircle.h @@ -0,0 +1,147 @@ +#pragma once +/** + * \file NETGeographicLib/MagneticCircle.h + * \brief Header for NETGeographicLib::MagneticCircle class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::MagneticCircle. + * + * This class allows .NET applications to access GeographicLib::MagneticCircle. + * + * Evaluate the earth's magnetic field on a circle of constant height and + * latitude. This uses a CircularEngine to pre-evaluate the inner sum of the + * spherical harmonic sum, allowing the values of the field at several + * different longitudes to be evaluated rapidly. + * + * Use MagneticModel::Circle to create a MagneticCircle object. (The + * constructor for this class is for internal use only.) + * + * C# Example: + * \include example-MagneticCircle.cs + * Managed C++ Example: + * \include example-MagneticCircle.cpp + * Visual Basic Example: + * \include example-MagneticCircle.vb + * + * INTERFACE DIFFERENCES:
+ * The () operator has been replaced with Field. + * + * The following functions are implemented as properties: + * Init, MajorRadius, Flattening, Latitude, Height, and Time. + **********************************************************************/ + public ref class MagneticCircle + { + private: + // pointer to the unmanaged GeographicLib::MagneticCircle. + const GeographicLib::MagneticCircle* m_pMagneticCircle; + + // the finalizer frees the unmanaged memory when the object is destroyed. + !MagneticCircle(void); + public: + + /** + * %brief A constructor that is initialized from an unmanaged + * GeographicLib::MagneticCircle. This is for internal use only. + * + * Developers should use MagneticModel::Circle to create a + * MagneticCircle. + **********************************************************************/ + MagneticCircle( const GeographicLib::MagneticCircle& c ); + + /** + * %brief The destructor calls the finalizer. + **********************************************************************/ + ~MagneticCircle() + { this->!MagneticCircle(); } + + /** \name Compute the magnetic field + **********************************************************************/ + ///@{ + /** + * %brief Evaluate the components of the geomagnetic field at a + * particular longitude. + * + * @param[in] lon longitude of the point (degrees). + * @param[out] Bx the easterly component of the magnetic field (nanotesla). + * @param[out] By the northerly component of the magnetic field (nanotesla). + * @param[out] Bz the vertical (up) component of the magnetic field + * (nanotesla). + **********************************************************************/ + void Field(double lon, + [System::Runtime::InteropServices::Out] double% Bx, + [System::Runtime::InteropServices::Out] double% By, + [System::Runtime::InteropServices::Out] double% Bz); + + /** + * Evaluate the components of the geomagnetic field and their time + * derivatives at a particular longitude. + * + * @param[in] lon longitude of the point (degrees). + * @param[out] Bx the easterly component of the magnetic field (nanotesla). + * @param[out] By the northerly component of the magnetic field (nanotesla). + * @param[out] Bz the vertical (up) component of the magnetic field + * (nanotesla). + * @param[out] Bxt the rate of change of \e Bx (nT/yr). + * @param[out] Byt the rate of change of \e By (nT/yr). + * @param[out] Bzt the rate of change of \e Bz (nT/yr). + **********************************************************************/ + void Field(double lon, + [System::Runtime::InteropServices::Out] double% Bx, + [System::Runtime::InteropServices::Out] double% By, + [System::Runtime::InteropServices::Out] double% Bz, + [System::Runtime::InteropServices::Out] double% Bxt, + [System::Runtime::InteropServices::Out] double% Byt, + [System::Runtime::InteropServices::Out] double% Bzt); + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return true if the object has been initialized. + **********************************************************************/ + property bool Init { bool get(); } + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the MagneticModel object used in the + * constructor. This property throws a GeographicErr exception if + * the object is not initialized. + **********************************************************************/ + property double MajorRadius { double get(); } + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the MagneticModel object used in the constructor. + * This property throws a GeographicErr exception if the object is + * not initialized. + **********************************************************************/ + property double Flattening { double get(); } + /** + * @return the latitude of the circle (degrees). + * This property throws a GeographicErr exception if the object is + * not initialized. + **********************************************************************/ + property double Latitude { double get(); } + /** + * @return the height of the circle (meters). + * This property throws a GeographicErr exception if the object is + * not initialized. + **********************************************************************/ + property double Height { double get(); } + /** + * @return the time (fractional years). + * This property throws a GeographicErr exception if the object is + * not initialized. + **********************************************************************/ + property double Time { double get(); } + ///@} + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticModel.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticModel.cpp new file mode 100644 index 000000000..cfa1cb913 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticModel.cpp @@ -0,0 +1,234 @@ +/** + * \file NETGeographicLib/MagneticModel.cpp + * \brief Implementation for NETGeographicLib::MagneticModel class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/MagneticModel.hpp" +#include "MagneticModel.h" +#include "GeographicLib/MagneticCircle.hpp" +#include "MagneticCircle.h" +#include "Geocentric.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::MagneticModel"; + +//***************************************************************************** +MagneticModel::!MagneticModel(void) +{ + if ( m_pMagneticModel != NULL ) + { + delete m_pMagneticModel; + m_pMagneticModel = NULL; + } +} + +//***************************************************************************** +MagneticModel::MagneticModel(System::String^ name, + System::String^ path, + Geocentric^ earth) +{ + if ( name == nullptr ) throw gcnew GeographicErr("name cannot be a null pointer."); + if ( path == nullptr ) throw gcnew GeographicErr("path cannot be a null pointer."); + if ( earth == nullptr ) throw gcnew GeographicErr("earth cannot be a null pointer."); + + try + { + const GeographicLib::Geocentric* pGeocentric = + reinterpret_cast( + earth->GetUnmanaged()->ToPointer() ); + + m_pMagneticModel = new GeographicLib::MagneticModel( + StringConvert::ManagedToUnmanaged( name ), + StringConvert::ManagedToUnmanaged( path ), + *pGeocentric ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch (const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +MagneticModel::MagneticModel(System::String^ name, + System::String^ path) +{ + if ( name == nullptr ) throw gcnew GeographicErr("name cannot be a null pointer."); + if ( path == nullptr ) throw gcnew GeographicErr("path cannot be a null pointer."); + + try + { + m_pMagneticModel = new GeographicLib::MagneticModel( + StringConvert::ManagedToUnmanaged( name ), + StringConvert::ManagedToUnmanaged( path ), + GeographicLib::Geocentric::WGS84 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch (const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void MagneticModel::Field(double t, double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% Bx, + [System::Runtime::InteropServices::Out] double% By, + [System::Runtime::InteropServices::Out] double% Bz) +{ + double lx, ly, lz; + m_pMagneticModel->operator()( t, lat, lon, h, lx, ly, lz ); + Bx = lx; + By = ly; + Bz = lz; +} + +//***************************************************************************** +void MagneticModel::Field(double t, double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% Bx, + [System::Runtime::InteropServices::Out] double% By, + [System::Runtime::InteropServices::Out] double% Bz, + [System::Runtime::InteropServices::Out] double% Bxt, + [System::Runtime::InteropServices::Out] double% Byt, + [System::Runtime::InteropServices::Out] double% Bzt) +{ + double lx, ly, lz, lxt, lyt, lzt; + m_pMagneticModel->operator()( t, lat, lon, h, lx, ly, lz, lxt, lyt, lzt ); + Bx = lx; + By = ly; + Bz = lz; + Bxt = lxt; + Byt = lyt; + Bzt = lzt; +} + +//***************************************************************************** +MagneticCircle^ MagneticModel::Circle(double t, double lat, double h) +{ + try + { + return gcnew MagneticCircle( m_pMagneticModel->Circle( t, lat, h ) ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr("Failed to allocate memory for a MagneticCircle in MagneticModel::Circle"); + } +} + +//***************************************************************************** +void MagneticModel::FieldComponents(double Bx, double By, double Bz, + [System::Runtime::InteropServices::Out] double% H, + [System::Runtime::InteropServices::Out] double% F, + [System::Runtime::InteropServices::Out] double% D, + [System::Runtime::InteropServices::Out] double% I) +{ + double lh, lf, ld, li; + GeographicLib::MagneticModel::FieldComponents(Bx, By, Bz, lh, lf, ld, li); + H = lh; + F = lf; + D = ld; + I = li; +} + +//***************************************************************************** +void MagneticModel::FieldComponents(double Bx, double By, double Bz, + double Bxt, double Byt, double Bzt, + [System::Runtime::InteropServices::Out] double% H, + [System::Runtime::InteropServices::Out] double% F, + [System::Runtime::InteropServices::Out] double% D, + [System::Runtime::InteropServices::Out] double% I, + [System::Runtime::InteropServices::Out] double% Ht, + [System::Runtime::InteropServices::Out] double% Ft, + [System::Runtime::InteropServices::Out] double% Dt, + [System::Runtime::InteropServices::Out] double% It) +{ + double lh, lf, ld, li, lht, lft, ldt, lit; + GeographicLib::MagneticModel::FieldComponents(Bx, By, Bz, Bxt, Byt, Bzt, + lh, lf, ld, li, lht, lft, ldt, lit); + H = lh; + F = lf; + D = ld; + I = li; + Ht = lht; + Ft = lft; + Dt = ldt; + It = lit; +} + +//***************************************************************************** +System::String^ MagneticModel::Description::get() +{ + return StringConvert::UnmanagedToManaged( m_pMagneticModel->Description() ); +} + +//***************************************************************************** +System::String^ MagneticModel::DateTime::get() +{ + return StringConvert::UnmanagedToManaged( m_pMagneticModel->DateTime() ); +} + +//***************************************************************************** +System::String^ MagneticModel::MagneticFile::get() +{ + return StringConvert::UnmanagedToManaged( m_pMagneticModel->MagneticFile() ); +} + +//***************************************************************************** +System::String^ MagneticModel::MagneticModelName::get() +{ + return StringConvert::UnmanagedToManaged( m_pMagneticModel->MagneticModelName() ); +} + +//***************************************************************************** +System::String^ MagneticModel::MagneticModelDirectory::get() +{ + return StringConvert::UnmanagedToManaged( m_pMagneticModel->MagneticModelDirectory() ); +} + +//***************************************************************************** +System::String^ MagneticModel::DefaultMagneticPath() +{ + return StringConvert::UnmanagedToManaged( GeographicLib::MagneticModel::DefaultMagneticPath() ); +} + +//***************************************************************************** +System::String^ MagneticModel::DefaultMagneticName() +{ + return StringConvert::UnmanagedToManaged( GeographicLib::MagneticModel::DefaultMagneticName() ); +} + +//***************************************************************************** +double MagneticModel::MinHeight::get() +{ return m_pMagneticModel->MinHeight(); } + +//***************************************************************************** +double MagneticModel::MaxHeight::get() +{ return m_pMagneticModel->MaxHeight(); } + +//***************************************************************************** +double MagneticModel::MinTime::get() { return m_pMagneticModel->MinTime(); } + +//***************************************************************************** +double MagneticModel::MaxTime::get() { return m_pMagneticModel->MaxTime(); } + +//***************************************************************************** +double MagneticModel::MajorRadius::get() +{ return m_pMagneticModel->MajorRadius(); } + +//***************************************************************************** +double MagneticModel::Flattening::get() +{ return m_pMagneticModel->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticModel.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticModel.h new file mode 100644 index 000000000..ff2d74e47 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/MagneticModel.h @@ -0,0 +1,365 @@ +#pragma once +/** + * \file NETGeographicLib/MagneticModel.h + * \brief Header for NETGeographicLib::MagneticModel class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class MagneticCircle; + ref class Geocentric; + /** + * \brief .NET wrapper for GeographicLib::MagneticModel. + * + * This class allows .NET applications to access GeographicLib::MagneticModel. + * + * Evaluate the earth's magnetic field according to a model. At present only + * internal magnetic fields are handled. These are due to the earth's code + * and crust; these vary slowly (over many years). Excluded are the effects + * of currents in the ionosphere and magnetosphere which have daily and + * annual variations. + * + * See \ref magnetic for details of how to install the magnetic model and the + * data format. + * + * See + * - General information: + * - http://geomag.org/models/index.html + * - WMM2010: + * - http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml + * - http://ngdc.noaa.gov/geomag/WMM/data/WMM2010/WMM2010COF.zip + * - IGRF11: + * - http://ngdc.noaa.gov/IAGA/vmod/igrf.html + * - http://ngdc.noaa.gov/IAGA/vmod/igrf11coeffs.txt + * - http://ngdc.noaa.gov/IAGA/vmod/geomag70_linux.tar.gz + * - EMM2010: + * - http://ngdc.noaa.gov/geomag/EMM/index.html + * - http://ngdc.noaa.gov/geomag/EMM/data/geomag/EMM2010_Sph_Windows_Linux.zip + * + * C# Example: + * \include example-MagneticModel.cs + * Managed C++ Example: + * \include example-MagneticModel.cpp + * Visual Basic Example: + * \include example-MagneticModel.vb + * + * INTERFACE DIFFERENCES:
+ * The () operator has been replaced with Field. + * + * The following functions are implemented as properties: + * Description, DateTime, MagneticFile, MagneticModelName, + * MagneticModelDirectory, MinHeight, MaxHeight, MinTime, MaxTime, + * MajorRadius, and Flattening. + **********************************************************************/ + public ref class MagneticModel + { + private: + // The pointer to the unmanaged GeographicLib::MagneticModel. + const GeographicLib::MagneticModel* m_pMagneticModel; + + // The finalizer frees the unmanaged memory when the object is destroyed. + !MagneticModel(void); + public: + + /** \name Setting up the magnetic model + **********************************************************************/ + ///@{ + /** + * Construct a magnetic model. + * + * @param[in] name the name of the model. + * @param[in] path (optional) directory for data file. + * @param[in] earth (optional) Geocentric object for converting + * coordinates. + * @exception GeographicErr if the data file cannot be found, is + * unreadable, or is corrupt. + * @exception std::bad_alloc if the memory necessary for storing the model + * can't be allocated. + * + * A filename is formed by appending ".wmm" (World Magnetic Model) to the + * name. If \e path is specified (and is non-empty), then the file is + * loaded from directory, \e path. Otherwise the path is given by the + * DefaultMagneticPath(). + * + * This file contains the metadata which specifies the properties of the + * model. The coefficients for the spherical harmonic sums are obtained + * from a file obtained by appending ".cof" to metadata file (so the + * filename ends in ".wwm.cof"). + * + * The model is not tied to a particular ellipsoidal model of the earth. + * The final earth argument to the constructor specifies an ellipsoid to + * allow geodetic coordinates to the transformed into the spherical + * coordinates used in the spherical harmonic sum. + **********************************************************************/ + MagneticModel(System::String^ name, + System::String^ path, + Geocentric^ earth); + /** + * Construct a magnetic model that assumes the WGS84 ellipsoid. + * + * @param[in] name the name of the model. + * @param[in] path (optional) directory for data file. + * @exception GeographicErr if the data file cannot be found, is + * unreadable, or is corrupt. + * @exception GeographicErr if the memory necessary for storing the model + * can't be allocated. + * + * A filename is formed by appending ".wmm" (World Magnetic Model) to the + * name. If \e path is specified (and is non-empty), then the file is + * loaded from directory, \e path. Otherwise the path is given by the + * DefaultMagneticPath(). + * + * This file contains the metadata which specifies the properties of the + * model. The coefficients for the spherical harmonic sums are obtained + * from a file obtained by appending ".cof" to metadata file (so the + * filename ends in ".wwm.cof"). + * + * The model is not tied to a particular ellipsoidal model of the earth. + * The final earth argument to the constructor specifies an ellipsoid to + * allow geodetic coordinates to the transformed into the spherical + * coordinates used in the spherical harmonic sum. + **********************************************************************/ + MagneticModel(System::String^ name, + System::String^ path); + + ///@} + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~MagneticModel() + { this->!MagneticModel(); } + + /** \name Compute the magnetic field + **********************************************************************/ + ///@{ + /** + * Evaluate the components of the geomagnetic field. + * + * @param[in] t the time (years). + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @param[in] h the height of the point above the ellipsoid (meters). + * @param[out] Bx the easterly component of the magnetic field (nanotesla). + * @param[out] By the northerly component of the magnetic field (nanotesla). + * @param[out] Bz the vertical (up) component of the magnetic field + * (nanotesla). + **********************************************************************/ + void Field(double t, double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% Bx, + [System::Runtime::InteropServices::Out] double% By, + [System::Runtime::InteropServices::Out] double% Bz); + + /** + * Evaluate the components of the geomagnetic field and their time + * derivatives + * + * @param[in] t the time (years). + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @param[in] h the height of the point above the ellipsoid (meters). + * @param[out] Bx the easterly component of the magnetic field (nanotesla). + * @param[out] By the northerly component of the magnetic field (nanotesla). + * @param[out] Bz the vertical (up) component of the magnetic field + * (nanotesla). + * @param[out] Bxt the rate of change of \e Bx (nT/yr). + * @param[out] Byt the rate of change of \e By (nT/yr). + * @param[out] Bzt the rate of change of \e Bz (nT/yr). + **********************************************************************/ + void Field(double t, double lat, double lon, double h, + [System::Runtime::InteropServices::Out] double% Bx, + [System::Runtime::InteropServices::Out] double% By, + [System::Runtime::InteropServices::Out] double% Bz, + [System::Runtime::InteropServices::Out] double% Bxt, + [System::Runtime::InteropServices::Out] double% Byt, + [System::Runtime::InteropServices::Out] double% Bzt); + + /** + * Create a MagneticCircle object to allow the geomagnetic field at many + * points with constant \e lat, \e h, and \e t and varying \e lon to be + * computed efficiently. + * + * @param[in] t the time (years). + * @param[in] lat latitude of the point (degrees). + * @param[in] h the height of the point above the ellipsoid (meters). + * @exception std::bad_alloc if the memory necessary for creating a + * MagneticCircle can't be allocated. + * @return a MagneticCircle object whose MagneticCircle::Field(double + * lon) member function computes the field at particular values of \e + * lon. + * + * If the field at several points on a circle of latitude need to be + * calculated then creating a MagneticCircle and using its member functions + * will be substantially faster, especially for high-degree models. + **********************************************************************/ + MagneticCircle^ Circle(double t, double lat, double h); + + /** + * Compute various quantities dependent on the magnetic field. + * + * @param[in] Bx the \e x (easterly) component of the magnetic field (nT). + * @param[in] By the \e y (northerly) component of the magnetic field (nT). + * @param[in] Bz the \e z (vertical, up positive) component of the magnetic + * field (nT). + * @param[out] H the horizontal magnetic field (nT). + * @param[out] F the total magnetic field (nT). + * @param[out] D the declination of the field (degrees east of north). + * @param[out] I the inclination of the field (degrees down from + * horizontal). + **********************************************************************/ + static void FieldComponents(double Bx, double By, double Bz, + [System::Runtime::InteropServices::Out] double% H, + [System::Runtime::InteropServices::Out] double% F, + [System::Runtime::InteropServices::Out] double% D, + [System::Runtime::InteropServices::Out] double% I); + + /** + * Compute various quantities dependent on the magnetic field and its rate + * of change. + * + * @param[in] Bx the \e x (easterly) component of the magnetic field (nT). + * @param[in] By the \e y (northerly) component of the magnetic field (nT). + * @param[in] Bz the \e z (vertical, up positive) component of the magnetic + * field (nT). + * @param[in] Bxt the rate of change of \e Bx (nT/yr). + * @param[in] Byt the rate of change of \e By (nT/yr). + * @param[in] Bzt the rate of change of \e Bz (nT/yr). + * @param[out] H the horizontal magnetic field (nT). + * @param[out] F the total magnetic field (nT). + * @param[out] D the declination of the field (degrees east of north). + * @param[out] I the inclination of the field (degrees down from + * horizontal). + * @param[out] Ht the rate of change of \e H (nT/yr). + * @param[out] Ft the rate of change of \e F (nT/yr). + * @param[out] Dt the rate of change of \e D (degrees/yr). + * @param[out] It the rate of change of \e I (degrees/yr). + **********************************************************************/ + static void FieldComponents(double Bx, double By, double Bz, + double Bxt, double Byt, double Bzt, + [System::Runtime::InteropServices::Out] double% H, + [System::Runtime::InteropServices::Out] double% F, + [System::Runtime::InteropServices::Out] double% D, + [System::Runtime::InteropServices::Out] double% I, + [System::Runtime::InteropServices::Out] double% Ht, + [System::Runtime::InteropServices::Out] double% Ft, + [System::Runtime::InteropServices::Out] double% Dt, + [System::Runtime::InteropServices::Out] double% It); + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return the description of the magnetic model, if available, from the + * Description file in the data file; if absent, return "NONE". + **********************************************************************/ + property System::String^ Description { System::String^ get(); } + + /** + * @return date of the model, if available, from the ReleaseDate field in + * the data file; if absent, return "UNKNOWN". + **********************************************************************/ + property System::String^ DateTime { System::String^ get(); } + + /** + * @return full file name used to load the magnetic model. + **********************************************************************/ + property System::String^ MagneticFile { System::String^ get(); } + + /** + * @return "name" used to load the magnetic model (from the first argument + * of the constructor, but this may be overridden by the model file). + **********************************************************************/ + property System::String^ MagneticModelName { System::String^ get(); } + + /** + * @return directory used to load the magnetic model. + **********************************************************************/ + property System::String^ MagneticModelDirectory { System::String^ get(); } + + /** + * @return the minimum height above the ellipsoid (in meters) for which + * this MagneticModel should be used. + * + * Because the model will typically provide useful results + * slightly outside the range of allowed heights, no check of \e t + * argument is made by MagneticModel::Field() or + * MagneticModel::Circle. + **********************************************************************/ + property double MinHeight { double get(); } + + /** + * @return the maximum height above the ellipsoid (in meters) for which + * this MagneticModel should be used. + * + * Because the model will typically provide useful results + * slightly outside the range of allowed heights, no check of \e t + * argument is made by MagneticModel::Field() or + * MagneticModel::Circle. + **********************************************************************/ + property double MaxHeight { double get(); } + + /** + * @return the minimum time (in years) for which this MagneticModel should + * be used. + * + * Because the model will typically provide useful results + * slightly outside the range of allowed times, no check of \e t + * argument is made by MagneticModel::Field() or + * MagneticModel::Circle. + **********************************************************************/ + property double MinTime { double get(); } + + /** + * @return the maximum time (in years) for which this MagneticModel should + * be used. + * + * Because the model will typically provide useful results + * slightly outside the range of allowed times, no check of \e t + * argument is made by MagneticModel::Field() or + * MagneticModel::Circle. + **********************************************************************/ + property double MaxTime { double get(); } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value of \e a inherited from the Geocentric object used in the + * constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geocentric object used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + ///@} + + /** + * @return the default path for magnetic model data files. + * + * This is the value of the environment variable MAGNETIC_PATH, if set; + * otherwise, it is $GEOGRAPHICLIB_DATA/magnetic if the environment + * variable GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time + * default (/usr/local/share/GeographicLib/magnetic on non-Windows systems + * and C:/Documents and Settings/All Users/Application + * Data/GeographicLib/magnetic on Windows systems). + **********************************************************************/ + static System::String^ DefaultMagneticPath(); + + /** + * @return the default name for the magnetic model. + * + * This is the value of the environment variable MAGNETIC_NAME, if set, + * otherwise, it is "wmm2010". The MagneticModel class does not use this + * function; it is just provided as a convenience for a calling program + * when constructing a MagneticModel object. + **********************************************************************/ + static System::String^ DefaultMagneticName(); + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NETGeographicLib.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NETGeographicLib.cpp new file mode 100644 index 000000000..001109a38 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NETGeographicLib.cpp @@ -0,0 +1,49 @@ +/** + * \file NETGeographicLib/NETGeographicLib.cpp + * \brief Implementation for NETGeographicLib Utility functions. + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/Config.h" +#include "NETGeographicLib.h" + +using namespace System::Runtime::InteropServices; +using namespace NETGeographicLib; + +//***************************************************************************** +std::string StringConvert::ManagedToUnmanaged( System::String^ s ) +{ + System::IntPtr buffer = Marshal::StringToHGlobalAnsi(s); + std::string output( reinterpret_cast(buffer.ToPointer()) ); + Marshal::FreeHGlobal(buffer); + return output; +} + +//***************************************************************************** +System::String^ VersionInfo::GetString() +{ + return gcnew System::String(GEOGRAPHICLIB_VERSION_STRING); +} + +//***************************************************************************** +int VersionInfo::MajorVersion() +{ + return GEOGRAPHICLIB_VERSION_MAJOR; +} + +//***************************************************************************** +int VersionInfo::MinorVersion() +{ + return GEOGRAPHICLIB_VERSION_MINOR; +} + +//***************************************************************************** +int VersionInfo::Patch() +{ + return GEOGRAPHICLIB_VERSION_PATCH; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NETGeographicLib.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NETGeographicLib.h new file mode 100644 index 000000000..720af11e6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NETGeographicLib.h @@ -0,0 +1,256 @@ +#pragma once +/** + * \file NETGeographicLib/NETGeographicLib.h + * \brief Header for NETGeographicLib::NETGeographicLib objects + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include + +using namespace System; + +namespace NETGeographicLib +{ + enum class captype { + CAP_NONE = 0U, + CAP_C1 = 1U<<0, + CAP_C1p = 1U<<1, + CAP_C2 = 1U<<2, + CAP_C3 = 1U<<3, + CAP_C4 = 1U<<4, + CAP_ALL = 0x1FU, + OUT_ALL = 0x7F80U, + }; + + /** + * Bit masks for what calculations to do. These masks do double duty. + * They signify to the GeodesicLine::GeodesicLine constructor and to + * Geodesic::Line what capabilities should be included in the GeodesicLine + * object. They also specify which results to return in the general + * routines Geodesic::GenDirect and Geodesic::GenInverse routines. + **********************************************************************/ + public enum class Mask { + /** + * No capabilities, no output. + * @hideinitializer + **********************************************************************/ + NONE = 0U, + /** + * Calculate latitude \e lat2. (It's not necessary to include this as a + * capability to GeodesicLine because this is included by default.) + * @hideinitializer + **********************************************************************/ + LATITUDE = 1U<<7 | unsigned(captype::CAP_NONE), + /** + * Calculate longitude \e lon2. + * @hideinitializer + **********************************************************************/ + LONGITUDE = 1U<<8 | unsigned(captype::CAP_C3), + /** + * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to + * include this as a capability to GeodesicLine because this is included + * by default.) + * @hideinitializer + **********************************************************************/ + AZIMUTH = 1U<<9 | unsigned(captype::CAP_NONE), + /** + * Calculate distance \e s12. + * @hideinitializer + **********************************************************************/ + DISTANCE = 1U<<10 | unsigned(captype::CAP_C1), + /** + * Allow distance \e s12 to be used as input in the direct geodesic + * problem. + * @hideinitializer + **********************************************************************/ + DISTANCE_IN = 1U<<11 | unsigned(captype::CAP_C1) | + unsigned(captype::CAP_C1p), + /** + * Calculate reduced length \e m12. + * @hideinitializer + **********************************************************************/ + REDUCEDLENGTH = 1U<<12 | unsigned(captype::CAP_C1) | + unsigned(captype::CAP_C2), + /** + * Calculate geodesic scales \e M12 and \e M21. + * @hideinitializer + **********************************************************************/ + GEODESICSCALE = 1U<<13 | unsigned(captype::CAP_C1) | + unsigned(captype::CAP_C2), + /** + * Calculate area \e S12. + * @hideinitializer + **********************************************************************/ + AREA = 1U<<14 | unsigned(captype::CAP_C4), + /** + * All capabilities, calculate everything. + * @hideinitializer + **********************************************************************/ + ALL = unsigned(captype::OUT_ALL) | unsigned(captype::CAP_ALL), + }; + + /** + * @brief The version information. + **********************************************************************/ + public ref class VersionInfo + { + private: + VersionInfo() {} + public: + /** + * @return The version string. + *******************************************************************/ + static System::String^ GetString(); + /** + * @return The major version. + *******************************************************************/ + static int MajorVersion(); + /** + * @return The minor version. + *******************************************************************/ + static int MinorVersion(); + /** + * @return The patch number. + *******************************************************************/ + static int Patch(); + }; + + /** + * @brief Exception class for NETGeographicLib + **********************************************************************/ + public ref class GeographicErr : public System::Exception + { + public: + /** + * @brief Creates an exception using an unmanaged string. + * @param[in] msg The error string. + ******************************************************************/ + GeographicErr( const char* msg ) : + System::Exception( gcnew System::String( msg ) ) {} + /** + * @brief Creates an exception using a managed string. + * @param[in] msg The error string. + ******************************************************************/ + GeographicErr( System::String^ msg ) : System::Exception( msg ) {} + }; + + ref class StringConvert + { + StringConvert() {} + public: + static std::string ManagedToUnmanaged( System::String^ s ); + static System::String^ UnmanagedToManaged( const std::string& s ) + { return gcnew System::String( s.c_str() ); } + }; + + /** + * @brief Physical constants + * + * References:
+ * http://www.orekit.org/static/apidocs/org/orekit/utils/Constants.html
+ * A COMPENDIUM OF EARTH CONSTANTS RELEVANT TO AUSTRALIAN GEODETIC SCIENCE
+ * http://espace.library.curtin.edu.au/R?func=dbin-jump-full&local_base=gen01-era02&object_id=146669 + **********************************************************************/ + public ref class Constants + { + private: + Constants() {} + public: + + /** + * @brief WGS72 Parameters + **********************************************************************/ + ref class WGS72 + { + private: + WGS72() {} + // The equatorial radius in meters. + static const double m_MajorRadius = 6378135.0; + // The flattening of the ellipsoid + static const double m_Flattening = 1.0 / 298.26; + // The gravitational constant in meters3/second2. + static const double m_GravitationalConstant = 3.986008e+14; + // The spin rate of the Earth in radians/second. + static const double m_EarthRate = 7.292115147e-5; + // dynamical form factor + static const double m_J2 = 1.0826158e-3; + public: + //! The equatorial radius in meters. + static property double MajorRadius { double get() { return m_MajorRadius; } } + //! The flattening of the ellipsoid + static property double Flattening { double get() { return m_Flattening; } } + //! The gravitational constant in meters3/second2. + static property double GravitationalConstant { double get() { return m_GravitationalConstant; } } + //! The spin rate of the Earth in radians/second. + static property double EarthRate { double get() { return m_EarthRate; } } + //! The dynamical form factor (J2). + static property double J2 { double get() { return m_J2; } } + }; + + /** + * @brief WGS84 Parameters + **********************************************************************/ + ref class WGS84 + { + private: + WGS84() {} + // The equatorial radius in meters. + static const double m_MajorRadius = 6378137.0; + // The flattening of the ellipsoid + static const double m_Flattening = 1.0 / 298.257223563; + // The gravitational constant in meters3/second2. + // I have also seen references that set this value to 3.986004418e+14. + // The following value is used to maintain consistency with GeographicLib. + static const double m_GravitationalConstant = 3.986005e+14; + // The spin rate of the Earth in radians/second. + static const double m_EarthRate = 7.292115e-5; + // dynamical form factor + static const double m_J2 = 1.08263e-3; + public: + //! The equatorial radius in meters. + static property double MajorRadius { double get() { return m_MajorRadius; } } + //! The flattening of the ellipsoid + static property double Flattening { double get() { return m_Flattening; } } + //! The gravitational constant in meters3/second2. + static property double GravitationalConstant { double get() { return m_GravitationalConstant; } } + //! The spin rate of the Earth in radians/second. + static property double EarthRate { double get() { return m_EarthRate; } } + //! The dynamical form factor (J2). + static property double J2 { double get() { return m_J2; } } + }; + + /** + * @brief GRS80 Parameters + **********************************************************************/ + ref class GRS80 + { + private: + GRS80() {} + // The equatorial radius in meters. + static const double m_MajorRadius = 6378137.0; + // The flattening of the ellipsoid + static const double m_Flattening = 1.0 / 298.257222100882711; + // The gravitational constant in meters3/second2. + static const double m_GravitationalConstant = 3.986005e+14; + // The spin rate of the Earth in radians/second. + static const double m_EarthRate = 7.292115e-5; + // dynamical form factor + static const double m_J2 = 1.08263e-3; + public: + //! The equatorial radius in meters. + static property double MajorRadius { double get() { return m_MajorRadius; } } + //! The flattening of the ellipsoid + static property double Flattening { double get() { return m_Flattening; } } + //! The gravitational constant in meters3/second2. + static property double GravitationalConstant { double get() { return m_GravitationalConstant; } } + //! The spin rate of the Earth in radians/second. + static property double EarthRate { double get() { return m_EarthRate; } } + //! The dynamical form factor (J2). + static property double J2 { double get() { return m_J2; } } + }; + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NormalGravity.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NormalGravity.cpp new file mode 100644 index 000000000..b693eea36 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NormalGravity.cpp @@ -0,0 +1,174 @@ +/** + * \file NETGeographicLib/NormalGravity.cpp + * \brief Implementation for NETGeographicLib::NormalGravity class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/NormalGravity.hpp" +#include "NormalGravity.h" +#include "Geocentric.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::NormalGravity"; + +//***************************************************************************** +NormalGravity::!NormalGravity(void) +{ + if ( m_pNormalGravity != NULL ) + { + delete m_pNormalGravity; + m_pNormalGravity = NULL; + } +} + +//***************************************************************************** +NormalGravity::NormalGravity(double a, double GM, double omega, double f, double J2) +{ + try + { + m_pNormalGravity = new GeographicLib::NormalGravity( a, GM, omega, f, J2 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +NormalGravity::NormalGravity(StandardModels model) +{ + try + { + m_pNormalGravity = model == StandardModels::WGS84 ? + new GeographicLib::NormalGravity( GeographicLib::NormalGravity::WGS84 ) : + new GeographicLib::NormalGravity( GeographicLib::NormalGravity::GRS80 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +NormalGravity::NormalGravity( const GeographicLib::NormalGravity& g) +{ + try + { + m_pNormalGravity = new GeographicLib::NormalGravity( g ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +double NormalGravity::SurfaceGravity(double lat) +{ + return m_pNormalGravity->SurfaceGravity( lat ); +} + +//***************************************************************************** +double NormalGravity::Gravity(double lat, double h, + [System::Runtime::InteropServices::Out] double% gammay, + [System::Runtime::InteropServices::Out] double% gammaz) +{ + double ly, lz; + double out = m_pNormalGravity->Gravity( lat, h, ly, lz ); + gammay = ly; + gammaz = lz; + return out; +} + +//***************************************************************************** +double NormalGravity::U(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% gammaX, + [System::Runtime::InteropServices::Out] double% gammaY, + [System::Runtime::InteropServices::Out] double% gammaZ) +{ + double lx, ly, lz; + double out = m_pNormalGravity->U( X, Y, Z, lx, ly, lz ); + gammaX = lx; + gammaY = ly; + gammaZ = lz; + return out; +} + +//***************************************************************************** +double NormalGravity::V0(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% GammaX, + [System::Runtime::InteropServices::Out] double% GammaY, + [System::Runtime::InteropServices::Out] double% GammaZ) +{ + double lx, ly, lz; + double out = m_pNormalGravity->V0( X, Y, Z, lx, ly, lz ); + GammaX = lx; + GammaY = ly; + GammaZ = lz; + return out; +} + +//***************************************************************************** +double NormalGravity::Phi(double X, double Y, + [System::Runtime::InteropServices::Out] double% fX, + [System::Runtime::InteropServices::Out] double% fY) +{ + double lx, ly; + double out = m_pNormalGravity->Phi( X, Y, lx, ly ); + fX = lx; + fY = ly; + return out; +} + +//***************************************************************************** +Geocentric^ NormalGravity::Earth() +{ + return gcnew Geocentric( m_pNormalGravity->Earth() ); +} + +//***************************************************************************** +double NormalGravity::MajorRadius::get() +{ return m_pNormalGravity->MajorRadius(); } + +//***************************************************************************** +double NormalGravity::MassConstant::get() +{ return m_pNormalGravity->MassConstant(); } + +//***************************************************************************** +double NormalGravity::DynamicalFormFactor(int n) +{ return m_pNormalGravity->DynamicalFormFactor(n); } + +//***************************************************************************** +double NormalGravity::AngularVelocity::get() +{ return m_pNormalGravity->AngularVelocity(); } + +//***************************************************************************** +double NormalGravity::Flattening::get() +{ return m_pNormalGravity->Flattening(); } + +//***************************************************************************** +double NormalGravity::EquatorialGravity::get() +{ return m_pNormalGravity->EquatorialGravity(); } + +//***************************************************************************** +double NormalGravity::PolarGravity::get() +{ return m_pNormalGravity->PolarGravity(); } + +//***************************************************************************** +double NormalGravity::GravityFlattening::get() +{ return m_pNormalGravity->GravityFlattening(); } + +//***************************************************************************** +double NormalGravity::SurfacePotential::get() +{ return m_pNormalGravity->SurfacePotential(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NormalGravity.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NormalGravity.h new file mode 100644 index 000000000..2deeecbec --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/NormalGravity.h @@ -0,0 +1,319 @@ +#pragma once +/** + * \file NETGeographicLib/NormalGravity.h + * \brief Header for NETGeographicLib::NormalGravity class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class Geocentric; + /** + * \brief .NET wrapper for GeographicLib::NormalGravity. + * + * This class allows .NET applications to access GeographicLib::NormalGravity. + * + * "Normal" gravity refers to an idealization of the earth which is modeled + * as an rotating ellipsoid. The eccentricity of the ellipsoid, the rotation + * speed, and the distribution of mass within the ellipsoid are such that the + * surface of the ellipsoid is a surface of constant potential (gravitational + * plus centrifugal). The acceleration due to gravity is therefore + * perpendicular to the surface of the ellipsoid. + * + * There is a closed solution to this problem which is implemented here. + * Series "approximations" are only used to evaluate certain combinations of + * elementary functions where use of the closed expression results in a loss + * of accuracy for small arguments due to cancellation of the two leading + * terms. However these series include sufficient terms to give full machine + * precision. + * + * Definitions: + * - V0, the gravitational contribution to the normal + * potential; + * - Φ, the rotational contribution to the normal potential; + * - \e U = V0 + Φ, the total + * potential; + * - Γ = ∇V0, the acceleration due to + * mass of the earth; + * - f = ∇Φ, the centrifugal acceleration; + * - γ = ∇\e U = Γ + f, the normal + * acceleration; + * - \e X, \e Y, \e Z, geocentric coordinates; + * - \e x, \e y, \e z, local cartesian coordinates used to denote the east, + * north and up directions. + * + * References: + * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San + * Francisco, 1967), Secs. 1-19, 2-7, 2-8 (2-9, 2-10), 6-2 (6-3). + * - H. Moritz, Geodetic Reference System 1980, J. Geodesy 54(3), 395-405 + * (1980) http://dx.doi.org/10.1007/BF02521480 + * + * C# Example: + * \include example-NormalGravity.cs + * Managed C++ Example: + * \include example-NormalGravity.cpp + * Visual Basic Example: + * \include example-NormalGravity.vb + * + * INTERFACE DIFFERENCES:
+ * A constructor has been provided for creating standard WGS84 and GRS80 + * gravity models. + * + * The following functions are implemented as properties: + * MajorRadius, MassConstant, AngularVelocity, Flattening, + * EquatorialGravity, PolarGravity, GravityFlattening, SurfacePotential. + **********************************************************************/ + public ref class NormalGravity + { + private: + // a pointer to the unmanaged GeographicLib::NormalGravity. + const GeographicLib::NormalGravity* m_pNormalGravity; + + // the finalizer frees the unmanaged memory when the object is destroyed. + !NormalGravity(void); + public: + //! The enumerated standard gravity models. + enum class StandardModels + { + WGS84, //!< WGS84 gravity model. + GRS80 //!< GRS80 gravity model. + }; + + /** \name Setting up the normal gravity + **********************************************************************/ + ///@{ + /** + * Constructor for the normal gravity. + * + * @param[in] a equatorial radius (meters). + * @param[in] GM mass constant of the ellipsoid + * (meters3/seconds2); this is the product of \e G + * the gravitational constant and \e M the mass of the earth (usually + * including the mass of the earth's atmosphere). + * @param[in] omega the angular velocity (rad s−1). + * @param[in] f the flattening of the ellipsoid. + * @param[in] J2 dynamical form factor. + * @exception if \e a is not positive or the other constants are + * inconsistent (see below). + * + * Exactly one of \e f and \e J2 should be positive and this will be used + * to define the ellipsoid. The shape of the ellipsoid can be given in one + * of two ways: + * - geometrically, the ellipsoid is defined by the flattening \e f = (\e a + * − \e b) / \e a, where \e a and \e b are the equatorial radius + * and the polar semi-axis. + * - physically, the ellipsoid is defined by the dynamical form factor + * J2 = (\e C − \e A) / Ma2, + * where \e A and \e C are the equatorial and polar moments of inertia + * and \e M is the mass of the earth. + **********************************************************************/ + NormalGravity(double a, double GM, double omega, double f, double J2); + + /** + * A constructor for creating standard gravity models.. + * @param[in] model Specifies the desired model. + **********************************************************************/ + NormalGravity(StandardModels model); + + /** + * A constructor that accepts a GeographicLib::NormalGravity. + * For internal use only. + * @param g An existing GeographicLib::NormalGravity. + **********************************************************************/ + NormalGravity( const GeographicLib::NormalGravity& g); + ///@} + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~NormalGravity() + { this->!NormalGravity(); } + + /** \name Compute the gravity + **********************************************************************/ + ///@{ + /** + * Evaluate the gravity on the surface of the ellipsoid. + * + * @param[in] lat the geographic latitude (degrees). + * @return γ the acceleration due to gravity, positive downwards + * (m s−2). + * + * Due to the axial symmetry of the ellipsoid, the result is independent of + * the value of the longitude. This acceleration is perpendicular to the + * surface of the ellipsoid. It includes the effects of the earth's + * rotation. + **********************************************************************/ + double SurfaceGravity(double lat); + + /** + * Evaluate the gravity at an arbitrary point above (or below) the + * ellipsoid. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] h the height above the ellipsoid (meters). + * @param[out] gammay the northerly component of the acceleration + * (m s−2). + * @param[out] gammaz the upward component of the acceleration + * (m s−2); this is usually negative. + * @return \e U the corresponding normal potential. + * + * Due to the axial symmetry of the ellipsoid, the result is independent of + * the value of the longitude and the easterly component of the + * acceleration vanishes, \e gammax = 0. The function includes the effects + * of the earth's rotation. When \e h = 0, this function gives \e gammay = + * 0 and the returned value matches that of NormalGravity::SurfaceGravity. + **********************************************************************/ + double Gravity(double lat, double h, + [System::Runtime::InteropServices::Out] double% gammay, + [System::Runtime::InteropServices::Out] double% gammaz); + + /** + * Evaluate the components of the acceleration due to gravity and the + * centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] gammaX the \e X component of the acceleration + * (m s−2). + * @param[out] gammaY the \e Y component of the acceleration + * (m s−2). + * @param[out] gammaZ the \e Z component of the acceleration + * (m s−2). + * @return \e U = V0 + Φ the sum of the + * gravitational and centrifugal potentials + * (m2 s−2). + * + * The acceleration given by γ = ∇\e U = + * ∇V0 + ∇Φ = Γ + f. + **********************************************************************/ + double U(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% gammaX, + [System::Runtime::InteropServices::Out] double% gammaY, + [System::Runtime::InteropServices::Out] double% gammaZ); + + /** + * Evaluate the components of the acceleration due to gravity alone in + * geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] GammaX the \e X component of the acceleration due to gravity + * (m s−2). + * @param[out] GammaY the \e Y component of the acceleration due to gravity + * (m s−2). + * @param[out] GammaZ the \e Z component of the acceleration due to gravity + * (m s−2). + * @return V0 the gravitational potential + * (m2 s−2). + * + * This function excludes the centrifugal acceleration and is appropriate + * to use for space applications. In terrestrial applications, the + * function NormalGravity::U (which includes this effect) should usually be + * used. + **********************************************************************/ + double V0(double X, double Y, double Z, + [System::Runtime::InteropServices::Out] double% GammaX, + [System::Runtime::InteropServices::Out] double% GammaY, + [System::Runtime::InteropServices::Out] double% GammaZ); + + /** + * Evaluate the centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[out] fX the \e X component of the centrifugal acceleration + * (m s−2). + * @param[out] fY the \e Y component of the centrifugal acceleration + * (m s−2). + * @return Φ the centrifugal potential (m2 + * s−2). + * + * Φ is independent of \e Z, thus \e fZ = 0. This function + * NormalGravity::U sums the results of NormalGravity::V0 and + * NormalGravity::Phi. + **********************************************************************/ + double Phi(double X, double Y, + [System::Runtime::InteropServices::Out] double% fX, + [System::Runtime::InteropServices::Out] double% fY); + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e GM the mass constant of the ellipsoid + * (m3 s−2). This is the value used in the + * constructor. + **********************************************************************/ + property double MassConstant { double get(); } + + /** + * @return \e Jn the dynamical form factors of the ellipsoid. + * + * If \e n = 2 (the default), this is the value of J2 + * used in the constructor. Otherwise it is the zonal coefficient of the + * Legendre harmonic sum of the normal gravitational potential. Note that + * \e Jn = 0 if \e n is odd. In most gravity applications, + * fully normalized Legendre functions are used and the corresponding + * coefficient is Cn0 = −\e Jn / + * sqrt(2 \e n + 1). + **********************************************************************/ + double DynamicalFormFactor(int n); + + /** + * @return ω the angular velocity of the ellipsoid (rad + * s−1). This is the value used in the constructor. + **********************************************************************/ + property double AngularVelocity { double get(); } + + /** + * @return f the flattening of the ellipsoid (\e a − \e b)/\e + * a. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return γe the normal gravity at equator (m + * s−2). + **********************************************************************/ + property double EquatorialGravity { double get(); } + + /** + * @return γp the normal gravity at poles (m + * s−2). + **********************************************************************/ + property double PolarGravity { double get(); } + + /** + * @return f* the gravity flattening (γp − + * γe) / γe. + **********************************************************************/ + property double GravityFlattening { double get(); } + + /** + * @return U0 the constant normal potential for the + * surface of the ellipsoid (m2 s−2). + **********************************************************************/ + property double SurfacePotential { double get(); } + + /** + * @return the Geocentric object used by this instance. + **********************************************************************/ + Geocentric^ Earth(); + ///@} + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/OSGB.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/OSGB.cpp new file mode 100644 index 000000000..766398b94 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/OSGB.cpp @@ -0,0 +1,134 @@ +/** + * \file NETGeographicLib/OSGB.cpp + * \brief Implementation for NETGeographicLib::OSGB class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/OSGB.hpp" +#include "OSGB.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +void OSGB::Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double lx, ly, lgamma, lk; + GeographicLib::OSGB::Forward( lat, lon, lx, ly, lgamma, lk ); + x = lx; + y = ly; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void OSGB::Reverse(double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double llat, llon, lgamma, lk; + GeographicLib::OSGB::Reverse( x, y, llat, llon, lgamma, lk ); + lat = llat; + lon = llon; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void OSGB::Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y) +{ + double lx, ly; + GeographicLib::OSGB::Forward( lat, lon, lx, ly ); + x = lx; + y = ly; +} + +//***************************************************************************** +void OSGB::Reverse(double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon; + GeographicLib::OSGB::Reverse( x, y, llat, llon ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +void OSGB::GridReference(double x, double y, int prec, + [System::Runtime::InteropServices::Out] System::String^% gridref) +{ + try + { + std::string lgridref; + GeographicLib::OSGB::GridReference( x, y, prec, lgridref ); + gridref = gcnew System::String( lgridref.c_str() ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Memory allocation error in OSGB::GridReference" ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void OSGB::GridReference(System::String^ gridref, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] int% prec, + bool centerp ) +{ + try + { + double lx, ly; + int lprec; + GeographicLib::OSGB::GridReference( + StringConvert::ManagedToUnmanaged( gridref ), + lx, ly, lprec, centerp ); + x = lx; + y = ly; + prec = lprec; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +double OSGB::MajorRadius() { return GeographicLib::OSGB::MajorRadius(); } + +//***************************************************************************** +double OSGB::Flattening() { return GeographicLib::OSGB::Flattening(); } + +//***************************************************************************** +double OSGB::CentralScale() { return GeographicLib::OSGB::CentralScale(); } + +//***************************************************************************** +double OSGB::OriginLatitude() { return GeographicLib::OSGB::OriginLatitude(); } + +//***************************************************************************** +double OSGB::OriginLongitude() +{ return GeographicLib::OSGB::OriginLongitude(); } + +//***************************************************************************** +double OSGB::FalseNorthing() { return GeographicLib::OSGB::FalseNorthing(); } + +//***************************************************************************** +double OSGB::FalseEasting() { return GeographicLib::OSGB::FalseEasting(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/OSGB.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/OSGB.h new file mode 100644 index 000000000..6dcc754cd --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/OSGB.h @@ -0,0 +1,200 @@ +/** + * \file NETGeographicLib/OSGB.h + * \brief Header for NETGeographicLib::OSGB class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#pragma once + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::OSGB. + * + * This class allows .NET applications to access GeographicLib::OSGB. + * + * The class implements the coordinate system used by the Ordnance Survey for + * maps of Great Britain and conversions to the grid reference system. + * + * See + * - + * A guide to coordinate systems in Great Britain + * - + * Guide to the National Grid + * + * \b WARNING: the latitudes and longitudes for the Ordnance Survey grid + * system do not use the WGS84 datum. Do not use the values returned by this + * class in the UTMUPS, MGRS, or Geoid classes without first converting the + * datum (and vice versa). + * + * C# Example: + * \include example-OSGB.cs + * Managed C++ Example: + * \include example-OSGB.cpp + * Visual Basic Example: + * \include example-OSGB.vb + **********************************************************************/ + public ref class OSGB + { + private: + // hide the constructor since all member are static + OSGB(void) {} + public: + + /** + * Forward projection, from geographic to OSGB coordinates. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * \e lat should be in the range [−90°, 90°]; \e lon + * should be in the range [−540°, 540°). + **********************************************************************/ + static void Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * Reverse projection, from OSGB coordinates to geographic. + * + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * The value of \e lon returned is in the range [−180°, + * 180°). + **********************************************************************/ + + static void Reverse(double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * OSGB::Forward without returning the convergence and scale. + **********************************************************************/ + static void Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * OSGB::Reverse without returning the convergence and scale. + **********************************************************************/ + static void Reverse(double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** + * Convert OSGB coordinates to a grid reference. + * + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[in] prec precision relative to 100 km. + * @param[out] gridref National Grid reference. + * @exception GeographicErr if \e prec, \e x, or \e y is outside its + * allowed range. + * @exception std::bad_alloc if the memory for \e gridref can't be + * allocatied. + * + * \e prec specifies the precision of the grid reference string as follows: + * - prec = 0 (min), 100km + * - prec = 1, 10km + * - prec = 2, 1km + * - prec = 3, 100m + * - prec = 4, 10m + * - prec = 5, 1m + * - prec = 6, 0.1m + * - prec = 11 (max), 1μm + * + * The easting must be in the range [−1000 km, 1500 km) and the + * northing must be in the range [−500 km, 2000 km). These bounds + * are consistent with rules for the letter designations for the grid + * system. + **********************************************************************/ + static void GridReference(double x, double y, int prec, + [System::Runtime::InteropServices::Out] System::String^% gridref); + + /** + * Convert OSGB coordinates to a grid reference. + * + * @param[in] gridref National Grid reference. + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] prec precision relative to 100 km. + * @param[in] centerp if true (default), return center of the grid square, + * else return SW (lower left) corner. + * @exception GeographicErr if \e gridref is illegal. + * + * The grid reference must be of the form: two letters (not including I) + * followed by an even number of digits (up to 22). + **********************************************************************/ + static void GridReference(System::String^ gridref, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] int% prec, + bool centerp ); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the Airy 1830 ellipsoid (meters). + * + * This is 20923713 ft converted to meters using the rule 1 ft = + * 109.48401603−10 m. (The Airy 1830 value is returned + * because the OSGB projection is based on this ellipsoid.) + **********************************************************************/ + static double MajorRadius(); + + /** + * @return \e f the inverse flattening of the Airy 1830 ellipsoid. + * + * For the Airy 1830 ellipsoid, \e a = 20923713 ft and \e b = 20853810 ft; + * thus the flattening = (20923713 − 20853810)/20923713 = + * 7767/2324857 = 1/299.32496459... (The Airy 1830 value is returned + * because the OSGB projection is based on this ellipsoid.) + **********************************************************************/ + static double Flattening(); + + /** + * @return \e k0 central scale for the OSGB projection (0.9996012717). + **********************************************************************/ + static double CentralScale(); + + /** + * @return latitude of the origin for the OSGB projection (49 degrees). + **********************************************************************/ + static double OriginLatitude(); + + /** + * @return longitude of the origin for the OSGB projection (−2 + * degrees). + **********************************************************************/ + static double OriginLongitude(); + + /** + * @return false northing the OSGB projection (−100000 meters). + **********************************************************************/ + static double FalseNorthing(); + + /** + * @return false easting the OSGB projection (400000 meters). + **********************************************************************/ + static double FalseEasting(); + ///@} + }; +} // diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolarStereographic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolarStereographic.cpp new file mode 100644 index 000000000..f81b6ec74 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolarStereographic.cpp @@ -0,0 +1,138 @@ +/** + * \file NETGeographicLib/PolarStereographic.cpp + * \brief Implementation for NETGeographicLib::PolarStereographic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/PolarStereographic.hpp" +#include "PolarStereographic.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::PolarStereographic"; + +//***************************************************************************** +PolarStereographic::!PolarStereographic(void) +{ + if ( m_pPolarStereographic != NULL ) + { + delete m_pPolarStereographic; + m_pPolarStereographic = NULL; + } +} + +//***************************************************************************** +PolarStereographic::PolarStereographic(double a, double f, double k0) +{ + try + { + m_pPolarStereographic = new GeographicLib::PolarStereographic( a, f, k0 ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +PolarStereographic::PolarStereographic() +{ + try + { + m_pPolarStereographic = new GeographicLib::PolarStereographic( + GeographicLib::PolarStereographic::UPS ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void PolarStereographic::SetScale(double lat, double k) +{ + try + { + m_pPolarStereographic->SetScale( lat, k ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void PolarStereographic::Forward(bool northp, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double lx, ly, lgamma, lk; + m_pPolarStereographic->Forward( northp, lat, lon, + lx, ly, lgamma, lk ); + x = lx; + y = ly; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void PolarStereographic::Reverse(bool northp, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double llat, llon, lgamma, lk; + m_pPolarStereographic->Reverse( northp, x, y, + llat, llon, lgamma, lk ); + lat = llat; + lon = llon; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void PolarStereographic::Forward(bool northp, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y) +{ + double lx, ly; + m_pPolarStereographic->Forward( northp, lat, lon, lx, ly ); + x = lx; + y = ly; +} + +//***************************************************************************** +void PolarStereographic::Reverse(bool northp, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon; + m_pPolarStereographic->Reverse( northp, x, y, llat, llon ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double PolarStereographic::MajorRadius::get() +{ return m_pPolarStereographic->MajorRadius(); } + +//***************************************************************************** +double PolarStereographic::Flattening::get() +{ return m_pPolarStereographic->Flattening(); } + +//***************************************************************************** +double PolarStereographic::CentralScale::get() +{ return m_pPolarStereographic->CentralScale(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolarStereographic.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolarStereographic.h new file mode 100644 index 000000000..2dba46c3f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolarStereographic.h @@ -0,0 +1,175 @@ +#pragma once +/** + * \file NETGeographicLib/PolarStereographic.h + * \brief Header for NETGeographicLib::PolarStereographic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /*! + \brief .NET wrapper for GeographicLib::PolarStereographic. + + This class allows .NET applications to access GeographicLib::PolarStereographic. + */ + /** + * \brief .NET wrapper for GeographicLib::PolarStereographic. + * + * This class allows .NET applications to access GeographicLib::PolarStereographic. + * + * Implementation taken from the report, + * - J. P. Snyder, + * Map Projections: A + * Working Manual, USGS Professional Paper 1395 (1987), + * pp. 160--163. + * + * This is a straightforward implementation of the equations in Snyder except + * that Newton's method is used to invert the projection. + * + * C# Example: + * \include example-PolarStereographic.cs + * Managed C++ Example: + * \include example-PolarStereographic.cpp + * Visual Basic Example: + * \include example-PolarStereographic.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor is provided that assumes WGS84 parameters and + * a UPS scale factor. + * + * The MajorRadius, Flattening, and CentralScale functions are + * implemented as properties. + **********************************************************************/ + public ref class PolarStereographic + { + private: + // pointer to the unmanaged GeographicLib::PolarStereographic + GeographicLib::PolarStereographic* m_pPolarStereographic; + + // the finalizer frees the unmanaged memory when the object is destroyed. + !PolarStereographic(void); + public: + + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] k0 central scale factor. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k0 is + * not positive. + **********************************************************************/ + PolarStereographic(double a, double f, double k0); + + /** + * An instantiation of PolarStereographic with the WGS84 ellipsoid + * and the UPS scale factor. + **********************************************************************/ + PolarStereographic(); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~PolarStereographic() + { this->!PolarStereographic(); } + + /** + * Set the scale for the projection. + * + * @param[in] lat (degrees) assuming \e northp = true. + * @param[in] k scale at latitude \e lat + * @exception GeographicErr \e k is not positive. + * @exception GeographicErr if \e lat is not in (−90°, + * 90°] or this object was created with the default constructor. + **********************************************************************/ + void SetScale(double lat, double k); + + /** + * Forward projection, from geographic to polar stereographic. + * + * @param[in] northp the pole which is the center of projection (true means + * north, false means south). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lat should be in the range + * (−90°, 90°] for \e northp = true and in the range + * [−90°, 90°) for \e northp = false; \e lon should + * be in the range [−540°, 540°). + **********************************************************************/ + void Forward(bool northp, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * Reverse projection, from polar stereographic to geographic. + * + * @param[in] northp the pole which is the center of projection (true means + * north, false means south). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. The value of \e lon returned is + * in the range [−180°, 180°). + **********************************************************************/ + void Reverse(bool northp, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * PolarStereographic::Forward without returning the convergence and scale. + **********************************************************************/ + void Forward(bool northp, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * PolarStereographic::Reverse without returning the convergence and scale. + **********************************************************************/ + void Reverse(bool northp, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value used in + * the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * The central scale for the projection. This is the value of \e k0 used + * in the constructor and is the scale at the pole unless overridden by + * PolarStereographic::SetScale. + **********************************************************************/ + property double CentralScale { double get(); } + ///@} + }; +} //namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolygonArea.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolygonArea.cpp new file mode 100644 index 000000000..2a824c913 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolygonArea.cpp @@ -0,0 +1,128 @@ +/** + * \file NETGeographicLib/PolygonArea.cpp + * \brief Implementation for NETGeographicLib::PolygonArea class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/PolygonArea.hpp" +#include "PolygonArea.h" +#include "Geodesic.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::PolygonArea"; + +//***************************************************************************** +PolygonArea::!PolygonArea(void) +{ + if ( m_pPolygonArea != NULL ) + { + delete m_pPolygonArea; + m_pPolygonArea = NULL; + } +} + +//***************************************************************************** +PolygonArea::PolygonArea(Geodesic^ earth, bool polyline ) +{ + try + { + const GeographicLib::Geodesic* pGeodesic = + reinterpret_cast( + earth->GetUnmanaged()->ToPointer() ); + m_pPolygonArea = new GeographicLib::PolygonArea( *pGeodesic, polyline ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +PolygonArea::PolygonArea(const bool polyline ) +{ + try + { + m_pPolygonArea = new GeographicLib::PolygonArea( + GeographicLib::Geodesic::WGS84, polyline ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void PolygonArea::Clear() { m_pPolygonArea->Clear(); } + +//***************************************************************************** +void PolygonArea::AddPoint(double lat, double lon) +{ + m_pPolygonArea->AddPoint( lat, lon ); +} + +//***************************************************************************** +void PolygonArea::AddEdge(double azi, double s) +{ + m_pPolygonArea->AddEdge( azi, s ); +} + +//***************************************************************************** +unsigned PolygonArea::Compute(bool reverse, bool sign, + [System::Runtime::InteropServices::Out] double% perimeter, + [System::Runtime::InteropServices::Out] double% area) +{ + double lperimeter, larea; + unsigned out = m_pPolygonArea->Compute( reverse, sign, lperimeter, larea ); + perimeter = lperimeter; + area = larea; + return out; +} + +//***************************************************************************** +unsigned PolygonArea::TestPoint(double lat, double lon, bool reverse, bool sign, + [System::Runtime::InteropServices::Out] double% perimeter, + [System::Runtime::InteropServices::Out] double% area) +{ + double lperimeter, larea; + unsigned out = m_pPolygonArea->TestPoint( lat, lon, reverse, sign, lperimeter, larea ); + perimeter = lperimeter; + area = larea; + return out; +} + +//***************************************************************************** +unsigned PolygonArea::TestEdge(double azi, double s, bool reverse, bool sign, + [System::Runtime::InteropServices::Out] double% perimeter, + [System::Runtime::InteropServices::Out] double% area) +{ + double lperimeter, larea; + unsigned out = m_pPolygonArea->TestEdge( azi, s, reverse, sign, lperimeter, larea ); + perimeter = lperimeter; + area = larea; + return out; +} + +//***************************************************************************** +void PolygonArea::CurrentPoint( + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon; + m_pPolygonArea->CurrentPoint( llat, llon ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double PolygonArea::MajorRadius::get() +{ return m_pPolygonArea->MajorRadius(); } + +//***************************************************************************** +double PolygonArea::Flattening::get() { return m_pPolygonArea->Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolygonArea.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolygonArea.h new file mode 100644 index 000000000..febad8898 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/PolygonArea.h @@ -0,0 +1,215 @@ +#pragma once +/** + * \file NETGeographicLib/PolygonArea.h + * \brief Header for NETGeographicLib::PolygonArea class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class Geodesic; + /** + * \brief .NET wrapper for GeographicLib::PolygonArea. + * + * This class allows .NET applications to access GeographicLib::PolygonArea. + * + * This computes the area of a geodesic polygon using the method given + * Section 6 of + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * + * This class lets you add vertices one at a time to the polygon. The area + * and perimeter are accumulated in two times the standard floating point + * precision to guard against the loss of accuracy with many-sided polygons. + * At any point you can ask for the perimeter and area so far. There's an + * option to treat the points as defining a polyline instead of a polygon; in + * that case, only the perimeter is computed. + * + * C# Example: + * \include example-PolygonArea.cs + * Managed C++ Example: + * \include example-PolygonArea.cpp + * Visual Basic Example: + * \include example-PolygonArea.vb + * + * INTERFACE DIFFERENCES:
+ * The MajorRadius and Flattening functions are implemented as properties. + **********************************************************************/ + public ref class PolygonArea + { + private: + // a pointer to the unmanaged GeographicLib::PolygonArea + GeographicLib::PolygonArea* m_pPolygonArea; + + // the finalize frees the unmanaged memory when the object is destroyed. + !PolygonArea(void); + public: + + /** + * Constructor for PolygonArea. + * + * @param[in] earth the Geodesic object to use for geodesic calculations. + * @param[in] polyline if true that treat the points as defining a polyline + * instead of a polygon. + **********************************************************************/ + PolygonArea(Geodesic^ earth, bool polyline ); + + /** + * Constructor for PolygonArea that assumes a WGS84 ellipsoid. + * + * @param[in] polyline if true that treat the points as defining a polyline + * instead of a polygon. + **********************************************************************/ + PolygonArea(const bool polyline ); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~PolygonArea() + { this->!PolygonArea(); } + + /** + * Clear PolygonArea, allowing a new polygon to be started. + **********************************************************************/ + void Clear(); + + /** + * Add a point to the polygon or polyline. + * + * @param[in] lat the latitude of the point (degrees). + * @param[in] lon the longitude of the point (degrees). + * + * \e lat should be in the range [−90°, 90°] and \e + * lon should be in the range [−540°, 540°). + **********************************************************************/ + void AddPoint(double lat, double lon); + + /** + * Add an edge to the polygon or polyline. + * + * @param[in] azi azimuth at current point (degrees). + * @param[in] s distance from current point to next point (meters). + * + * \e azi should be in the range [−540°, 540°). This does + * nothing if no points have been added yet. Use PolygonArea::CurrentPoint + * to determine the position of the new vertex. + **********************************************************************/ + void AddEdge(double azi, double s); + + /** + * Return the results so far. + * + * @param[in] reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param[in] sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] perimeter the perimeter of the polygon or length of the + * polyline (meters). + * @param[out] area the area of the polygon (meters2); only set + * if \e polyline is false in the constructor. + * @return the number of points. + **********************************************************************/ + unsigned Compute(bool reverse, bool sign, + [System::Runtime::InteropServices::Out] double% perimeter, + [System::Runtime::InteropServices::Out] double% area); + + /** + * Return the results assuming a tentative final test point is added; + * however, the data for the test point is not saved. This lets you report + * a running result for the perimeter and area as the user moves the mouse + * cursor. Ordinary floating point arithmetic is used to accumulate the + * data for the test point; thus the area and perimeter returned are less + * accurate than if PolygonArea::AddPoint and PolygonArea::Compute are + * used. + * + * @param[in] lat the latitude of the test point (degrees). + * @param[in] lon the longitude of the test point (degrees). + * @param[in] reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param[in] sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] perimeter the approximate perimeter of the polygon or length + * of the polyline (meters). + * @param[out] area the approximate area of the polygon + * (meters2); only set if polyline is false in the + * constructor. + * @return the number of points. + * + * \e lat should be in the range [−90°, 90°] and \e + * lon should be in the range [−540°, 540°). + **********************************************************************/ + unsigned TestPoint(double lat, double lon, bool reverse, bool sign, + [System::Runtime::InteropServices::Out] double% perimeter, + [System::Runtime::InteropServices::Out] double% area); + + /** + * Return the results assuming a tentative final test point is added via an + * azimuth and distance; however, the data for the test point is not saved. + * This lets you report a running result for the perimeter and area as the + * user moves the mouse cursor. Ordinary floating point arithmetic is used + * to accumulate the data for the test point; thus the area and perimeter + * returned are less accurate than if PolygonArea::AddEdge and + * PolygonArea::Compute are used. + * + * @param[in] azi azimuth at current point (degrees). + * @param[in] s distance from current point to final test point (meters). + * @param[in] reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param[in] sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] perimeter the approximate perimeter of the polygon or length + * of the polyline (meters). + * @param[out] area the approximate area of the polygon + * (meters2); only set if polyline is false in the + * constructor. + * @return the number of points. + * + * \e azi should be in the range [−540°, 540°). + **********************************************************************/ + unsigned TestEdge(double azi, double s, bool reverse, bool sign, + [System::Runtime::InteropServices::Out] double% perimeter, + [System::Runtime::InteropServices::Out] double% area); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * Report the previous vertex added to the polygon or polyline. + * + * @param[out] lat the latitude of the point (degrees). + * @param[out] lon the longitude of the point (degrees). + * + * If no points have been added, then NaNs are returned. Otherwise, \e lon + * will be in the range [−180°, 180°). + **********************************************************************/ + void CurrentPoint([System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/ReadMe.txt b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/ReadMe.txt new file mode 100644 index 000000000..53a4ef473 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/ReadMe.txt @@ -0,0 +1,38 @@ +======================================================================== + DYNAMIC LINK LIBRARY : NETGeographic Project Overview +======================================================================== + +AppWizard has created this NETGeographic DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your NETGeographic application. + +NETGeographic.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +NETGeographic.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +NETGeographic.cpp + This is the main DLL source file. + +NETGeographic.h + This file contains a class declaration. + +AssemblyInfo.cpp + Contains custom attributes for modifying assembly metadata. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalCoefficients.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalCoefficients.cpp new file mode 100644 index 000000000..ec834ffa1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalCoefficients.cpp @@ -0,0 +1,30 @@ +/** + * \file NETGeographicLib/SphericalCoefficients.cpp + * \brief Implementation for NETGeographicLib::SphericalCoefficients class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/SphericalEngine.hpp" +#include "SphericalCoefficients.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +SphericalCoefficients::SphericalCoefficients(const GeographicLib::SphericalEngine::coeff& c) +{ + m_N = c.N(); + m_nmx = c.nmx(); + m_mmx = c.mmx(); + int csize = Csize( c.nmx(), c.mmx() ); + int ssize = Ssize( c.nmx(), c.mmx() ); + int offset = csize - ssize; + m_C = gcnew array( csize ); + m_S = gcnew array( ssize ); + for ( int i = 0; i < csize; i++ ) m_C[i] = c.Cv(i); + for ( int i = 0; i < ssize; i++ ) m_S[i] = c.Sv(i+offset); +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalCoefficients.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalCoefficients.h new file mode 100644 index 000000000..c2727c6e1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalCoefficients.h @@ -0,0 +1,140 @@ +#pragma once +/** + * \file NETGeographicLib/SphericalCoefficients.h + * \brief Header for NETGeographicLib::SphericalCoefficients class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /*! + \brief .NET wrapper for GeographicLib::SphericalEngine::coeff. + + This class allows .NET applications to access GeographicLib::SphericalEngine::coeff. + + The SphericalHarmonic classes provide accessor functions that allow + you to examine the coefficients. These accessor functions export a + GeographicLib::SphericalEngine::coeff object. The GeographicLib::SphericalEngine + class is not implemented in NETGeographicLib. SphericalCoefficients is provided as + a substitute for GeographicLib::SphericalEngine::coeff allowing you to examine the + coefficients in .NET applications. + + Use SphericalHarmonic::Coefficients, SphericalHarmonic1::Coefficient*, + or SphericalHarmonic2::Coefficient* to obtain an instance of this + class. + + INTERFACE DIFFERENCES:
+ This class does not implement readcoeffs. + */ + public ref class SphericalCoefficients + { + private: + // The cosine coefficients. + array^ m_C; // size = Csize(m_nmx,m_mmx) + // The sine coefficients + array^ m_S; // size = Ssize(m_nmx,m_mmx) + // The dimension of the coefficients + int m_N; + int m_nmx; + int m_mmx; + public: + /*! + \brief Constructor. + \param[in] c A reference to a GeographicLib::SphericalEngine::coeff object. + This constructor is for internal use only. Developers should + not create an instance of SphericalCoefficients. Use + SphericalHarmonic::Coefficients, SphericalHarmonic1::Coefficient*, + or SphericalHarmonic2::Coefficient* to obtain an instance of this + class. + */ + SphericalCoefficients( const GeographicLib::SphericalEngine::coeff& c ); + + /** + * @return \e N the degree giving storage layout for \e C and \e S. + **********************************************************************/ + property int N { int get() { return m_N; } } + /** + * @return \e nmx the maximum degree to be used. + **********************************************************************/ + property int nmx { int get() { return m_nmx; } } + /** + * @return \e mmx the maximum order to be used. + **********************************************************************/ + property int mmx { int get() { return m_mmx; } } + /** + * The one-dimensional index into \e C and \e S. + * + * @param[in] n the degree. + * @param[in] m the order. + * @return the one-dimensional index. + **********************************************************************/ + int index(int n, int m) + { return m * m_N - m * (m - 1) / 2 + n; } + /** + * An element of \e C. + * + * @param[in] k the one-dimensional index. + * @return the value of the \e C coefficient. + **********************************************************************/ + double Cv(int k) { return m_C[k]; } + /** + * An element of \e S. + * + * @param[in] k the one-dimensional index. + * @return the value of the \e S coefficient. + **********************************************************************/ + double Sv(int k) { return m_S[k - (m_N + 1)]; } + /** + * An element of \e C with checking. + * + * @param[in] k the one-dimensional index. + * @param[in] n the requested degree. + * @param[in] m the requested order. + * @param[in] f a multiplier. + * @return the value of the \e C coefficient multiplied by \e f in \e n + * and \e m are in range else 0. + **********************************************************************/ + double Cv(int k, int n, int m, double f) + { return m > m_mmx || n > m_nmx ? 0 : m_C[k] * f; } + /** + * An element of \e S with checking. + * + * @param[in] k the one-dimensional index. + * @param[in] n the requested degree. + * @param[in] m the requested order. + * @param[in] f a multiplier. + * @return the value of the \e S coefficient multiplied by \e f in \e n + * and \e m are in range else 0. + **********************************************************************/ + double Sv(int k, int n, int m, double f) + { return m > m_mmx || n > m_nmx ? 0 : m_S[k - (m_N + 1)] * f; } + + /** + * The size of the coefficient vector for the cosine terms. + * + * @param[in] N the maximum degree. + * @param[in] M the maximum order. + * @return the size of the vector of cosine terms as stored in column + * major order. + **********************************************************************/ + static int Csize(int N, int M) + { return (M + 1) * (2 * N - M + 2) / 2; } + + /** + * The size of the coefficient vector for the sine terms. + * + * @param[in] N the maximum degree. + * @param[in] M the maximum order. + * @return the size of the vector of cosine terms as stored in column + * major order. + **********************************************************************/ + static int Ssize(int N, int M) + { return Csize(N, M) - (N + 1); } + + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic.cpp new file mode 100644 index 000000000..964609a8c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic.cpp @@ -0,0 +1,127 @@ +/** + * \file NETGeographicLib/SphericalHarmonic.cpp + * \brief Implementation for NETGeographicLib::SphericalHarmonic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/SphericalHarmonic.hpp" +#include "SphericalHarmonic.h" +#include "CircularEngine.h" +#include "SphericalCoefficients.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::SphericalHarmonic"; + +//***************************************************************************** +SphericalHarmonic::!SphericalHarmonic(void) +{ + if ( m_pSphericalHarmonic != NULL ) + { + delete m_pSphericalHarmonic; + m_pSphericalHarmonic = NULL; + } + if ( m_C != NULL ) + { + delete m_C; + m_C = NULL; + } + if ( m_S != NULL ) + { + delete m_S; + m_S = NULL; + } +} + +//***************************************************************************** +SphericalHarmonic::SphericalHarmonic(array^ C, + array^ S, + int N, double a, Normalization norm ) +{ + try + { + m_C = new std::vector(); + m_S = new std::vector(); + for each ( double x in C ) m_C->push_back(x); + for each ( double x in S ) m_S->push_back(x); + m_pSphericalHarmonic = new GeographicLib::SphericalHarmonic( + *m_C, *m_S, N, a, static_cast(norm) ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } + catch ( System::Exception^ sxpt ) + { + throw gcnew GeographicErr( sxpt->Message ); + } +} + +//***************************************************************************** +SphericalHarmonic::SphericalHarmonic(array^ C, + array^ S, + int N, int nmx, int mmx, + double a, Normalization norm) +{ + try + { + m_C = new std::vector(); + m_S = new std::vector(); + for each ( double x in C ) m_C->push_back(x); + for each ( double x in S ) m_S->push_back(x); + m_pSphericalHarmonic = new GeographicLib::SphericalHarmonic( + *m_C, *m_S, N, nmx, mmx, a, static_cast(norm) ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& xcpt ) + { + throw gcnew GeographicErr( xcpt.what() ); + } + catch ( System::Exception^ sxpt ) + { + throw gcnew GeographicErr( sxpt->Message ); + } +} + +//***************************************************************************** +double SphericalHarmonic::HarmonicSum(double x, double y, double z) +{ + return m_pSphericalHarmonic->operator()( x, y, z ); +} + +//***************************************************************************** +double SphericalHarmonic::HarmonicSum(double x, double y, double z, + double% gradx, double% grady, double% gradz) +{ + double lx, ly, lz; + double out = m_pSphericalHarmonic->operator()( x, y, z, lx, ly, lz ); + gradx = lx; + grady = ly; + gradz = lz; + return out; +} + +//***************************************************************************** +CircularEngine^ SphericalHarmonic::Circle(double p, double z, bool gradp) +{ + return gcnew CircularEngine( m_pSphericalHarmonic->Circle( p, z, gradp ) ); +} + +//***************************************************************************** +SphericalCoefficients^ SphericalHarmonic::Coefficients() +{ + return gcnew SphericalCoefficients( m_pSphericalHarmonic->Coefficients() ); +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic.h new file mode 100644 index 000000000..6bacb3a8b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic.h @@ -0,0 +1,271 @@ +#pragma once +/** + * \file NETGeographicLib/SphericalHarmonic.h + * \brief Header for NETGeographicLib::SphericalHarmonic class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class CircularEngine; + ref class SphericalCoefficients; + /** + * \brief .NET wrapper for GeographicLib::SphericalHarmonic. + * + * This class allows .NET applications to access GeographicLib::SphericalHarmonic. + * + * This class evaluates the spherical harmonic sum \verbatim + V(x, y, z) = sum(n = 0..N)[ q^(n+1) * sum(m = 0..n)[ + (C[n,m] * cos(m*lambda) + S[n,m] * sin(m*lambda)) * + P[n,m](cos(theta)) ] ] + \endverbatim + * where + * - p2 = x2 + y2, + * - r2 = p2 + z2, + * - \e q = a/r, + * - θ = atan2(\e p, \e z) = the spherical \e colatitude, + * - λ = atan2(\e y, \e x) = the longitude. + * - P\e nm(\e t) is the associated Legendre polynomial of degree + * \e n and order \e m. + * + * Two normalizations are supported for P\e nm + * - fully normalized denoted by SphericalHarmonic::FULL. + * - Schmidt semi-normalized denoted by SphericalHarmonic::SCHMIDT. + * + * Clenshaw summation is used for the sums over both \e n and \e m. This + * allows the computation to be carried out without the need for any + * temporary arrays. See GeographicLib::SphericalEngine.cpp for more + * information on the implementation. + * + * References: + * - C. W. Clenshaw, A note on the summation of Chebyshev series, + * %Math. Tables Aids Comput. 9(51), 118--120 (1955). + * - R. E. Deakin, Derivatives of the earth's potentials, Geomatics + * Research Australasia 68, 31--60, (June 1998). + * - W. A. Heiskanen and H. Moritz, Physical Geodesy, (Freeman, San + * Francisco, 1967). (See Sec. 1-14, for a definition of Pbar.) + * - S. A. Holmes and W. E. Featherstone, A unified approach to the Clenshaw + * summation and the recursive computation of very high degree and order + * normalised associated Legendre functions, J. Geodesy 76(5), + * 279--299 (2002). + * - C. C. Tscherning and K. Poder, Some geodetic applications of Clenshaw + * summation, Boll. Geod. Sci. Aff. 41(4), 349--375 (1982). + * + * C# Example: + * \include example-SphericalHarmonic.cs + * Managed C++ Example: + * \include example-SphericalHarmonic.cpp + * Visual Basic Example: + * \include example-SphericalHarmonic.vb + * + * INTERFACE DIFFERENCES:
+ * This class replaces the GeographicLib::SphericalHarmonic::operator() with + * HarmonicSum. + * + * Coefficients returns a SphericalCoefficients object. + * + * The Normalization parameter in the constructors is passed in as an + * enumeration rather than an unsigned. + **********************************************************************/ + public ref class SphericalHarmonic + { + private: + // a pointer to the unmanaged GeographicLib::SphericalHarmonic + const GeographicLib::SphericalHarmonic* m_pSphericalHarmonic; + // the finalizer frees the unmanaged memory when the object is destroyed. + !SphericalHarmonic(); + // local containers for the cosine and sine coefficients. The + // GeographicLib::SphericalEngine::coeffs class uses a + // std::vector::iterator to access these vectors. + std::vector *m_C, *m_S; + public: + /** + * Supported normalizations for the associated Legendre polynomials. + **********************************************************************/ + enum class Normalization { + /** + * Fully normalized associated Legendre polynomials. + * + * These are defined by Pnmfull(\e z) + * = (−1)m sqrt(\e k (2\e n + 1) (\e n − \e + * m)! / (\e n + \e m)!) + * Pnm(\e z), where + * Pnm(\e z) is Ferrers + * function (also known as the Legendre function on the cut or the + * associated Legendre polynomial) http://dlmf.nist.gov/14.7.E10 and \e k + * = 1 for \e m = 0 and \e k = 2 otherwise. + * + * The mean squared value of + * Pnmfull(cosθ) + * cos(mλ) and + * Pnmfull(cosθ) + * sin(mλ) over the sphere is 1. + * + * @hideinitializer + **********************************************************************/ + FULL = GeographicLib::SphericalEngine::FULL, + /** + * Schmidt semi-normalized associated Legendre polynomials. + * + * These are defined by Pnmschmidt(\e + * z) = (−1)m sqrt(\e k (\e n − \e m)! / + * (\e n + \e m)!) Pnm(\e z), + * where Pnm(\e z) is Ferrers + * function (also known as the Legendre function on the cut or the + * associated Legendre polynomial) http://dlmf.nist.gov/14.7.E10 and \e k + * = 1 for \e m = 0 and \e k = 2 otherwise. + * + * The mean squared value of + * Pnmschmidt(cosθ) + * cos(mλ) and + * Pnmschmidt(cosθ) + * sin(mλ) over the sphere is 1/(2\e n + 1). + * + * @hideinitializer + **********************************************************************/ + SCHMIDT = GeographicLib::SphericalEngine::SCHMIDT, + }; + + /** + * Constructor with a full set of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the maximum degree and order of the sum + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic::full (the default) or + * SphericalHarmonic::schmidt. + * @exception GeographicErr if \e N does not satisfy \e N ≥ −1. + * @exception GeographicErr if \e C or \e S is not big enough to hold the + * coefficients. + * + * The coefficients \e C\e nm and \e S\e nm are + * stored in the one-dimensional vectors \e C and \e S which must contain + * (\e N + 1)(\e N + 2)/2 and N (\e N + 1)/2 elements, respectively, stored + * in "column-major" order. Thus for \e N = 3, the order would be: + * C00, + * C10, + * C20, + * C30, + * C11, + * C21, + * C31, + * C22, + * C32, + * C33. + * In general the (\e n,\e m) element is at index \e m \e N − \e m + * (\e m − 1)/2 + \e n. The layout of \e S is the same except that + * the first column is omitted (since the \e m = 0 terms never contribute + * to the sum) and the 0th element is S11 + * + * The class stores pointers to the first elements of \e C and \e S. + * These arrays should not be altered or destroyed during the lifetime of a + * SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic(array^ C, + array^ S, + int N, double a, Normalization norm ); + + /** + * Constructor with a subset of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the degree used to determine the layout of \e C and \e S. + * @param[in] nmx the maximum degree used in the sum. The sum over \e n is + * from 0 thru \e nmx. + * @param[in] mmx the maximum order used in the sum. The sum over \e m is + * from 0 thru min(\e n, \e mmx). + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic::FULL (the default) or + * SphericalHarmonic::SCHMIDT. + * @exception GeographicErr if \e N, \e nmx, and \e mmx do not satisfy + * \e N ≥ \e nmx ≥ \e mmx ≥ −1. + * @exception GeographicErr if \e C or \e S is not big enough to hold the + * coefficients. + * + * The class stores pointers to the first elements of \e C and \e S. + * These arrays should not be altered or destroyed during the lifetime of a + * SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic(array^ C, + array^ S, + int N, int nmx, int mmx, + double a, Normalization norm); + + /** + * The destructor calls the finalizer + **********************************************************************/ + ~SphericalHarmonic() { this->!SphericalHarmonic(); } + + /** + * Compute the spherical harmonic sum. + * + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @return \e V the spherical harmonic sum. + * + * This routine requires constant memory and thus never throws an + * exception. + **********************************************************************/ + double HarmonicSum(double x, double y, double z); + + /** + * Compute a spherical harmonic sum and its gradient. + * + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @param[out] gradx \e x component of the gradient + * @param[out] grady \e y component of the gradient + * @param[out] gradz \e z component of the gradient + * @return \e V the spherical harmonic sum. + * + * This is the same as the previous function, except that the components of + * the gradients of the sum in the \e x, \e y, and \e z directions are + * computed. This routine requires constant memory and thus never throws + * an exception. + **********************************************************************/ + double HarmonicSum(double x, double y, double z, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz); + + /** + * Create a CircularEngine to allow the efficient evaluation of several + * points on a circle of latitude. + * + * @param[in] p the radius of the circle. + * @param[in] z the height of the circle above the equatorial plane. + * @param[in] gradp if true the returned object will be able to compute the + * gradient of the sum. + * @exception std::bad_alloc if the memory for the CircularEngine can't be + * allocated. + * @return the CircularEngine object. + * + * SphericalHarmonic::operator()() exchanges the order of the sums in the + * definition, i.e., ∑n = 0..Nm = 0..n + * becomes ∑m = 0..Nn = m..N. + * SphericalHarmonic::Circle performs the inner sum over degree \e n (which + * entails about N2 operations). Calling + * CircularEngine::operator()() on the returned object performs the outer + * sum over the order \e m (about \e N operations). + **********************************************************************/ + CircularEngine^ Circle(double p, double z, bool gradp); + + /** + * @return the zeroth SphericalCoefficients object. + **********************************************************************/ + SphericalCoefficients^ Coefficients(); + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic1.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic1.cpp new file mode 100644 index 000000000..4308591f7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic1.cpp @@ -0,0 +1,168 @@ +/** + * \file NETGeographicLib/SphericalHarmonic1.cpp + * \brief Implementation for NETGeographicLib::SphericalHarmonic1 class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/SphericalHarmonic1.hpp" +#include "SphericalHarmonic1.h" +#include "CircularEngine.h" +#include "SphericalCoefficients.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::SphericalHarmonic1"; + +//***************************************************************************** +SphericalHarmonic1::!SphericalHarmonic1(void) +{ + if ( m_pSphericalHarmonic1 != NULL ) + { + delete m_pSphericalHarmonic1; + m_pSphericalHarmonic1 = NULL; + } + + if ( m_C != NULL ) + { + for ( int i = 0; i < m_numCoeffVectors; i++ ) + if ( m_C[i] != NULL ) + delete m_C[i]; + delete [] m_C; + m_C = NULL; + } + + if ( m_S != NULL ) + { + for ( int i = 0; i < m_numCoeffVectors; i++ ) + if ( m_S[i] != NULL ) + delete m_S[i]; + delete [] m_S; + m_S = NULL; + } +} + +//***************************************************************************** +SphericalHarmonic1::SphericalHarmonic1( array^ C, + array^ S, + int N, + array^ C1, + array^ S1, + int N1, + double a, + Normalization norm ) +{ + try + { + m_C = new std::vector*[m_numCoeffVectors]; + for ( int i = 0; i < m_numCoeffVectors; i++ ) m_C[i] = new std::vector(); + m_S = new std::vector*[m_numCoeffVectors]; + for ( int i = 0; i < m_numCoeffVectors; i++ ) m_S[i] = new std::vector(); + for each ( double x in C ) m_C[0]->push_back( x ); + for each ( double x in S ) m_S[0]->push_back( x ); + for each ( double x in C1 ) m_C[1]->push_back( x ); + for each ( double x in S1 ) m_S[1]->push_back( x ); + m_pSphericalHarmonic1 = new GeographicLib::SphericalHarmonic1( + *m_C[0], *m_S[0], N, *m_C[1], *m_S[1], N1, a, (unsigned)norm ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } + catch ( System::Exception^ sxpt ) + { + throw gcnew GeographicErr( sxpt->Message ); + } +} + +//***************************************************************************** +SphericalHarmonic1::SphericalHarmonic1( array^ C, + array^ S, + int N, int nmx, int mmx, + array^ C1, + array^ S1, + int N1, int nmx1, int mmx1, + double a, + Normalization norm ) +{ + try + { + m_C = new std::vector*[m_numCoeffVectors]; + for ( int i = 0; i < m_numCoeffVectors; i++ ) m_C[i] = new std::vector(); + m_S = new std::vector*[m_numCoeffVectors]; + for ( int i = 0; i < m_numCoeffVectors; i++ ) m_S[i] = new std::vector(); + for each ( double x in C ) m_C[0]->push_back( x ); + for each ( double x in S ) m_S[0]->push_back( x ); + for each ( double x in C1 ) m_C[1]->push_back( x ); + for each ( double x in S1 ) m_S[1]->push_back( x ); + m_pSphericalHarmonic1 = new GeographicLib::SphericalHarmonic1( + *m_C[0], *m_S[0], N, nmx, mmx, *m_C[1], *m_S[1], N1, nmx1, mmx1, a, + (unsigned)norm ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } + catch ( System::Exception^ sxpt ) + { + throw gcnew GeographicErr( sxpt->Message ); + } +} + +//***************************************************************************** +double SphericalHarmonic1::HarmonicSum(double tau, double x, double y, double z) +{ + return m_pSphericalHarmonic1->operator()( tau, x, y, z ); +} + +//***************************************************************************** +double SphericalHarmonic1::HarmonicSum(double tau, double x, double y, double z, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz) +{ + double lgradx, lgrady, lgradz; + double out = m_pSphericalHarmonic1->operator()( tau, x, y, z, lgradx, lgrady, lgradz ); + gradx = lgradx; + grady = lgrady; + gradz = lgradz; + return out; +} + +//***************************************************************************** +CircularEngine^ SphericalHarmonic1::Circle(double tau, double p, double z, bool gradp) +{ + try + { + return gcnew CircularEngine( m_pSphericalHarmonic1->Circle( tau, p, z, gradp ) ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Failed to allocate memory for a CircularEngine in SphericalHarmonic1::Circle" ); + } +} + +//***************************************************************************** +SphericalCoefficients^ SphericalHarmonic1::Coefficients() +{ + return gcnew SphericalCoefficients( m_pSphericalHarmonic1->Coefficients() ); +} + +//***************************************************************************** +SphericalCoefficients^ SphericalHarmonic1::Coefficients1() +{ + return gcnew SphericalCoefficients( m_pSphericalHarmonic1->Coefficients1() ); +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic1.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic1.h new file mode 100644 index 000000000..c05a1b8ab --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic1.h @@ -0,0 +1,226 @@ +#pragma once +/** + * \file NETGeographicLib/SphericalHarmonic1.h + * \brief Header for NETGeographicLib::SphericalHarmonic1 class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class SphericalCoefficients; + ref class CircularEngine; + /** + * \brief .NET wrapper for GeographicLib::SphericalHarmonic1. + * + * This class allows .NET applications to access GeographicLib::SphericalHarmonic1. + * + * This class is similar to SphericalHarmonic, except that the coefficients + * \e C\e nm are replaced by \e C\e nm + \e tau + * C'\e nm (and similarly for \e S\e nm). + * + * C# Example: + * \include example-SphericalHarmonic1.cs + * Managed C++ Example: + * \include example-SphericalHarmonic1.cpp + * Visual Basic Example: + * \include example-SphericalHarmonic1.vb + * + * INTERFACE DIFFERENCES:
+ * This class replaces the () operator with HarmonicSum(). + * + * Coefficients returns a SphericalCoefficients object. + **********************************************************************/ + public ref class SphericalHarmonic1 + { + private: + // pointer to the unmanaged GeographicLib::SphericalHarmonic1. + const GeographicLib::SphericalHarmonic1* m_pSphericalHarmonic1; + + // the finalizer destroys the unmanaged memory when the object is destroyed. + !SphericalHarmonic1(void); + // the number of coefficient vectors. + static const int m_numCoeffVectors = 2; + // local containers for the cosine and sine coefficients. The + // GeographicLib::SphericalEngine::coeffs class uses a + // std::vector::iterator to access these vectors. + std::vector **m_C, **m_S; + public: + /** + * Supported normalizations for associate Legendre polynomials. + **********************************************************************/ + enum class Normalization { + /** + * Fully normalized associated Legendre polynomials. See + * SphericalHarmonic::FULL for documentation. + * + * @hideinitializer + **********************************************************************/ + FULL = GeographicLib::SphericalEngine::FULL, + /** + * Schmidt semi-normalized associated Legendre polynomials. See + * SphericalHarmonic::SCHMIDT for documentation. + * + * @hideinitializer + **********************************************************************/ + SCHMIDT = GeographicLib::SphericalEngine::SCHMIDT, + }; + + /** + * Constructor with a full set of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the maximum degree and order of the sum + * @param[in] C1 the coefficients \e C'\e nm. + * @param[in] S1 the coefficients \e S'\e nm. + * @param[in] N1 the maximum degree and order of the correction + * coefficients \e C'\e nm and \e S'\e nm. + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic1::FULL (the default) or + * SphericalHarmonic1::SCHMIDT. + * @exception GeographicErr if \e N and \e N1 do not satisfy \e N ≥ + * \e N1 ≥ −1. + * @exception GeographicErr if any of the vectors of coefficients is not + * large enough. + * + * See SphericalHarmonic for the way the coefficients should be stored. + * + * The class stores pointers to the first elements of \e C, \e S, \e + * C', and \e S'. These arrays should not be altered or destroyed during + * the lifetime of a SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic1(array^ C, + array^ S, + int N, + array^ C1, + array^ S1, + int N1, + double a, + Normalization norm ); + + /** + * Constructor with a subset of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the degree used to determine the layout of \e C and \e S. + * @param[in] nmx the maximum degree used in the sum. The sum over \e n is + * from 0 thru \e nmx. + * @param[in] mmx the maximum order used in the sum. The sum over \e m is + * from 0 thru min(\e n, \e mmx). + * @param[in] C1 the coefficients \e C'\e nm. + * @param[in] S1 the coefficients \e S'\e nm. + * @param[in] N1 the degree used to determine the layout of \e C' and \e + * S'. + * @param[in] nmx1 the maximum degree used for \e C' and \e S'. + * @param[in] mmx1 the maximum order used for \e C' and \e S'. + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic1::FULL (the default) or + * SphericalHarmonic1::SCHMIDT. + * @exception GeographicErr if the parameters do not satisfy \e N ≥ \e + * nmx ≥ \e mmx ≥ −1; \e N1 ≥ \e nmx1 ≥ \e mmx1 ≥ + * −1; \e N ≥ \e N1; \e nmx ≥ \e nmx1; \e mmx ≥ \e mmx1. + * @exception GeographicErr if any of the vectors of coefficients is not + * large enough. + * + * The class stores pointers to the first elements of \e C, \e S, \e + * C', and \e S'. These arrays should not be altered or destroyed during + * the lifetime of a SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic1(array^ C, + array^ S, + int N, int nmx, int mmx, + array^ C1, + array^ S1, + int N1, int nmx1, int mmx1, + double a, + Normalization norm ); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~SphericalHarmonic1() + { this->!SphericalHarmonic1(); } + + /** + * Compute a spherical harmonic sum with a correction term. + * + * @param[in] tau multiplier for correction coefficients \e C' and \e S'. + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @return \e V the spherical harmonic sum. + * + * This routine requires constant memory and thus never throws + * an exception. + **********************************************************************/ + double HarmonicSum(double tau, double x, double y, double z); + + /** + * Compute a spherical harmonic sum with a correction term and its + * gradient. + * + * @param[in] tau multiplier for correction coefficients \e C' and \e S'. + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @param[out] gradx \e x component of the gradient + * @param[out] grady \e y component of the gradient + * @param[out] gradz \e z component of the gradient + * @return \e V the spherical harmonic sum. + * + * This is the same as the previous function, except that the components of + * the gradients of the sum in the \e x, \e y, and \e z directions are + * computed. This routine requires constant memory and thus never throws + * an exception. + **********************************************************************/ + double HarmonicSum(double tau, double x, double y, double z, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz); + + /** + * Create a CircularEngine to allow the efficient evaluation of several + * points on a circle of latitude at a fixed value of \e tau. + * + * @param[in] tau the multiplier for the correction coefficients. + * @param[in] p the radius of the circle. + * @param[in] z the height of the circle above the equatorial plane. + * @param[in] gradp if true the returned object will be able to compute the + * gradient of the sum. + * @exception std::bad_alloc if the memory for the CircularEngine can't be + * allocated. + * @return the CircularEngine object. + * + * SphericalHarmonic1::operator()() exchanges the order of the sums in the + * definition, i.e., ∑n = 0..Nm = 0..n + * becomes ∑m = 0..Nn = m..N. + * SphericalHarmonic1::Circle performs the inner sum over degree \e n + * (which entails about N2 operations). Calling + * CircularEngine::operator()() on the returned object performs the outer + * sum over the order \e m (about \e N operations). + * + * See SphericalHarmonic::Circle for an example of its use. + **********************************************************************/ + CircularEngine^ Circle(double tau, double p, double z, bool gradp); + + /** + * @return the zeroth SphericalCoefficients object. + **********************************************************************/ + SphericalCoefficients^ Coefficients(); + + /** + * @return the first SphericalCoefficients object. + **********************************************************************/ + SphericalCoefficients^ Coefficients1(); + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic2.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic2.cpp new file mode 100644 index 000000000..b529359a3 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic2.cpp @@ -0,0 +1,186 @@ +/** + * \file NETGeographicLib/SphericalHarmonic2.cpp + * \brief Implementation for NETGeographicLib::SphericalHarmonic2 class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/SphericalHarmonic2.hpp" +#include "SphericalHarmonic2.h" +#include "CircularEngine.h" +#include "SphericalCoefficients.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::SphericalHarmonic2"; + +//***************************************************************************** +SphericalHarmonic2::!SphericalHarmonic2(void) +{ + if ( m_pSphericalHarmonic2 != NULL ) + { + delete m_pSphericalHarmonic2; + m_pSphericalHarmonic2 = NULL; + } + + if ( m_C != NULL ) + { + for ( int i = 0; i < m_numCoeffVectors; i++ ) + if ( m_C[i] != NULL ) + delete m_C[i]; + delete [] m_C; + m_C = NULL; + } + + if ( m_S != NULL ) + { + for ( int i = 0; i < m_numCoeffVectors; i++ ) + if ( m_S[i] != NULL ) + delete m_S[i]; + delete [] m_S; + m_S = NULL; + } +} + +//***************************************************************************** +SphericalHarmonic2::SphericalHarmonic2(array^ C, + array^ S, + int N, + array^ C1, + array^ S1, + int N1, + array^ C2, + array^ S2, + int N2, + double a, + Normalization norm ) +{ + try + { + m_C = new std::vector*[m_numCoeffVectors]; + for ( int i = 0; i < m_numCoeffVectors; i++ ) m_C[i] = new std::vector(); + m_S = new std::vector*[m_numCoeffVectors]; + for ( int i = 0; i < m_numCoeffVectors; i++ ) m_S[i] = new std::vector(); + for each ( double x in C ) m_C[0]->push_back( x ); + for each ( double x in S ) m_S[0]->push_back( x ); + for each ( double x in C1 ) m_C[1]->push_back( x ); + for each ( double x in S1 ) m_S[1]->push_back( x ); + for each ( double x in C2 ) m_C[2]->push_back( x ); + for each ( double x in S2 ) m_S[2]->push_back( x ); + m_pSphericalHarmonic2 = new GeographicLib::SphericalHarmonic2( *m_C[0], *m_S[0], N, + *m_C[1], *m_S[1], N1, *m_C[2], *m_S[2], N2, a, (unsigned)norm); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } + catch ( System::Exception^ sxpt ) + { + throw gcnew GeographicErr( sxpt->Message ); + } +} + +//***************************************************************************** +SphericalHarmonic2::SphericalHarmonic2(array^ C, + array^ S, + int N, int nmx, int mmx, + array^ C1, + array^ S1, + int N1, int nmx1, int mmx1, + array^ C2, + array^ S2, + int N2, int nmx2, int mmx2, + double a, + Normalization norm ) +{ + try + { + m_C = new std::vector*[m_numCoeffVectors]; + for ( int i = 0; i < m_numCoeffVectors; i++ ) m_C[i] = new std::vector(); + m_S = new std::vector*[m_numCoeffVectors]; + for ( int i = 0; i < m_numCoeffVectors; i++ ) m_S[i] = new std::vector(); + for each ( double x in C ) m_C[0]->push_back( x ); + for each ( double x in S ) m_S[0]->push_back( x ); + for each ( double x in C1 ) m_C[1]->push_back( x ); + for each ( double x in S1 ) m_S[1]->push_back( x ); + for each ( double x in C2 ) m_C[2]->push_back( x ); + for each ( double x in S2 ) m_S[2]->push_back( x ); + m_pSphericalHarmonic2 = new GeographicLib::SphericalHarmonic2( *m_C[0], *m_S[0], N, + nmx, mmx, *m_C[1], *m_S[1], N1, nmx1, mmx1, *m_C[2], *m_S[2], N2, nmx2, mmx2, a, + (unsigned)norm ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } + catch ( System::Exception^ sxpt ) + { + throw gcnew GeographicErr( sxpt->Message ); + } +} + +//***************************************************************************** +double SphericalHarmonic2::HarmonicSum(double tau1, double tau2, double x, double y, double z) +{ + return m_pSphericalHarmonic2->operator()( tau1, tau2, x, y, z ); +} + +//***************************************************************************** +double SphericalHarmonic2::HarmonicSum(double tau1, double tau2, double x, double y, double z, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz) +{ + double lgradx, lgrady, lgradz; + double out = m_pSphericalHarmonic2->operator()( tau1, tau2, x, y, z, + lgradx, lgrady, lgradz ); + gradx = lgradx; + grady = lgrady; + gradz = lgradz; + return out; +} + +//***************************************************************************** +CircularEngine^ SphericalHarmonic2::Circle(double tau1, double tau2, double p, + double z, bool gradp) +{ + try + { + return gcnew CircularEngine( m_pSphericalHarmonic2->Circle( tau1, tau2, p, z, gradp ) ); + } + catch ( std::bad_alloc ) + { + throw gcnew GeographicErr( "Memory allocation error in SphericalHarmonic2::Circle" ); + } +} + +//***************************************************************************** +SphericalCoefficients^ SphericalHarmonic2::Coefficients() +{ + return gcnew SphericalCoefficients( m_pSphericalHarmonic2->Coefficients() ); +} + +//***************************************************************************** +SphericalCoefficients^ SphericalHarmonic2::Coefficients1() +{ + return gcnew SphericalCoefficients( m_pSphericalHarmonic2->Coefficients1() ); +} + +//***************************************************************************** +SphericalCoefficients^ SphericalHarmonic2::Coefficients2() +{ + return gcnew SphericalCoefficients( m_pSphericalHarmonic2->Coefficients2() ); +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic2.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic2.h new file mode 100644 index 000000000..faffcae19 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/SphericalHarmonic2.h @@ -0,0 +1,251 @@ +#pragma once +/** + * \file NETGeographicLib/SphericalHarmonic2.h + * \brief Header for NETGeographicLib::SphericalHarmonic2 class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + ref class CircularEngine; + ref class SphericalCoefficients; + /** + * \brief .NET wrapper for GeographicLib::SphericalHarmonic2. + * + * This class allows .NET applications to access GeographicLib::SphericalHarmonic2. + * + * This class is similar to SphericalHarmonic, except that the coefficients + * \e C\e nm are replaced by \e C\e nm + \e tau' + * C'\e nm + \e tau'' C''\e nm (and similarly for \e + * S\e nm). + * + * C# Example: + * \include example-SphericalHarmonic2.cs + * Managed C++ Example: + * \include example-SphericalHarmonic2.cpp + * Visual Basic Example: + * \include example-SphericalHarmonic2.vb + * + * INTERFACE DIFFERENCES:
+ * This class replaces the () operator with HarmonicSum(). + * + * Coefficients, Coefficients1, and Coefficients2 return a SphericalCoefficients + * object. + **********************************************************************/ + public ref class SphericalHarmonic2 + { + private: + // pointer to the unmanaged GeographicLib::SphericalHarmonic2 + const GeographicLib::SphericalHarmonic2* m_pSphericalHarmonic2; + // the finalizer destroys the unmanaged memory when the object is destroyed. + !SphericalHarmonic2(void); + // the number of coefficient vectors. + static const int m_numCoeffVectors = 3; + // local containers for the cosine and sine coefficients. The + // GeographicLib::SphericalEngine::coeffs class uses a + // std::vector::iterator to access these vectors. + std::vector **m_C, **m_S; + public: + /** + * Supported normalizations for associate Legendre polynomials. + **********************************************************************/ + enum class Normalization { + /** + * Fully normalized associated Legendre polynomials. See + * SphericalHarmonic::FULL for documentation. + * + * @hideinitializer + **********************************************************************/ + FULL = GeographicLib::SphericalEngine::FULL, + /** + * Schmidt semi-normalized associated Legendre polynomials. See + * SphericalHarmonic::SCHMIDT for documentation. + * + * @hideinitializer + **********************************************************************/ + SCHMIDT = GeographicLib::SphericalEngine::SCHMIDT + }; + + /** + * Constructor with a full set of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the maximum degree and order of the sum + * @param[in] C1 the coefficients \e C'\e nm. + * @param[in] S1 the coefficients \e S'\e nm. + * @param[in] N1 the maximum degree and order of the first correction + * coefficients \e C'\e nm and \e S'\e nm. + * @param[in] C2 the coefficients \e C''\e nm. + * @param[in] S2 the coefficients \e S''\e nm. + * @param[in] N2 the maximum degree and order of the second correction + * coefficients \e C'\e nm and \e S'\e nm. + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic2::FULL (the default) or + * SphericalHarmonic2::SCHMIDT. + * @exception GeographicErr if \e N and \e N1 do not satisfy \e N ≥ + * \e N1 ≥ −1, and similarly for \e N2. + * @exception GeographicErr if any of the vectors of coefficients is not + * large enough. + * + * See SphericalHarmonic for the way the coefficients should be stored. \e + * N1 and \e N2 should satisfy \e N1 ≤ \e N and \e N2 ≤ \e N. + * + * The class stores pointers to the first elements of \e C, \e S, \e + * C', \e S', \e C'', and \e S''. These arrays should not be altered or + * destroyed during the lifetime of a SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic2(array^ C, + array^ S, + int N, + array^ C1, + array^ S1, + int N1, + array^ C2, + array^ S2, + int N2, + double a, + Normalization norm ); + + /** + * Constructor with a subset of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the degree used to determine the layout of \e C and \e S. + * @param[in] nmx the maximum degree used in the sum. The sum over \e n is + * from 0 thru \e nmx. + * @param[in] mmx the maximum order used in the sum. The sum over \e m is + * from 0 thru min(\e n, \e mmx). + * @param[in] C1 the coefficients \e C'\e nm. + * @param[in] S1 the coefficients \e S'\e nm. + * @param[in] N1 the degree used to determine the layout of \e C' and \e + * S'. + * @param[in] nmx1 the maximum degree used for \e C' and \e S'. + * @param[in] mmx1 the maximum order used for \e C' and \e S'. + * @param[in] C2 the coefficients \e C''\e nm. + * @param[in] S2 the coefficients \e S''\e nm. + * @param[in] N2 the degree used to determine the layout of \e C'' and \e + * S''. + * @param[in] nmx2 the maximum degree used for \e C'' and \e S''. + * @param[in] mmx2 the maximum order used for \e C'' and \e S''. + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic2::FULL (the default) or + * SphericalHarmonic2::SCHMIDT. + * @exception GeographicErr if the parameters do not satisfy \e N ≥ \e + * nmx ≥ \e mmx ≥ −1; \e N1 ≥ \e nmx1 ≥ \e mmx1 ≥ + * −1; \e N ≥ \e N1; \e nmx ≥ \e nmx1; \e mmx ≥ \e mmx1; + * and similarly for \e N2, \e nmx2, and \e mmx2. + * @exception GeographicErr if any of the vectors of coefficients is not + * large enough. + * + * The class stores pointers to the first elements of \e C, \e S, \e + * C', \e S', \e C'', and \e S''. These arrays should not be altered or + * destroyed during the lifetime of a SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic2(array^ C, + array^ S, + int N, int nmx, int mmx, + array^ C1, + array^ S1, + int N1, int nmx1, int mmx1, + array^ C2, + array^ S2, + int N2, int nmx2, int mmx2, + double a, + Normalization norm ); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~SphericalHarmonic2() + { this->!SphericalHarmonic2(); } + + /** + * Compute a spherical harmonic sum with two correction terms. + * + * @param[in] tau1 multiplier for correction coefficients \e C' and \e S'. + * @param[in] tau2 multiplier for correction coefficients \e C'' and \e S''. + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @return \e V the spherical harmonic sum. + * + * This routine requires constant memory and thus never throws an + * exception. + **********************************************************************/ + double HarmonicSum(double tau1, double tau2, double x, double y, double z); + + /** + * Compute a spherical harmonic sum with two correction terms and its + * gradient. + * + * @param[in] tau1 multiplier for correction coefficients \e C' and \e S'. + * @param[in] tau2 multiplier for correction coefficients \e C'' and \e S''. + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @param[out] gradx \e x component of the gradient + * @param[out] grady \e y component of the gradient + * @param[out] gradz \e z component of the gradient + * @return \e V the spherical harmonic sum. + * + * This is the same as the previous function, except that the components of + * the gradients of the sum in the \e x, \e y, and \e z directions are + * computed. This routine requires constant memory and thus never throws + * an exception. + **********************************************************************/ + double HarmonicSum(double tau1, double tau2, double x, double y, double z, + [System::Runtime::InteropServices::Out] double% gradx, + [System::Runtime::InteropServices::Out] double% grady, + [System::Runtime::InteropServices::Out] double% gradz); + + /** + * Create a CircularEngine to allow the efficient evaluation of several + * points on a circle of latitude at fixed values of \e tau1 and \e tau2. + * + * @param[in] tau1 multiplier for correction coefficients \e C' and \e S'. + * @param[in] tau2 multiplier for correction coefficients \e C'' and \e S''. + * @param[in] p the radius of the circle. + * @param[in] z the height of the circle above the equatorial plane. + * @param[in] gradp if true the returned object will be able to compute the + * gradient of the sum. + * @exception std::bad_alloc if the memory for the CircularEngine can't be + * allocated. + * @return the CircularEngine object. + * + * SphericalHarmonic2::operator()() exchanges the order of the sums in the + * definition, i.e., ∑n = 0..Nm = 0..n + * becomes ∑m = 0..Nn = m..N.. + * SphericalHarmonic2::Circle performs the inner sum over degree \e n + * (which entails about N2 operations). Calling + * CircularEngine::operator()() on the returned object performs the outer + * sum over the order \e m (about \e N operations). + * + * See SphericalHarmonic::Circle for an example of its use. + **********************************************************************/ + CircularEngine^ Circle(double tau1, double tau2, double p, double z, bool gradp); + + /** + * @return the zeroth SphericalCoefficients object. + **********************************************************************/ + SphericalCoefficients^ Coefficients(); + /** + * @return the first SphericalCoefficients object. + **********************************************************************/ + SphericalCoefficients^ Coefficients1(); + /** + * @return the second SphericalCoefficients object. + **********************************************************************/ + SphericalCoefficients^ Coefficients2(); + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercator.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercator.cpp new file mode 100644 index 000000000..ea559bc66 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercator.cpp @@ -0,0 +1,123 @@ +/** + * \file NETGeographicLib/TransverseMercator.cpp + * \brief Implementation for NETGeographicLib::TransverseMercator class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/TransverseMercator.hpp" +#include "TransverseMercator.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::TransverseMercator"; + +//***************************************************************************** +TransverseMercator::!TransverseMercator(void) +{ + if ( m_pTransverseMercator != NULL ) + { + delete m_pTransverseMercator; + m_pTransverseMercator = NULL; + } +} + +//***************************************************************************** +TransverseMercator::TransverseMercator(double a, double f, double k0) +{ + try + { + m_pTransverseMercator = new GeographicLib::TransverseMercator( a, f, k0 ); + } + catch (std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch (std::exception err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +TransverseMercator::TransverseMercator() +{ + try + { + m_pTransverseMercator = new GeographicLib::TransverseMercator( + GeographicLib::TransverseMercator::UTM ); + } + catch (std::bad_alloc ) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void TransverseMercator::Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double lx, ly, lgamma, lk; + m_pTransverseMercator->Forward( lon0, lat, lon, lx, ly, lgamma, lk ); + x = lx; + y = ly; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void TransverseMercator::Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double llat, llon, lgamma, lk; + m_pTransverseMercator->Reverse( lon0, x, y, llat, llon, lgamma, lk ); + lat = llat; + lon = llon; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void TransverseMercator::Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y) +{ + double lx, ly; + m_pTransverseMercator->Forward( lon0, lat, lon, lx, ly ); + x = lx; + y = ly; +} + +//***************************************************************************** +void TransverseMercator::Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon; + m_pTransverseMercator->Reverse( lon0, x, y, llat, llon ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double TransverseMercator::MajorRadius::get() +{ return m_pTransverseMercator->MajorRadius(); } + +//***************************************************************************** +double TransverseMercator::Flattening::get() +{ return m_pTransverseMercator->Flattening(); } + +//***************************************************************************** +double TransverseMercator::CentralScale::get() +{ return m_pTransverseMercator->CentralScale(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercator.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercator.h new file mode 100644 index 000000000..a18147c1e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercator.h @@ -0,0 +1,188 @@ +#pragma once +/** + * \file NETGeographicLib/TransverseMercator.h + * \brief Header for NETGeographicLib::TransverseMercator class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::TransverseMercator. + * + * This class allows .NET applications to access GeographicLib::TransverseMercator. + * + * This uses Krüger's method which evaluates the projection and its + * inverse in terms of a series. See + * - L. Krüger, + * Konforme + * Abbildung des Erdellipsoids in der Ebene (Conformal mapping of the + * ellipsoidal earth to the plane), Royal Prussian Geodetic Institute, New + * Series 52, 172 pp. (1912). + * - C. F. F. Karney, + * + * Transverse Mercator with an accuracy of a few nanometers, + * J. Geodesy 85(8), 475--485 (Aug. 2011); + * preprint + * arXiv:1002.1417. + * + * Krüger's method has been extended from 4th to 6th order. The maximum + * error is 5 nm (5 nanometers), ground distance, for all positions within 35 + * degrees of the central meridian. The error in the convergence is 2 + * × 10−15" and the relative error in the scale + * is 6 − 10−12%%. See Sec. 4 of + * arXiv:1002.1417 for details. + * The speed penalty in going to 6th order is only about 1%. + * TransverseMercatorExact is an alternative implementation of the projection + * using exact formulas which yield accurate (to 8 nm) results over the + * entire ellipsoid. + * + * The ellipsoid parameters and the central scale are set in the constructor. + * The central meridian (which is a trivial shift of the longitude) is + * specified as the \e lon0 argument of the TransverseMercator::Forward and + * TransverseMercator::Reverse functions. The latitude of origin is taken to + * be the equator. There is no provision in this class for specifying a + * false easting or false northing or a different latitude of origin. + * However these are can be simply included by the calling function. For + * example, the UTMUPS class applies the false easting and false northing for + * the UTM projections. A more complicated example is the British National + * Grid ( + * EPSG:7405) which requires the use of a latitude of origin. This is + * implemented by the GeographicLib::OSGB class. + * + * See GeographicLib::TransverseMercator.cpp for more information on the + * implementation. + * + * See \ref transversemercator for a discussion of this projection. + * + * C# Example: + * \include example-TransverseMercator.cs + * Managed C++ Example: + * \include example-TransverseMercator.cpp + * Visual Basic Example: + * \include example-TransverseMercator.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor is provided that assumes WGS84 parameters and + * a UTM scale factor. + * + * The MajorRadius, Flattening, and CentralScale functions are + * implemented as properties. + **********************************************************************/ + public ref class TransverseMercator + { + private: + // pointer to the unmanaged GeographicLib::TransverseMercator. + const GeographicLib::TransverseMercator* m_pTransverseMercator; + // the finalizer frees the unmanaged memory when the object is destroyed. + !TransverseMercator(void); + public: + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] k0 central scale factor. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k0 is + * not positive. + **********************************************************************/ + TransverseMercator(double a, double f, double k0); + + /** + * The default constructor assumes a WGS84 ellipsoid and a UTM scale + * factor. + **********************************************************************/ + TransverseMercator(); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~TransverseMercator() + { this->!TransverseMercator(); } + + /** + * Forward projection, from geographic to transverse Mercator. + * + * @param[in] lon0 central meridian of the projection (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lat should be in the range + * [−90°, 90°]; \e lon and \e lon0 should be in the + * range [−540°, 540°). + **********************************************************************/ + void Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * Reverse projection, from transverse Mercator to geographic. + * + * @param[in] lon0 central meridian of the projection (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lon0 should be in the range + * [−540°, 540°). The value of \e lon returned is in + * the range [−180°, 180°). + **********************************************************************/ + void Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * TransverseMercator::Forward without returning the convergence and scale. + **********************************************************************/ + void Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * TransverseMercator::Reverse without returning the convergence and scale. + **********************************************************************/ + void Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value used in + * the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return \e k0 central scale for the projection. This is the value of \e + * k0 used in the constructor and is the scale on the central meridian. + **********************************************************************/ + property double CentralScale { double get(); } + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercatorExact.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercatorExact.cpp new file mode 100644 index 000000000..733c6d120 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercatorExact.cpp @@ -0,0 +1,128 @@ +/** + * \file NETGeographicLib/TransverseMercatorExact.cpp + * \brief Implementation for NETGeographicLib::TransverseMercatorExact class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/TransverseMercatorExact.hpp" +#include "TransverseMercatorExact.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +const char BADALLOC[] = "Unable to allocate memory for a GeographicLib::TransverseMercatorExact"; + +//***************************************************************************** +TransverseMercatorExact::!TransverseMercatorExact(void) +{ + if ( m_pTransverseMercatorExact != NULL ) + { + delete m_pTransverseMercatorExact; + m_pTransverseMercatorExact = NULL; + } +} + +//***************************************************************************** +TransverseMercatorExact::TransverseMercatorExact(double a, double f, double k0, + bool extendp) +{ + try + { + m_pTransverseMercatorExact = new GeographicLib::TransverseMercatorExact( + a, f, k0, extendp ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } + catch ( std::exception err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +TransverseMercatorExact::TransverseMercatorExact() +{ + try + { + m_pTransverseMercatorExact = + new GeographicLib::TransverseMercatorExact( + GeographicLib::TransverseMercatorExact::UTM ); + } + catch (std::bad_alloc) + { + throw gcnew GeographicErr( BADALLOC ); + } +} + +//***************************************************************************** +void TransverseMercatorExact::Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double lx, ly, lgamma, lk; + m_pTransverseMercatorExact->Forward( lon0, lat, lon, lx, ly, + lgamma, lk ); + x = lx; + y = ly; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void TransverseMercatorExact::Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k) +{ + double llat, llon, lgamma, lk; + m_pTransverseMercatorExact->Reverse( lon0, x, y, llat, llon, + lgamma, lk ); + lat = llat; + lon = llon; + gamma = lgamma; + k = lk; +} + +//***************************************************************************** +void TransverseMercatorExact::Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y) +{ + double lx, ly; + m_pTransverseMercatorExact->Forward( lon0, lat, lon, lx, ly ); + x = lx; + y = ly; +} + +//***************************************************************************** +void TransverseMercatorExact::Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon) +{ + double llat, llon; + m_pTransverseMercatorExact->Reverse( lon0, x, y, llat, llon ); + lat = llat; + lon = llon; +} + +//***************************************************************************** +double TransverseMercatorExact::MajorRadius::get() +{ return m_pTransverseMercatorExact->MajorRadius(); } + +//***************************************************************************** +double TransverseMercatorExact::Flattening::get() +{ return m_pTransverseMercatorExact->Flattening(); } + +//***************************************************************************** +double TransverseMercatorExact::CentralScale::get() +{ return m_pTransverseMercatorExact->CentralScale(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercatorExact.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercatorExact.h new file mode 100644 index 000000000..26ebe58e8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/TransverseMercatorExact.h @@ -0,0 +1,236 @@ +#pragma once +/** + * \file NETGeographicLib/TransverseMercatorExact.h + * \brief Header for NETGeographicLib::TransverseMercatorExact class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::TransverseMercatorExact. + * + * This class allows .NET applications to access GeographicLib::TransverseMercatorExact. + * + * Implementation of the Transverse Mercator Projection given in + * - L. P. Lee, + * Conformal + * Projections Based On Jacobian Elliptic Functions, Part V of + * Conformal Projections Based on Elliptic Functions, + * (B. V. Gutsell, Toronto, 1976), 128pp., + * ISBN: 0919870163 + * (also appeared as: + * Monograph 16, Suppl. No. 1 to Canadian Cartographer, Vol 13). + * - C. F. F. Karney, + * + * Transverse Mercator with an accuracy of a few nanometers, + * J. Geodesy 85(8), 475--485 (Aug. 2011); + * preprint + * arXiv:1002.1417. + * + * Lee gives the correct results for forward and reverse transformations + * subject to the branch cut rules (see the description of the \e extendp + * argument to the constructor). The maximum error is about 8 nm (8 + * nanometers), ground distance, for the forward and reverse transformations. + * The error in the convergence is 2 × 10−15", + * the relative error in the scale is 7 × 10−12%%. + * See Sec. 3 of + * arXiv:1002.1417 for details. + * The method is "exact" in the sense that the errors are close to the + * round-off limit and that no changes are needed in the algorithms for them + * to be used with reals of a higher precision. Thus the errors using long + * double (with a 64-bit fraction) are about 2000 times smaller than using + * double (with a 53-bit fraction). + * + * This algorithm is about 4.5 times slower than the 6th-order Krüger + * method, TransverseMercator, taking about 11 us for a combined forward and + * reverse projection on a 2.66 GHz Intel machine (g++, version 4.3.0, -O3). + * + * The ellipsoid parameters and the central scale are set in the constructor. + * The central meridian (which is a trivial shift of the longitude) is + * specified as the \e lon0 argument of the TransverseMercatorExact::Forward + * and TransverseMercatorExact::Reverse functions. The latitude of origin is + * taken to be the equator. See the documentation on TransverseMercator for + * how to include a false easting, false northing, or a latitude of origin. + * + * See tm-grid.kmz, for an + * illustration of the transverse Mercator grid in Google Earth. + * + * See GeographicLib::TransverseMercatorExact.cpp for more information on the + * implementation. + * + * See \ref transversemercator for a discussion of this projection. + * + * C# Example: + * \include example-TransverseMercatorExact.cs + * Managed C++ Example: + * \include example-TransverseMercatorExact.cpp + * Visual Basic Example: + * \include example-TransverseMercatorExact.vb + * + * INTERFACE DIFFERENCES:
+ * A default constructor is provided that assumes WGS84 parameters and + * a UTM scale factor. + * + * The MajorRadius, Flattening, and CentralScale functions are + * implemented as properties. + **********************************************************************/ + public ref class TransverseMercatorExact + { + private: + // a pointer to the unmanaged GeographicLib::TransverseMercatorExact. + GeographicLib::TransverseMercatorExact* m_pTransverseMercatorExact; + // the finalizer frees the unmanaged memory when the object is destroyed. + !TransverseMercatorExact(void); + public: + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] k0 central scale factor. + * @param[in] extendp use extended domain. + * @exception GeographicErr if \e a, \e f, or \e k0 is not positive. + * + * The transverse Mercator projection has a branch point singularity at \e + * lat = 0 and \e lon − \e lon0 = 90 (1 − \e e) or (for + * TransverseMercatorExact::UTM) x = 18381 km, y = 0m. The \e extendp + * argument governs where the branch cut is placed. With \e extendp = + * false, the "standard" convention is followed, namely the cut is placed + * along \e x > 18381 km, \e y = 0m. Forward can be called with any \e lat + * and \e lon then produces the transformation shown in Lee, Fig 46. + * Reverse analytically continues this in the ± \e x direction. As + * a consequence, Reverse may map multiple points to the same geographic + * location; for example, for TransverseMercatorExact::UTM, \e x = + * 22051449.037349 m, \e y = −7131237.022729 m and \e x = + * 29735142.378357 m, \e y = 4235043.607933 m both map to \e lat = + * −2°, \e lon = 88°. + * + * With \e extendp = true, the branch cut is moved to the lower left + * quadrant. The various symmetries of the transverse Mercator projection + * can be used to explore the projection on any sheet. In this mode the + * domains of \e lat, \e lon, \e x, and \e y are restricted to + * - the union of + * - \e lat in [0, 90] and \e lon − \e lon0 in [0, 90] + * - \e lat in (-90, 0] and \e lon − \e lon0 in [90 (1 − \e + e), 90] + * - the union of + * - x/(\e k0 \e a) in [0, ∞) and + * y/(\e k0 \e a) in [0, E(e2)] + * - x/(\e k0 \e a) in [K(1 − e2) − + * E(1 − e2), ∞) and y/(\e k0 \e + * a) in (−∞, 0] + * . + * See Sec. 5 of + * arXiv:1002.1417 for a full + * discussion of the treatment of the branch cut. + * + * The method will work for all ellipsoids used in terrestrial geodesy. + * The method cannot be applied directly to the case of a sphere (\e f = 0) + * because some the constants characterizing this method diverge in that + * limit, and in practice, \e f should be larger than about + * numeric_limits::epsilon(). However, TransverseMercator treats the + * sphere exactly. + **********************************************************************/ + TransverseMercatorExact(double a, double f, double k0, bool extendp ); + + /** + * The default constructor assumes a WGS84 ellipsoid and a UTM scale + * factor. + **********************************************************************/ + TransverseMercatorExact(); + + /** + * The destructor calls the finalizer. + **********************************************************************/ + ~TransverseMercatorExact() + { this->!TransverseMercatorExact(); } + + /** + * Forward projection, from geographic to transverse Mercator. + * + * @param[in] lon0 central meridian of the projection (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lat should be in the range + * [−90°, 90°]; \e lon and \e lon0 should be in the + * range [−540°, 540°). + **********************************************************************/ + void Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * Reverse projection, from transverse Mercator to geographic. + * + * @param[in] lon0 central meridian of the projection (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lon0 should be in the range + * [−540°, 540°). The value of \e lon returned is in + * the range [−180°, 180°). + **********************************************************************/ + void Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k); + + /** + * TransverseMercatorExact::Forward without returning the convergence and + * scale. + **********************************************************************/ + void Forward(double lon0, double lat, double lon, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y); + + /** + * TransverseMercatorExact::Reverse without returning the convergence and + * scale. + **********************************************************************/ + void Reverse(double lon0, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + property double MajorRadius { double get(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value used in + * the constructor. + **********************************************************************/ + property double Flattening { double get(); } + + /** + * @return \e k0 central scale for the projection. This is the value of \e + * k0 used in the constructor and is the scale on the central meridian. + **********************************************************************/ + property double CentralScale { double get(); } + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/UTMUPS.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/UTMUPS.cpp new file mode 100644 index 000000000..307610cb8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/UTMUPS.cpp @@ -0,0 +1,215 @@ +/** + * \file NETGeographicLib/UTMUPS.cpp + * \brief Implementation for NETGeographicLib::UTMUPS class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +#include "stdafx.h" +#include "GeographicLib/UTMUPS.hpp" +#include "UTMUPS.h" +#include "NETGeographicLib.h" + +using namespace NETGeographicLib; + +//***************************************************************************** +int UTMUPS::StandardZone(double lat, double lon, int setzone) +{ + try + { + return GeographicLib::UTMUPS::StandardZone( lat, lon, setzone ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void UTMUPS::Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k, + int setzone, bool mgrslimits) +{ + try + { + int lzone; + bool lnorthp; + double lx, ly, lgamma, lk; + GeographicLib::UTMUPS::Forward(lat, lon, + lzone, lnorthp, lx, ly, + lgamma, lk, + setzone, mgrslimits); + zone = lzone; + northp = northp; + x = lx; + y = ly; + gamma = lgamma; + k = lk; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void UTMUPS::Reverse(int zone, bool northp, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k, + bool mgrslimits) +{ + try + { + double llat, llon, lgamma, lk; + GeographicLib::UTMUPS::Reverse( zone, northp, x, y, llat, llon, lgamma, + lk, mgrslimits ); + lat = llat; + lon = llon; + gamma = lgamma; + k = lk; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void UTMUPS::Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + int setzone, bool mgrslimits ) +{ + try + { + double gamma, k, lx, ly; + bool lnorthp; + int lzone; + GeographicLib::UTMUPS::Forward(lat, lon, lzone, lnorthp, lx, ly, + gamma, k, setzone, mgrslimits); + x = lx; + y = ly; + zone = lzone; + northp = lnorthp; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void UTMUPS::Reverse(int zone, bool northp, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + bool mgrslimits) +{ + try + { + double gamma, k, llat, llon; + GeographicLib::UTMUPS::Reverse(zone, northp, x, y, llat, llon, gamma, + k, mgrslimits); + lat = llat; + lon = llon; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void UTMUPS::Transfer(int zonein, bool northpin, double xin, double yin, + int zoneout, bool northpout, + [System::Runtime::InteropServices::Out] double% xout, + [System::Runtime::InteropServices::Out] double% yout, + [System::Runtime::InteropServices::Out] int% zone) +{ + try + { + int lzone; + double lxout, lyout; + GeographicLib::UTMUPS::Transfer(zonein, northpin, xin, yin, + zoneout, northpout, lxout, lyout, + lzone); + xout = lxout; + yout = lyout; + zone = lzone; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void UTMUPS::DecodeZone(System::String^ zonestr, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp) +{ + try + { + std::string zoneIn = StringConvert::ManagedToUnmanaged( zonestr ); + int lzone; + bool lnorthp; + GeographicLib::UTMUPS::DecodeZone( zoneIn, lzone, lnorthp ); + zone = lzone; + northp = lnorthp; + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +System::String^ UTMUPS::EncodeZone(int zone, bool northp) +{ + try + { + return StringConvert::UnmanagedToManaged( GeographicLib::UTMUPS::EncodeZone( zone, northp ) ); + } + catch ( const std::exception& err ) + { + throw gcnew GeographicErr( err.what() ); + } +} + +//***************************************************************************** +void UTMUPS::DecodeEPSG(int epsg, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp) +{ + int lzone; + bool lnorthp; + GeographicLib::UTMUPS::DecodeEPSG( epsg, lzone, lnorthp ); + zone = lzone; + northp = lnorthp; +} + +//***************************************************************************** +int UTMUPS::EncodeEPSG(int zone, bool northp) +{ + return GeographicLib::UTMUPS::EncodeEPSG( zone, northp ); +} + +//**************************************************************************** +double UTMUPS::UTMShift() { return GeographicLib::UTMUPS::UTMShift(); } + +//**************************************************************************** +double UTMUPS::MajorRadius() { return GeographicLib::UTMUPS::MajorRadius(); } + +//**************************************************************************** +double UTMUPS::Flattening() { return GeographicLib::UTMUPS::Flattening(); } diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/UTMUPS.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/UTMUPS.h new file mode 100644 index 000000000..4b9c7d257 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/UTMUPS.h @@ -0,0 +1,398 @@ +#pragma once +/** + * \file NETGeographicLib/UTMUPS.h + * \brief Header for NETGeographicLib::UTMUPS class + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +namespace NETGeographicLib +{ + /** + * \brief .NET wrapper for GeographicLib::UTMUPS. + * + * This class allows .NET applications to access GeographicLib::UTMUPS. + * + * UTM and UPS are defined + * - J. W. Hager, J. F. Behensky, and B. W. Drew, + * + * The Universal Grids: Universal Transverse Mercator (UTM) and Universal + * Polar Stereographic (UPS), Defense Mapping Agency, Technical Manual + * TM8358.2 (1989). + * . + * Section 2-3 defines UTM and section 3-2.4 defines UPS. This document also + * includes approximate algorithms for the computation of the underlying + * transverse Mercator and polar stereographic projections. Here we + * substitute much more accurate algorithms given by + * GeographicLib:TransverseMercator and GeographicLib:PolarStereographic. + * + * In this implementation, the conversions are closed, i.e., output from + * Forward is legal input for Reverse and vice versa. The error is about 5nm + * in each direction. However, the conversion from legal UTM/UPS coordinates + * to geographic coordinates and back might throw an error if the initial + * point is within 5nm of the edge of the allowed range for the UTM/UPS + * coordinates. + * + * The simplest way to guarantee the closed property is to define allowed + * ranges for the eastings and northings for UTM and UPS coordinates. The + * UTM boundaries are the same for all zones. (The only place the + * exceptional nature of the zone boundaries is evident is when converting to + * UTM/UPS coordinates requesting the standard zone.) The MGRS lettering + * scheme imposes natural limits on UTM/UPS coordinates which may be + * converted into MGRS coordinates. For the conversion to/from geographic + * coordinates these ranges have been extended by 100km in order to provide a + * generous overlap between UTM and UPS and between UTM zones. + * + * The NGA software package + * geotrans + * also provides conversions to and from UTM and UPS. Version 2.4.2 (and + * earlier) suffers from some drawbacks: + * - Inconsistent rules are used to determine the whether a particular UTM or + * UPS coordinate is legal. A more systematic approach is taken here. + * - The underlying projections are not very accurately implemented. + * + * C# Example: + * \include example-UTMUPS.cs + * Managed C++ Example: + * \include example-UTMUPS.cpp + * Visual Basic Example: + * \include example-UTMUPS.vb + * + **********************************************************************/ + public ref class UTMUPS + { + private: + // hide the constructor since all members of the class are static. + UTMUPS() {} + public: + /** + * In this class we bring together the UTM and UPS coordinates systems. + * The UTM divides the earth between latitudes −80° and 84° + * into 60 zones numbered 1 thru 60. Zone assign zone number 0 to the UPS + * regions, covering the two poles. Within UTMUPS, non-negative zone + * numbers refer to one of the "physical" zones, 0 for UPS and [1, 60] for + * UTM. Negative "pseudo-zone" numbers are used to select one of the + * physical zones. + **********************************************************************/ + enum class ZoneSpec { + /** + * The smallest pseudo-zone number. + **********************************************************************/ + MINPSEUDOZONE = -4, + /** + * A marker for an undefined or invalid zone. Equivalent to NaN. + **********************************************************************/ + INVALID = -4, + /** + * If a coordinate already include zone information (e.g., it is an MGRS + * coordinate), use that, otherwise apply the UTMUPS::STANDARD rules. + **********************************************************************/ + MATCH = -3, + /** + * Apply the standard rules for UTM zone assigment extending the UTM zone + * to each pole to give a zone number in [1, 60]. For example, use UTM + * zone 38 for longitude in [42°, 48°). The rules include the + * Norway and Svalbard exceptions. + **********************************************************************/ + UTM = -2, + /** + * Apply the standard rules for zone assignment to give a zone number in + * [0, 60]. If the latitude is not in [−80°, 84°), then + * use UTMUPS::UPS = 0, otherwise apply the rules for UTMUPS::UTM. The + * tests on latitudes and longitudes are all closed on the lower end open + * on the upper. Thus for UTM zone 38, latitude is in [−80°, + * 84°) and longitude is in [42°, 48°). + **********************************************************************/ + STANDARD = -1, + /** + * The largest pseudo-zone number. + **********************************************************************/ + MAXPSEUDOZONE = -1, + /** + * The smallest physical zone number. + **********************************************************************/ + MINZONE = 0, + /** + * The zone number used for UPS + **********************************************************************/ + UPS = 0, + /** + * The smallest UTM zone number. + **********************************************************************/ + MINUTMZONE = 1, + /** + * The largest UTM zone number. + **********************************************************************/ + MAXUTMZONE = 60, + /** + * The largest physical zone number. + **********************************************************************/ + MAXZONE = 60, + }; + + /** + * The standard zone. + * + * @param[in] lat latitude (degrees). + * @param[in] lon longitude (degrees). + * @param[in] setzone zone override (use ZoneSpec.STANDARD as default). If + * omitted, use the standard rules for picking the zone. If \e setzone + * is given then use that zone if it is non-negative, otherwise apply the + * rules given in UTMUPS::zonespec. + * @exception GeographicErr if \e setzone is outside the range + * [UTMUPS::MINPSEUDOZONE, UTMUPS::MAXZONE] = [−4, 60]. + * + * This is exact. + **********************************************************************/ + static int StandardZone(double lat, double lon, int setzone); + + /** + * Forward projection, from geographic to UTM/UPS. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] zone the UTM zone (zero means UPS). + * @param[out] northp hemisphere (true means north, false means south). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * @param[in] setzone zone override (use ZoneSpec.STANDARD as default). + * @param[in] mgrslimits if true enforce the stricter MGRS limits on the + * coordinates (default = false). + * @exception GeographicErr if \e lat is not in [−90°, + * 90°]. + * @exception GeographicErr if \e lon is not in [−540°, + * 540°). + * @exception GeographicErr if the resulting \e x or \e y is out of allowed + * range (see Reverse); in this case, these arguments are unchanged. + * + * If \e setzone is omitted, use the standard rules for picking the zone. + * If \e setzone is given then use that zone if it is non-negative, + * otherwise apply the rules given in UTMUPS::zonespec. The accuracy of + * the conversion is about 5nm. + * + * The northing \e y jumps by UTMUPS::UTMShift() when crossing the equator + * in the southerly direction. Sometimes it is useful to remove this + * discontinuity in \e y by extending the "northern" hemisphere using + * UTMUPS::Transfer: + * \code + double lat = -1, lon = 123; + int zone; + bool northp; + double x, y, gamma, k; + GeographicLib::UTMUPS::Forward(lat, lon, zone, northp, x, y, gamma, k); + GeographicLib::UTMUPS::Transfer(zone, northp, x, y, + zone, true, x, y, zone); + northp = true; + \endcode + **********************************************************************/ + static void Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k, + int setzone, bool mgrslimits); + + /** + * Reverse projection, from UTM/UPS to geographic. + * + * @param[in] zone the UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * @param[in] mgrslimits if true enforce the stricter MGRS limits on the + * coordinates (default = false). + * @exception GeographicErr if \e zone, \e x, or \e y is out of allowed + * range; this this case the arguments are unchanged. + * + * The accuracy of the conversion is about 5nm. + * + * UTM eastings are allowed to be in the range [0km, 1000km], northings are + * allowed to be in in [0km, 9600km] for the northern hemisphere and in + * [900km, 10000km] for the southern hemisphere. However UTM northings + * can be continued across the equator. So the actual limits on the + * northings are [-9100km, 9600km] for the "northern" hemisphere and + * [900km, 19600km] for the "southern" hemisphere. + * + * UPS eastings and northings are allowed to be in the range [1200km, + * 2800km] in the northern hemisphere and in [700km, 3100km] in the + * southern hemisphere. + * + * These ranges are 100km larger than allowed for the conversions to MGRS. + * (100km is the maximum extra padding consistent with eastings remaining + * non-negative.) This allows generous overlaps between zones and UTM and + * UPS. If \e mgrslimits = true, then all the ranges are shrunk by 100km + * so that they agree with the stricter MGRS ranges. No checks are + * performed besides these (e.g., to limit the distance outside the + * standard zone boundaries). + **********************************************************************/ + static void Reverse(int zone, bool northp, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + [System::Runtime::InteropServices::Out] double% gamma, + [System::Runtime::InteropServices::Out] double% k, + bool mgrslimits); + + /** + * UTMUPS::Forward without returning convergence and scale. + **********************************************************************/ + static void Forward(double lat, double lon, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp, + [System::Runtime::InteropServices::Out] double% x, + [System::Runtime::InteropServices::Out] double% y, + int setzone, bool mgrslimits ); + + /** + * UTMUPS::Reverse without returning convergence and scale. + **********************************************************************/ + static void Reverse(int zone, bool northp, double x, double y, + [System::Runtime::InteropServices::Out] double% lat, + [System::Runtime::InteropServices::Out] double% lon, + bool mgrslimits); + + /** + * Transfer UTM/UPS coordinated from one zone to another. + * + * @param[in] zonein the UTM zone for \e xin and \e yin (or zero for UPS). + * @param[in] northpin hemisphere for \e xin and \e yin (true means north, + * false means south). + * @param[in] xin easting of point (meters) in \e zonein. + * @param[in] yin northing of point (meters) in \e zonein. + * @param[in] zoneout the requested UTM zone for \e xout and \e yout (or + * zero for UPS). + * @param[in] northpout hemisphere for \e xout output and \e yout. + * @param[out] xout easting of point (meters) in \e zoneout. + * @param[out] yout northing of point (meters) in \e zoneout. + * @param[out] zone the actual UTM zone for \e xout and \e yout (or zero + * for UPS); this equals \e zoneout if \e zoneout ≥ 0. + * @exception GeographicErr if \e zonein is out of range (see below). + * @exception GeographicErr if \e zoneout is out of range (see below). + * @exception GeographicErr if \e xin or \e yin fall outside their allowed + * ranges (see UTMUPS::Reverse). + * @exception GeographicErr if \e xout or \e yout fall outside their + * allowed ranges (see UTMUPS::Reverse). + * + * \e zonein must be in the range [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, + * 60] with \e zonein = UTMUPS::UPS, 0, indicating UPS. \e zonein may + * also be UTMUPS::INVALID. + * + * \e zoneout must be in the range [UTMUPS::MINPSEUDOZONE, UTMUPS::MAXZONE] + * = [-4, 60]. If \e zoneout < UTMUPS::MINZONE then the rules give in + * the documentation of UTMUPS::zonespec are applied, and \e zone is set to + * the actual zone used for output. + * + * (\e xout, \e yout) can overlap with (\e xin, \e yin). + **********************************************************************/ + static void Transfer(int zonein, bool northpin, double xin, double yin, + int zoneout, bool northpout, + [System::Runtime::InteropServices::Out] double% xout, + [System::Runtime::InteropServices::Out] double% yout, + [System::Runtime::InteropServices::Out] int% zone); + + /** + * Decode a UTM/UPS zone string. + * + * @param[in] zonestr string representation of zone and hemisphere. + * @param[out] zone the UTM zone (zero means UPS). + * @param[out] northp hemisphere (true means north, false means south). + * @exception GeographicErr if \e zonestr is malformed. + * + * For UTM, \e zonestr has the form of a zone number in the range + * [UTMUPS::MINUTMZONE, UTMUPS::MAXUTMZONE] = [1, 60] followed by a + * hemisphere letter, N or S. For UPS, it consists just of the hemisphere + * letter. The returned value of \e zone is UTMUPS::UPS = 0 for UPS. Note + * well that "38S" indicates the southern hemisphere of zone 38 and not + * latitude band S, [32, 40]. N, 01S, 2N, 38S are legal. 0N, 001S, 61N, + * 38P are illegal. INV is a special value for which the returned value of + * \e is UTMUPS::INVALID. + **********************************************************************/ + static void DecodeZone(System::String^ zonestr, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp); + + /** + * Encode a UTM/UPS zone string. + * + * @param[in] zone the UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @exception GeographicErr if \e zone is out of range (see below). + * @exception std::bad_alloc if memoy for the string can't be allocated. + * @return string representation of zone and hemisphere. + * + * \e zone must be in the range [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, + * 60] with \e zone = UTMUPS::UPS, 0, indicating UPS (but the resulting + * string does not contain "0"). \e zone may also be UTMUPS::INVALID, in + * which case the returned string is "INV". This reverses + * UTMUPS::DecodeZone. + **********************************************************************/ + static System::String^ EncodeZone(int zone, bool northp); + + /** + * Decode EPSG. + * + * @param[in] epsg the EPSG code. + * @param[out] zone the UTM zone (zero means UPS). + * @param[out] northp hemisphere (true means north, false means south). + * + * EPSG (European Petroleum Survery Group) codes are a way to refer to many + * different projections. DecodeEPSG decodes those refering to UTM or UPS + * projections for the WGS84 ellipsoid. If the code does not refer to one + * of these projections, \e zone is set to UTMUPS::INVALID. See + * http://spatialreference.org/ref/epsg/ + **********************************************************************/ + static void DecodeEPSG(int epsg, + [System::Runtime::InteropServices::Out] int% zone, + [System::Runtime::InteropServices::Out] bool% northp); + + /** + * Encode zone as EPSG. + * + * @param[in] zone the UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @return EPSG code (or -1 if \e zone is not in the range + * [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, 60]) + * + * Convert \e zone and \e northp to the corresponding EPSG (European + * Petroleum Survery Group) codes + **********************************************************************/ + static int EncodeEPSG(int zone, bool northp); + + /** + * @return shift (meters) necessary to align N and S halves of a UTM zone + * (107). + **********************************************************************/ + static double UTMShift(); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the WGS84 ellipsoid (meters). + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + static double MajorRadius(); + + /** + * @return \e f the flattening of the WGS84 ellipsoid. + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + static double Flattening(); + ///@} + }; +} // namespace NETGeographicLib diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/stdafx.cpp b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/stdafx.cpp new file mode 100644 index 000000000..78419bac7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/stdafx.cpp @@ -0,0 +1,5 @@ +// stdafx.cpp : source file that includes just the standard includes +// NETGeographic.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" diff --git a/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/stdafx.h b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/stdafx.h new file mode 100644 index 000000000..1d856f7ae --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/NETGeographicLib/stdafx.h @@ -0,0 +1,5 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#pragma once diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.Designer.cs new file mode 100644 index 000000000..5b1e8de0b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.Designer.cs @@ -0,0 +1,193 @@ +namespace Projections +{ + partial class AccumPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.m_inputTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.m_accumTtextBox = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.m_equalsCheckBox = new System.Windows.Forms.CheckBox(); + this.m_testTextBox = new System.Windows.Forms.TextBox(); + this.m_lessThanCheckBox = new System.Windows.Forms.CheckBox(); + this.m_greaterTanCheckBox = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(4, 8); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(31, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Input"; + // + // m_inputTextBox + // + this.m_inputTextBox.Location = new System.Drawing.Point(109, 4); + this.m_inputTextBox.Name = "m_inputTextBox"; + this.m_inputTextBox.Size = new System.Drawing.Size(202, 20); + this.m_inputTextBox.TabIndex = 1; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(4, 35); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(99, 13); + this.label2.TabIndex = 2; + this.label2.Text = "Accumulated Value"; + // + // m_accumTtextBox + // + this.m_accumTtextBox.Location = new System.Drawing.Point(109, 31); + this.m_accumTtextBox.Name = "m_accumTtextBox"; + this.m_accumTtextBox.ReadOnly = true; + this.m_accumTtextBox.Size = new System.Drawing.Size(202, 20); + this.m_accumTtextBox.TabIndex = 3; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(317, 3); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 4; + this.button1.Text = "Add"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnAdd); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(7, 64); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 5; + this.button2.Text = "Reset"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnReset); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(318, 30); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 6; + this.button3.Text = "Multiply"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.OnMultiply); + // + // button4 + // + this.button4.Location = new System.Drawing.Point(405, 32); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(75, 23); + this.button4.TabIndex = 7; + this.button4.Text = "Test"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.OnTest); + // + // m_equalsCheckBox + // + this.m_equalsCheckBox.AutoSize = true; + this.m_equalsCheckBox.Location = new System.Drawing.Point(405, 69); + this.m_equalsCheckBox.Name = "m_equalsCheckBox"; + this.m_equalsCheckBox.Size = new System.Drawing.Size(58, 17); + this.m_equalsCheckBox.TabIndex = 8; + this.m_equalsCheckBox.Text = "Equals"; + this.m_equalsCheckBox.UseVisualStyleBackColor = true; + // + // m_testTextBox + // + this.m_testTextBox.Location = new System.Drawing.Point(405, 4); + this.m_testTextBox.Name = "m_testTextBox"; + this.m_testTextBox.Size = new System.Drawing.Size(139, 20); + this.m_testTextBox.TabIndex = 10; + // + // m_lessThanCheckBox + // + this.m_lessThanCheckBox.AutoSize = true; + this.m_lessThanCheckBox.Location = new System.Drawing.Point(405, 93); + this.m_lessThanCheckBox.Name = "m_lessThanCheckBox"; + this.m_lessThanCheckBox.Size = new System.Drawing.Size(76, 17); + this.m_lessThanCheckBox.TabIndex = 11; + this.m_lessThanCheckBox.Text = "Less Than"; + this.m_lessThanCheckBox.UseVisualStyleBackColor = true; + // + // m_greaterTanCheckBox + // + this.m_greaterTanCheckBox.AutoSize = true; + this.m_greaterTanCheckBox.Location = new System.Drawing.Point(405, 117); + this.m_greaterTanCheckBox.Name = "m_greaterTanCheckBox"; + this.m_greaterTanCheckBox.Size = new System.Drawing.Size(86, 17); + this.m_greaterTanCheckBox.TabIndex = 12; + this.m_greaterTanCheckBox.Text = "GreaterThan"; + this.m_greaterTanCheckBox.UseVisualStyleBackColor = true; + // + // AccumPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.m_greaterTanCheckBox); + this.Controls.Add(this.m_lessThanCheckBox); + this.Controls.Add(this.m_testTextBox); + this.Controls.Add(this.m_equalsCheckBox); + this.Controls.Add(this.button4); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.m_accumTtextBox); + this.Controls.Add(this.label2); + this.Controls.Add(this.m_inputTextBox); + this.Controls.Add(this.label1); + this.Name = "AccumPanel"; + this.Size = new System.Drawing.Size(969, 353); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_inputTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox m_accumTtextBox; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.CheckBox m_equalsCheckBox; + private System.Windows.Forms.TextBox m_testTextBox; + private System.Windows.Forms.CheckBox m_lessThanCheckBox; + private System.Windows.Forms.CheckBox m_greaterTanCheckBox; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.cs new file mode 100644 index 000000000..045981222 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.cs @@ -0,0 +1,84 @@ +/** + * \file NETGeographicLib\AccumPanel.cs + * \brief NETGeographicLib.Accumulator example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class AccumPanel : UserControl + { + Accumulator m_accum = new Accumulator(); + + public AccumPanel() + { + InitializeComponent(); + OnReset(null, null); + + } + + private void OnAdd(object sender, EventArgs e) + { + try + { + double a = Double.Parse(m_inputTextBox.Text); + m_accum.Sum(a); + m_accumTtextBox.Text = m_accum.Result().ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnMultiply(object sender, EventArgs e) + { + try + { + int a = Int32.Parse(m_inputTextBox.Text); + m_accum.Multiply(a); + m_accumTtextBox.Text = m_accum.Result().ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + } + + private void OnReset(object sender, EventArgs e) + { + m_accum.Assign(0.0); + m_accumTtextBox.Text = m_accum.Result().ToString(); + } + + private void OnTest(object sender, EventArgs e) + { + try + { + double test = Double.Parse(m_testTextBox.Text); + m_equalsCheckBox.Checked = m_accum == test; + m_lessThanCheckBox.Checked = m_accum < test; + m_greaterTanCheckBox.Checked = m_accum > test; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.resx new file mode 100644 index 000000000..ed0aef934 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AccumPanel.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.Designer.cs new file mode 100644 index 000000000..af5ea9b6d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.Designer.cs @@ -0,0 +1,551 @@ +namespace Projections +{ + partial class AlbersPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.m_setButton = new System.Windows.Forms.Button(); + this.m_flatteningTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.m_originLatitudeTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.m_centralScaleTextBox = new System.Windows.Forms.TextBox(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.m_constructorComboBox = new System.Windows.Forms.ComboBox(); + this.m_azimuthalScaleTextBox = new System.Windows.Forms.TextBox(); + this.m_functionComboBox = new System.Windows.Forms.ComboBox(); + this.m_convertButton = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.m_scaleLabel = new System.Windows.Forms.Label(); + this.m_stdLatLabel = new System.Windows.Forms.Label(); + this.m_stdLat2Label = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.m_sinLat2Label = new System.Windows.Forms.Label(); + this.m_cosLat2Label = new System.Windows.Forms.Label(); + this.m_KTextBox = new System.Windows.Forms.TextBox(); + this.m_stdLat1TextBox = new System.Windows.Forms.TextBox(); + this.m_stdLat2TextBox = new System.Windows.Forms.TextBox(); + this.m_sinLat2TextBox = new System.Windows.Forms.TextBox(); + this.m_cosLat2TextBox = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_lon0TextBox = new System.Windows.Forms.TextBox(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_xTextBox = new System.Windows.Forms.TextBox(); + this.m_yTextBox = new System.Windows.Forms.TextBox(); + this.m_gammaTextBox = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.m_projectionComboBox = new System.Windows.Forms.ComboBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.m_setButton); + this.groupBox1.Controls.Add(this.m_flatteningTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.m_majorRadiusTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(146, 140); + this.groupBox1.TabIndex = 6; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Ellipsoid Parameters"; + // + // m_setButton + // + this.m_setButton.Location = new System.Drawing.Point(12, 109); + this.m_setButton.Name = "m_setButton"; + this.m_setButton.Size = new System.Drawing.Size(75, 23); + this.m_setButton.TabIndex = 4; + this.m_setButton.Text = "Set"; + this.m_toolTip.SetToolTip(this.m_setButton, "Set constructor inputs"); + this.m_setButton.UseVisualStyleBackColor = true; + this.m_setButton.Click += new System.EventHandler(this.OnSet); + // + // m_flatteningTextBox + // + this.m_flatteningTextBox.Location = new System.Drawing.Point(12, 83); + this.m_flatteningTextBox.Name = "m_flatteningTextBox"; + this.m_flatteningTextBox.Size = new System.Drawing.Size(125, 20); + this.m_flatteningTextBox.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(109, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Major Radius (meters)"; + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(12, 42); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(125, 20); + this.m_majorRadiusTextBox.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Flattening"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(165, 11); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(122, 13); + this.label3.TabIndex = 7; + this.label3.Text = "Origin Latitude (degrees)"; + // + // m_originLatitudeTextBox + // + this.m_originLatitudeTextBox.Location = new System.Drawing.Point(319, 7); + this.m_originLatitudeTextBox.Name = "m_originLatitudeTextBox"; + this.m_originLatitudeTextBox.ReadOnly = true; + this.m_originLatitudeTextBox.Size = new System.Drawing.Size(115, 20); + this.m_originLatitudeTextBox.TabIndex = 8; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(165, 38); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(70, 13); + this.label4.TabIndex = 9; + this.label4.Text = "Central Scale"; + // + // m_centralScaleTextBox + // + this.m_centralScaleTextBox.Location = new System.Drawing.Point(319, 34); + this.m_centralScaleTextBox.Name = "m_centralScaleTextBox"; + this.m_centralScaleTextBox.ReadOnly = true; + this.m_centralScaleTextBox.Size = new System.Drawing.Size(115, 20); + this.m_centralScaleTextBox.TabIndex = 10; + // + // m_constructorComboBox + // + this.m_constructorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_constructorComboBox.FormattingEnabled = true; + this.m_constructorComboBox.Location = new System.Drawing.Point(10, 170); + this.m_constructorComboBox.Name = "m_constructorComboBox"; + this.m_constructorComboBox.Size = new System.Drawing.Size(139, 21); + this.m_constructorComboBox.TabIndex = 18; + this.m_toolTip.SetToolTip(this.m_constructorComboBox, "Select constructor type"); + this.m_constructorComboBox.SelectedIndexChanged += new System.EventHandler(this.OnConstructorChanged); + // + // m_azimuthalScaleTextBox + // + this.m_azimuthalScaleTextBox.Location = new System.Drawing.Point(580, 169); + this.m_azimuthalScaleTextBox.Name = "m_azimuthalScaleTextBox"; + this.m_azimuthalScaleTextBox.ReadOnly = true; + this.m_azimuthalScaleTextBox.Size = new System.Drawing.Size(109, 20); + this.m_azimuthalScaleTextBox.TabIndex = 36; + this.m_toolTip.SetToolTip(this.m_azimuthalScaleTextBox, "Verifies interfaces"); + this.m_azimuthalScaleTextBox.Click += new System.EventHandler(this.OnValidate); + // + // m_functionComboBox + // + this.m_functionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_functionComboBox.FormattingEnabled = true; + this.m_functionComboBox.Items.AddRange(new object[] { + "Forward", + "Reverse"}); + this.m_functionComboBox.Location = new System.Drawing.Point(697, 34); + this.m_functionComboBox.Name = "m_functionComboBox"; + this.m_functionComboBox.Size = new System.Drawing.Size(75, 21); + this.m_functionComboBox.TabIndex = 38; + this.m_toolTip.SetToolTip(this.m_functionComboBox, "Select function"); + this.m_functionComboBox.SelectedIndexChanged += new System.EventHandler(this.OnFunction); + // + // m_convertButton + // + this.m_convertButton.Location = new System.Drawing.Point(697, 114); + this.m_convertButton.Name = "m_convertButton"; + this.m_convertButton.Size = new System.Drawing.Size(75, 23); + this.m_convertButton.TabIndex = 39; + this.m_convertButton.Text = "Convert"; + this.m_toolTip.SetToolTip(this.m_convertButton, "Executes the selected Function using the selected Projection"); + this.m_convertButton.UseVisualStyleBackColor = true; + this.m_convertButton.Click += new System.EventHandler(this.OnConvert); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(700, 168); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 40; + this.button2.Text = "Validate"; + this.m_toolTip.SetToolTip(this.button2, "Verifies interfaces"); + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnValidate); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(443, 38); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(92, 13); + this.label5.TabIndex = 11; + this.label5.Text = "Latitude (degrees)"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(443, 65); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(101, 13); + this.label6.TabIndex = 12; + this.label6.Text = "Longitude (degrees)"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(443, 92); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(54, 13); + this.label7.TabIndex = 13; + this.label7.Text = "X (meters)"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(443, 119); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(54, 13); + this.label8.TabIndex = 14; + this.label8.Text = "Y (meters)"; + // + // m_scaleLabel + // + this.m_scaleLabel.AutoSize = true; + this.m_scaleLabel.Location = new System.Drawing.Point(165, 65); + this.m_scaleLabel.Name = "m_scaleLabel"; + this.m_scaleLabel.Size = new System.Drawing.Size(50, 13); + this.m_scaleLabel.TabIndex = 15; + this.m_scaleLabel.Text = "Scale (K)"; + // + // m_stdLatLabel + // + this.m_stdLatLabel.AutoSize = true; + this.m_stdLatLabel.Location = new System.Drawing.Point(165, 92); + this.m_stdLatLabel.Name = "m_stdLatLabel"; + this.m_stdLatLabel.Size = new System.Drawing.Size(147, 13); + this.m_stdLatLabel.TabIndex = 16; + this.m_stdLatLabel.Text = "Standard Latitude 1 (degrees)"; + // + // m_stdLat2Label + // + this.m_stdLat2Label.AutoSize = true; + this.m_stdLat2Label.Location = new System.Drawing.Point(165, 119); + this.m_stdLat2Label.Name = "m_stdLat2Label"; + this.m_stdLat2Label.Size = new System.Drawing.Size(147, 13); + this.m_stdLat2Label.TabIndex = 17; + this.m_stdLat2Label.Text = "Standard Latitude 2 (degrees)"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(9, 150); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(61, 13); + this.label12.TabIndex = 19; + this.label12.Text = "Constructor"; + // + // m_sinLat2Label + // + this.m_sinLat2Label.AutoSize = true; + this.m_sinLat2Label.Location = new System.Drawing.Point(165, 146); + this.m_sinLat2Label.Name = "m_sinLat2Label"; + this.m_sinLat2Label.Size = new System.Drawing.Size(49, 13); + this.m_sinLat2Label.TabIndex = 20; + this.m_sinLat2Label.Text = "Sin(Lat2)"; + // + // m_cosLat2Label + // + this.m_cosLat2Label.AutoSize = true; + this.m_cosLat2Label.Location = new System.Drawing.Point(165, 173); + this.m_cosLat2Label.Name = "m_cosLat2Label"; + this.m_cosLat2Label.Size = new System.Drawing.Size(52, 13); + this.m_cosLat2Label.TabIndex = 21; + this.m_cosLat2Label.Text = "Cos(Lat2)"; + // + // m_KTextBox + // + this.m_KTextBox.Location = new System.Drawing.Point(319, 61); + this.m_KTextBox.Name = "m_KTextBox"; + this.m_KTextBox.Size = new System.Drawing.Size(115, 20); + this.m_KTextBox.TabIndex = 22; + // + // m_stdLat1TextBox + // + this.m_stdLat1TextBox.Location = new System.Drawing.Point(319, 88); + this.m_stdLat1TextBox.Name = "m_stdLat1TextBox"; + this.m_stdLat1TextBox.Size = new System.Drawing.Size(115, 20); + this.m_stdLat1TextBox.TabIndex = 23; + // + // m_stdLat2TextBox + // + this.m_stdLat2TextBox.Location = new System.Drawing.Point(319, 115); + this.m_stdLat2TextBox.Name = "m_stdLat2TextBox"; + this.m_stdLat2TextBox.Size = new System.Drawing.Size(115, 20); + this.m_stdLat2TextBox.TabIndex = 24; + // + // m_sinLat2TextBox + // + this.m_sinLat2TextBox.Location = new System.Drawing.Point(319, 142); + this.m_sinLat2TextBox.Name = "m_sinLat2TextBox"; + this.m_sinLat2TextBox.Size = new System.Drawing.Size(115, 20); + this.m_sinLat2TextBox.TabIndex = 25; + // + // m_cosLat2TextBox + // + this.m_cosLat2TextBox.Location = new System.Drawing.Point(319, 169); + this.m_cosLat2TextBox.Name = "m_cosLat2TextBox"; + this.m_cosLat2TextBox.Size = new System.Drawing.Size(115, 20); + this.m_cosLat2TextBox.TabIndex = 26; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(443, 11); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(131, 13); + this.label9.TabIndex = 27; + this.label9.Text = "Origin Longitude (degrees)"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(443, 146); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(90, 13); + this.label10.TabIndex = 28; + this.label10.Text = "Gamma (degrees)"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(443, 173); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(82, 13); + this.label11.TabIndex = 29; + this.label11.Text = "Azimuthal Scale"; + // + // m_lon0TextBox + // + this.m_lon0TextBox.Location = new System.Drawing.Point(580, 7); + this.m_lon0TextBox.Name = "m_lon0TextBox"; + this.m_lon0TextBox.Size = new System.Drawing.Size(109, 20); + this.m_lon0TextBox.TabIndex = 30; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(580, 34); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(109, 20); + this.m_latitudeTextBox.TabIndex = 31; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(580, 61); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(109, 20); + this.m_longitudeTextBox.TabIndex = 32; + // + // m_xTextBox + // + this.m_xTextBox.Location = new System.Drawing.Point(580, 88); + this.m_xTextBox.Name = "m_xTextBox"; + this.m_xTextBox.Size = new System.Drawing.Size(109, 20); + this.m_xTextBox.TabIndex = 33; + // + // m_yTextBox + // + this.m_yTextBox.Location = new System.Drawing.Point(580, 115); + this.m_yTextBox.Name = "m_yTextBox"; + this.m_yTextBox.Size = new System.Drawing.Size(109, 20); + this.m_yTextBox.TabIndex = 34; + // + // m_gammaTextBox + // + this.m_gammaTextBox.Location = new System.Drawing.Point(580, 142); + this.m_gammaTextBox.Name = "m_gammaTextBox"; + this.m_gammaTextBox.ReadOnly = true; + this.m_gammaTextBox.Size = new System.Drawing.Size(109, 20); + this.m_gammaTextBox.TabIndex = 35; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(697, 11); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(48, 13); + this.label13.TabIndex = 37; + this.label13.Text = "Function"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(697, 65); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(54, 13); + this.label14.TabIndex = 41; + this.label14.Text = "Projection"; + // + // m_projectionComboBox + // + this.m_projectionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_projectionComboBox.FormattingEnabled = true; + this.m_projectionComboBox.Items.AddRange(new object[] { + "Albers Equal Area", + "Lambert Conformal Conic", + "Transverse Mercator", + "Transverse Mercator Exact"}); + this.m_projectionComboBox.Location = new System.Drawing.Point(697, 88); + this.m_projectionComboBox.Name = "m_projectionComboBox"; + this.m_projectionComboBox.Size = new System.Drawing.Size(134, 21); + this.m_projectionComboBox.TabIndex = 42; + this.m_toolTip.SetToolTip(this.m_projectionComboBox, "Projection Type"); + this.m_projectionComboBox.SelectedIndexChanged += new System.EventHandler(this.OnProjection); + // + // AlbersPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.m_projectionComboBox); + this.Controls.Add(this.label14); + this.Controls.Add(this.button2); + this.Controls.Add(this.m_convertButton); + this.Controls.Add(this.m_functionComboBox); + this.Controls.Add(this.label13); + this.Controls.Add(this.m_azimuthalScaleTextBox); + this.Controls.Add(this.m_gammaTextBox); + this.Controls.Add(this.m_yTextBox); + this.Controls.Add(this.m_xTextBox); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.m_lon0TextBox); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.m_cosLat2TextBox); + this.Controls.Add(this.m_sinLat2TextBox); + this.Controls.Add(this.m_stdLat2TextBox); + this.Controls.Add(this.m_stdLat1TextBox); + this.Controls.Add(this.m_KTextBox); + this.Controls.Add(this.m_cosLat2Label); + this.Controls.Add(this.m_sinLat2Label); + this.Controls.Add(this.label12); + this.Controls.Add(this.m_constructorComboBox); + this.Controls.Add(this.m_stdLat2Label); + this.Controls.Add(this.m_stdLatLabel); + this.Controls.Add(this.m_scaleLabel); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.m_centralScaleTextBox); + this.Controls.Add(this.label4); + this.Controls.Add(this.m_originLatitudeTextBox); + this.Controls.Add(this.label3); + this.Controls.Add(this.groupBox1); + this.Name = "AlbersPanel"; + this.Size = new System.Drawing.Size(851, 248); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button m_setButton; + private System.Windows.Forms.TextBox m_flatteningTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox m_originLatitudeTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox m_centralScaleTextBox; + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label m_scaleLabel; + private System.Windows.Forms.Label m_stdLatLabel; + private System.Windows.Forms.Label m_stdLat2Label; + private System.Windows.Forms.ComboBox m_constructorComboBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label m_sinLat2Label; + private System.Windows.Forms.Label m_cosLat2Label; + private System.Windows.Forms.TextBox m_KTextBox; + private System.Windows.Forms.TextBox m_stdLat1TextBox; + private System.Windows.Forms.TextBox m_stdLat2TextBox; + private System.Windows.Forms.TextBox m_sinLat2TextBox; + private System.Windows.Forms.TextBox m_cosLat2TextBox; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox m_lon0TextBox; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.TextBox m_xTextBox; + private System.Windows.Forms.TextBox m_yTextBox; + private System.Windows.Forms.TextBox m_gammaTextBox; + private System.Windows.Forms.TextBox m_azimuthalScaleTextBox; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.ComboBox m_functionComboBox; + private System.Windows.Forms.Button m_convertButton; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.ComboBox m_projectionComboBox; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.cs new file mode 100644 index 000000000..db2384fc7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.cs @@ -0,0 +1,570 @@ +/** + * \file NETGeographicLib\AlbersPanel.cs + * \brief Example of various projections. + * + * NETGeographicLib.AlbersEqualArea, + * NETGeographicLib.LambertConformalConic, + * NETGeographicLib.TransverseMercator, + * and NETGeographicLib.TransverseMercatorExact example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class AlbersPanel : UserControl + { + enum ProjectionTypes + { + AlbersEqualArea = 0, + LambertConformalConic = 1, + TransverseMercator = 2, + TransverseMercatorExact = 3 + } + ProjectionTypes m_projection; + AlbersEqualArea m_albers = null; + LambertConformalConic m_lambert = null; + TransverseMercator m_trans = null; + TransverseMercatorExact m_transExact = null; + + public AlbersPanel() + { + InitializeComponent(); + m_projectionComboBox.SelectedIndex = 0; // this calls OnProjection and sets it to an AlbersEqualArea + m_constructorComboBox.SelectedIndex = 3; // this calls OnConstructorChanged + m_majorRadiusTextBox.Text = m_albers.MajorRadius.ToString(); + m_flatteningTextBox.Text = m_albers.Flattening.ToString(); + m_centralScaleTextBox.Text = m_albers.CentralScale.ToString(); + m_originLatitudeTextBox.Text = m_albers.OriginLatitude.ToString(); + m_functionComboBox.SelectedIndex = 0; // this calls OnFunction + } + + private void OnConstructorChanged(object sender, EventArgs e) + { + try + { + if (m_projectionComboBox.SelectedIndex > 1) + { + m_originLatitudeTextBox.ReadOnly = true; + m_originLatitudeTextBox.Text = "N/A"; + if (m_constructorComboBox.SelectedIndex == 0) + { + m_convertButton.Enabled = true; + m_setButton.Enabled = false; + m_majorRadiusTextBox.ReadOnly = true; + m_flatteningTextBox.ReadOnly = true; + m_scaleLabel.Hide(); + m_KTextBox.Hide(); + m_stdLatLabel.Hide(); + m_stdLat1TextBox.Hide(); + m_stdLat2Label.Hide(); + m_stdLat2TextBox.Hide(); + m_sinLat2Label.Hide(); + m_sinLat2TextBox.Hide(); + m_cosLat2Label.Hide(); + m_cosLat2TextBox.Hide(); + if (m_projection == ProjectionTypes.TransverseMercator) + { + m_trans = new TransverseMercator(); + m_centralScaleTextBox.Text = m_trans.CentralScale.ToString(); + } + else + { + m_transExact = new TransverseMercatorExact(); + m_centralScaleTextBox.Text = m_transExact.CentralScale.ToString(); + } + } + else + { + m_convertButton.Enabled = false; + m_setButton.Enabled = true; + m_majorRadiusTextBox.ReadOnly = false; + m_flatteningTextBox.ReadOnly = false; + m_scaleLabel.Show(); + m_KTextBox.Show(); + m_stdLatLabel.Hide(); + m_stdLat1TextBox.Hide(); + m_stdLat2Label.Hide(); + m_stdLat2TextBox.Hide(); + m_sinLat2Label.Hide(); + m_sinLat2TextBox.Hide(); + m_cosLat2Label.Hide(); + m_cosLat2TextBox.Hide(); + } + } + else + { + m_originLatitudeTextBox.ReadOnly = false; + switch (m_constructorComboBox.SelectedIndex) + { + case 0: + m_convertButton.Enabled = false; + m_setButton.Enabled = true; + m_majorRadiusTextBox.ReadOnly = false; + m_flatteningTextBox.ReadOnly = false; + m_scaleLabel.Show(); + m_KTextBox.Show(); + m_stdLatLabel.Show(); + m_stdLatLabel.Text = "Standard Latitude (degrees)"; + m_stdLat1TextBox.Show(); + m_stdLat2Label.Hide(); + m_stdLat2TextBox.Hide(); + m_sinLat2Label.Hide(); + m_sinLat2TextBox.Hide(); + m_cosLat2Label.Hide(); + m_cosLat2TextBox.Hide(); + break; + case 1: + m_convertButton.Enabled = false; + m_setButton.Enabled = true; + m_majorRadiusTextBox.ReadOnly = false; + m_flatteningTextBox.ReadOnly = false; + m_scaleLabel.Show(); + m_KTextBox.Show(); + m_stdLatLabel.Show(); + m_stdLatLabel.Text = "Standard Latitude 1 (degrees)"; + m_stdLat1TextBox.Show(); + m_stdLat2Label.Text = "Standard Latitude 2 (degrees)"; + m_stdLat2Label.Show(); + m_stdLat2TextBox.Show(); + m_sinLat2Label.Hide(); + m_sinLat2TextBox.Hide(); + m_cosLat2Label.Hide(); + m_cosLat2TextBox.Hide(); + break; + case 2: + m_convertButton.Enabled = false; + m_setButton.Enabled = true; + m_majorRadiusTextBox.ReadOnly = false; + m_flatteningTextBox.ReadOnly = false; + m_scaleLabel.Show(); + m_KTextBox.Show(); + m_stdLatLabel.Show(); + m_stdLatLabel.Text = "Sin(Lat1)"; + m_stdLat1TextBox.Show(); + m_stdLat2Label.Text = "Cos(Lat1)"; + m_stdLat2Label.Show(); + m_stdLat2TextBox.Show(); + m_sinLat2Label.Show(); + m_sinLat2TextBox.Show(); + m_cosLat2Label.Show(); + m_cosLat2TextBox.Show(); + break; + default: + m_convertButton.Enabled = true; + m_setButton.Enabled = false; + m_majorRadiusTextBox.ReadOnly = true; + m_flatteningTextBox.ReadOnly = true; + m_scaleLabel.Hide(); + m_KTextBox.Hide(); + m_stdLatLabel.Hide(); + m_stdLat1TextBox.Hide(); + m_stdLat2Label.Hide(); + m_stdLat2TextBox.Hide(); + m_sinLat2Label.Hide(); + m_sinLat2TextBox.Hide(); + m_cosLat2Label.Hide(); + m_cosLat2TextBox.Hide(); + break; + } + + if (m_projection == ProjectionTypes.AlbersEqualArea) + AlbersConstructorChanged(); + } + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void AlbersConstructorChanged() + { + switch (m_constructorComboBox.SelectedIndex) + { + case 3: + m_albers = new AlbersEqualArea(AlbersEqualArea.StandardTypes.CylindricalEqualArea); + break; + case 4: + m_albers = new AlbersEqualArea(AlbersEqualArea.StandardTypes.AzimuthalEqualAreaNorth); + break; + case 5: + m_albers = new AlbersEqualArea(AlbersEqualArea.StandardTypes.AzimuthalEqualAreaSouth); + break; + default: + break; + } + + if (m_constructorComboBox.SelectedIndex > 2) + { + m_majorRadiusTextBox.Text = m_albers.MajorRadius.ToString(); + m_flatteningTextBox.Text = m_albers.Flattening.ToString(); + m_centralScaleTextBox.Text = m_albers.CentralScale.ToString(); + m_originLatitudeTextBox.Text = m_albers.OriginLatitude.ToString(); + } + } + + private void OnSet(object sender, EventArgs e) + { + try + { + switch (m_projection) + { + case ProjectionTypes.AlbersEqualArea: + SetAlbers(); + break; + case ProjectionTypes.LambertConformalConic: + SetLambert(); + break; + case ProjectionTypes.TransverseMercator: + SetTransverse(); + break; + case ProjectionTypes.TransverseMercatorExact: + SetTransverseExact(); + break; + } + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + m_convertButton.Enabled = true; + } + + private void SetAlbers() + { + double s2, s3, s4; + double a = Double.Parse(m_majorRadiusTextBox.Text); + double f = Double.Parse(m_flatteningTextBox.Text); + double k = Double.Parse(m_KTextBox.Text); + double s1 = Double.Parse(m_stdLat1TextBox.Text); + switch (m_constructorComboBox.SelectedIndex) + { + case 0: + m_albers = new AlbersEqualArea(a, f, s1, k); + break; + case 1: + s2 = Double.Parse(m_stdLat2TextBox.Text); + m_albers = new AlbersEqualArea(a, f, s1, s2, k); + break; + case 2: + s2 = Double.Parse(m_stdLat2TextBox.Text); + s3 = Double.Parse(m_sinLat2TextBox.Text); + s4 = Double.Parse(m_cosLat2TextBox.Text); + m_albers = new AlbersEqualArea(a, f, s1, s2, s3, s4, k); + break; + default: + break; + } + m_centralScaleTextBox.Text = m_albers.CentralScale.ToString(); + m_originLatitudeTextBox.Text = m_albers.OriginLatitude.ToString(); + } + + private void SetLambert() + { + double s2, s3, s4; + double a = Double.Parse(m_majorRadiusTextBox.Text); + double f = Double.Parse(m_flatteningTextBox.Text); + double k = Double.Parse(m_KTextBox.Text); + double s1 = Double.Parse(m_stdLat1TextBox.Text); + switch (m_constructorComboBox.SelectedIndex) + { + case 0: + m_lambert = new LambertConformalConic(a, f, s1, k); + break; + case 1: + s2 = Double.Parse(m_stdLat2TextBox.Text); + m_lambert = new LambertConformalConic(a, f, s1, s2, k); + break; + case 2: + s2 = Double.Parse(m_stdLat2TextBox.Text); + s3 = Double.Parse(m_sinLat2TextBox.Text); + s4 = Double.Parse(m_cosLat2TextBox.Text); + m_lambert = new LambertConformalConic(a, f, s1, s2, s3, s4, k); + break; + default: + break; + } + m_centralScaleTextBox.Text = m_lambert.CentralScale.ToString(); + m_originLatitudeTextBox.Text = m_lambert.OriginLatitude.ToString(); + } + + private void SetTransverse() + { + switch (m_constructorComboBox.SelectedIndex) + { + case 1: + double a = Double.Parse(m_majorRadiusTextBox.Text); + double f = Double.Parse(m_flatteningTextBox.Text); + double k = Double.Parse(m_KTextBox.Text); + m_trans = new TransverseMercator(a, f, k); + break; + default: + break; + } + m_centralScaleTextBox.Text = m_trans.CentralScale.ToString(); + } + + private void SetTransverseExact() + { + switch (m_constructorComboBox.SelectedIndex) + { + case 1: + double a = Double.Parse(m_majorRadiusTextBox.Text); + double f = Double.Parse(m_flatteningTextBox.Text); + double k = Double.Parse(m_KTextBox.Text); + m_transExact = new TransverseMercatorExact(a, f, k, false); + break; + default: + break; + } + m_centralScaleTextBox.Text = m_transExact.CentralScale.ToString(); + } + + private void OnFunction(object sender, EventArgs e) + { + switch (m_functionComboBox.SelectedIndex) + { + case 0: + m_latitudeTextBox.ReadOnly = m_longitudeTextBox.ReadOnly = false; + m_xTextBox.ReadOnly = m_yTextBox.ReadOnly = true; + break; + case 1: + m_latitudeTextBox.ReadOnly = m_longitudeTextBox.ReadOnly = true; + m_xTextBox.ReadOnly = m_yTextBox.ReadOnly = false; + break; + } + } + + private void OnConvert(object sender, EventArgs e) + { + try + { + switch (m_projection) + { + case ProjectionTypes.AlbersEqualArea: + ConvertAlbers(); + break; + case ProjectionTypes.LambertConformalConic: + ConvertLambert(); + break; + case ProjectionTypes.TransverseMercator: + ConvertTransverse(); + break; + case ProjectionTypes.TransverseMercatorExact: + ConvertTransverseExact(); + break; + } + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ConvertAlbers() + { + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, gamma = 0.0, k = 0.0; + double lon0 = Double.Parse(m_lon0TextBox.Text); + switch (m_functionComboBox.SelectedIndex) + { + case 0: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + m_albers.Forward(lon0, lat, lon, out x, out y, out gamma, out k); + m_xTextBox.Text = x.ToString(); + m_yTextBox.Text = y.ToString(); + break; + case 1: + x = Double.Parse(m_xTextBox.Text); + y = Double.Parse(m_yTextBox.Text); + m_albers.Reverse(lon0, x, y, out lat, out lon, out gamma, out k); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + break; + } + m_gammaTextBox.Text = gamma.ToString(); + m_azimuthalScaleTextBox.Text = k.ToString(); + } + + private void ConvertLambert() + { + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, gamma = 0.0, k = 0.0; + double lon0 = Double.Parse(m_lon0TextBox.Text); + switch (m_functionComboBox.SelectedIndex) + { + case 0: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + m_lambert.Forward(lon0, lat, lon, out x, out y, out gamma, out k); + m_xTextBox.Text = x.ToString(); + m_yTextBox.Text = y.ToString(); + break; + case 1: + x = Double.Parse(m_xTextBox.Text); + y = Double.Parse(m_yTextBox.Text); + m_lambert.Reverse(lon0, x, y, out lat, out lon, out gamma, out k); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + break; + } + m_gammaTextBox.Text = gamma.ToString(); + m_azimuthalScaleTextBox.Text = k.ToString(); + } + + private void ConvertTransverse() + { + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, gamma = 0.0, k = 0.0; + double lon0 = Double.Parse(m_lon0TextBox.Text); + switch (m_functionComboBox.SelectedIndex) + { + case 0: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + m_trans.Forward(lon0, lat, lon, out x, out y, out gamma, out k); + m_xTextBox.Text = x.ToString(); + m_yTextBox.Text = y.ToString(); + break; + case 1: + x = Double.Parse(m_xTextBox.Text); + y = Double.Parse(m_yTextBox.Text); + m_trans.Reverse(lon0, x, y, out lat, out lon, out gamma, out k); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + break; + } + m_gammaTextBox.Text = gamma.ToString(); + m_azimuthalScaleTextBox.Text = k.ToString(); + } + + private void ConvertTransverseExact() + { + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, gamma = 0.0, k = 0.0; + double lon0 = Double.Parse(m_lon0TextBox.Text); + switch (m_functionComboBox.SelectedIndex) + { + case 0: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + m_transExact.Forward(lon0, lat, lon, out x, out y, out gamma, out k); + m_xTextBox.Text = x.ToString(); + m_yTextBox.Text = y.ToString(); + break; + case 1: + x = Double.Parse(m_xTextBox.Text); + y = Double.Parse(m_yTextBox.Text); + m_transExact.Reverse(lon0, x, y, out lat, out lon, out gamma, out k); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + break; + } + m_gammaTextBox.Text = gamma.ToString(); + m_azimuthalScaleTextBox.Text = k.ToString(); + } + + private void OnProjection(object sender, EventArgs e) + { + m_projection = (ProjectionTypes)m_projectionComboBox.SelectedIndex; + int save = m_constructorComboBox.SelectedIndex; + m_constructorComboBox.Items.Clear(); + if (m_projectionComboBox.SelectedIndex > 1) // TransverseMercator or TransverseMercatorExact + { + m_constructorComboBox.Items.Add("Default"); + m_constructorComboBox.Items.Add("Constructor #1"); + } + else + { + m_constructorComboBox.Items.Add("Constructor #1"); + m_constructorComboBox.Items.Add("Constructor #2"); + m_constructorComboBox.Items.Add("Constructor #3"); + if (m_projection == ProjectionTypes.AlbersEqualArea) + { + m_constructorComboBox.Items.Add("CylindricalEqualArea"); + m_constructorComboBox.Items.Add("AzimuthalEqualAreaNorth"); + m_constructorComboBox.Items.Add("AzimuthalEqualAreaSouth"); + } + } + // calls OnConstructor + m_constructorComboBox.SelectedIndex = m_constructorComboBox.Items.Count > save ? save : 0; + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + const double DEG_TO_RAD = 3.1415926535897932384626433832795 / 180.0; + AlbersEqualArea a = new AlbersEqualArea(AlbersEqualArea.StandardTypes.AzimuthalEqualAreaNorth); + a = new AlbersEqualArea(AlbersEqualArea.StandardTypes.AzimuthalEqualAreaSouth); + double radius = a.MajorRadius; + double f = a.Flattening; + a = new AlbersEqualArea(radius, f, 60.0, 1.0); + a = new AlbersEqualArea(radius, f, 60.0, 70.0, 1.0); + a = new AlbersEqualArea(radius, f, Math.Sin(88.0 * DEG_TO_RAD), Math.Cos(88.0 * DEG_TO_RAD), + Math.Sin(89.0*DEG_TO_RAD), Math.Cos(89.0*DEG_TO_RAD), 1.0); + a = new AlbersEqualArea(AlbersEqualArea.StandardTypes.CylindricalEqualArea); + double lon0 = 0.0, lat = 32.0, lon = -86.0, x, y, gamma, k, x1, y1; + a.Forward(lon0, lat, lon, out x, out y, out gamma, out k); + a.Forward(lon0, lat, lon, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in AlbersEqualArea.Forward"); + a.Reverse(lon0, x, y, out lat, out lon, out gamma, out k); + a.Reverse(lon0, x, y, out x1, out y1); + if (lat != x1 || lon != y1) + throw new Exception("Error in AlbersEqualArea.Reverse"); + LambertConformalConic b = new LambertConformalConic(radius, f, 60.0, 1.0); + b = new LambertConformalConic(radius, f, 60.0, 65.0, 1.0); + b = new LambertConformalConic(radius, f, Math.Sin(88.0 * DEG_TO_RAD), Math.Cos(88.0 * DEG_TO_RAD), + Math.Sin(89.0 * DEG_TO_RAD), Math.Cos(89.0 * DEG_TO_RAD), 1.0); + b = new LambertConformalConic(); + b.SetScale(60.0, 1.0); + b.Forward(-87.0, 32.0, -86.0, out x, out y, out gamma, out k); + b.Forward(-87.0, 32.0, -86.0, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in LambertConformalConic.Forward"); + b.Reverse(-87.0, x, y, out lat, out lon, out gamma, out k); + b.Reverse(-87.0, x, y, out x1, out y1, out gamma, out k); + if (lat != x1 || lon != y1) + throw new Exception("Error in LambertConformalConic.Reverse"); + TransverseMercator c = new TransverseMercator(radius, f, 1.0); + c = new TransverseMercator(); + c.Forward(-87.0, 32.0, -86.0, out x, out y, out gamma, out k); + c.Forward(-87.0, 32.0, -86.0, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in TransverseMercator.Forward"); + c.Reverse(-87.0, x, y, out lat, out lon, out gamma, out k); + c.Reverse(-87.0, x, y, out x1, out y1); + if (lat != x1 || lon != y1) + throw new Exception("Error in TransverseMercator.Reverse"); + TransverseMercatorExact d = new TransverseMercatorExact(radius, f, 1.0, false); + d = new TransverseMercatorExact(); + d.Forward(-87.0, 32.0, -86.0, out x, out y, out gamma, out k); + d.Forward(-87.0, 32.0, -86.0, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in TransverseMercatorExact.Forward"); + d.Reverse(-87.0, x, y, out lat, out lon, out gamma, out k); + d.Reverse(-87.0, x, y, out x1, out y1); + if (lat != x1 || lon != y1) + throw new Exception("Error in TransverseMercatorExact.Reverse"); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.resx new file mode 100644 index 000000000..3ec30e045 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/AlbersPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.Designer.cs new file mode 100644 index 000000000..a7029a527 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.Designer.cs @@ -0,0 +1,493 @@ +namespace Projections +{ + partial class EllipsoidPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.m_setButton = new System.Windows.Forms.Button(); + this.m_flatteningTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.m_minorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.m_quarterMeridianTextBox = new System.Windows.Forms.TextBox(); + this.m_areaTextBox = new System.Windows.Forms.TextBox(); + this.m_volumeTextBox = new System.Windows.Forms.TextBox(); + this.m_2ndFlatTextBox = new System.Windows.Forms.TextBox(); + this.m_3rdFlatTextBox = new System.Windows.Forms.TextBox(); + this.m_ecc2TextBox = new System.Windows.Forms.TextBox(); + this.m_2ecc2TextBox = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.m_phiTextBox = new System.Windows.Forms.TextBox(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.m_parametericLatTextBox = new System.Windows.Forms.TextBox(); + this.m_geocentricLatTextBox = new System.Windows.Forms.TextBox(); + this.m_rectifyingLatTextBox = new System.Windows.Forms.TextBox(); + this.m_authalicLatTextBox = new System.Windows.Forms.TextBox(); + this.m_conformalTextBox = new System.Windows.Forms.TextBox(); + this.m_isometricLatTextBox = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.m_setButton); + this.groupBox1.Controls.Add(this.m_flatteningTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.m_majorRadiusTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(146, 140); + this.groupBox1.TabIndex = 7; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Ellipsoid Parameters"; + // + // m_setButton + // + this.m_setButton.Location = new System.Drawing.Point(12, 107); + this.m_setButton.Name = "m_setButton"; + this.m_setButton.Size = new System.Drawing.Size(75, 23); + this.m_setButton.TabIndex = 4; + this.m_setButton.Text = "Set"; + this.m_toolTip.SetToolTip(this.m_setButton, "Sets ellipsoid parameters"); + this.m_setButton.UseVisualStyleBackColor = true; + this.m_setButton.Click += new System.EventHandler(this.OnSet); + // + // m_flatteningTextBox + // + this.m_flatteningTextBox.Location = new System.Drawing.Point(12, 83); + this.m_flatteningTextBox.Name = "m_flatteningTextBox"; + this.m_flatteningTextBox.Size = new System.Drawing.Size(125, 20); + this.m_flatteningTextBox.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(109, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Major Radius (meters)"; + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(12, 42); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(125, 20); + this.m_majorRadiusTextBox.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Flattening"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(159, 8); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(69, 13); + this.label3.TabIndex = 8; + this.label3.Text = "Minor Radius"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(159, 34); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(85, 13); + this.label4.TabIndex = 9; + this.label4.Text = "Quarter Meridian"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(159, 60); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(29, 13); + this.label5.TabIndex = 10; + this.label5.Text = "Area"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(159, 86); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(42, 13); + this.label6.TabIndex = 11; + this.label6.Text = "Volume"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(159, 112); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(74, 13); + this.label7.TabIndex = 12; + this.label7.Text = "2nd Flattening"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(159, 138); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(71, 13); + this.label8.TabIndex = 13; + this.label8.Text = "3rd Flattening"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(159, 164); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(74, 13); + this.label9.TabIndex = 14; + this.label9.Text = "Eccentricity^2"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(159, 190); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(94, 13); + this.label10.TabIndex = 15; + this.label10.Text = "2nd eccentricity^2"; + // + // m_minorRadiusTextBox + // + this.m_minorRadiusTextBox.Location = new System.Drawing.Point(259, 4); + this.m_minorRadiusTextBox.Name = "m_minorRadiusTextBox"; + this.m_minorRadiusTextBox.ReadOnly = true; + this.m_minorRadiusTextBox.Size = new System.Drawing.Size(134, 20); + this.m_minorRadiusTextBox.TabIndex = 16; + // + // m_quarterMeridianTextBox + // + this.m_quarterMeridianTextBox.Location = new System.Drawing.Point(259, 30); + this.m_quarterMeridianTextBox.Name = "m_quarterMeridianTextBox"; + this.m_quarterMeridianTextBox.ReadOnly = true; + this.m_quarterMeridianTextBox.Size = new System.Drawing.Size(134, 20); + this.m_quarterMeridianTextBox.TabIndex = 17; + // + // m_areaTextBox + // + this.m_areaTextBox.Location = new System.Drawing.Point(259, 56); + this.m_areaTextBox.Name = "m_areaTextBox"; + this.m_areaTextBox.ReadOnly = true; + this.m_areaTextBox.Size = new System.Drawing.Size(134, 20); + this.m_areaTextBox.TabIndex = 18; + // + // m_volumeTextBox + // + this.m_volumeTextBox.Location = new System.Drawing.Point(259, 82); + this.m_volumeTextBox.Name = "m_volumeTextBox"; + this.m_volumeTextBox.ReadOnly = true; + this.m_volumeTextBox.Size = new System.Drawing.Size(134, 20); + this.m_volumeTextBox.TabIndex = 19; + // + // m_2ndFlatTextBox + // + this.m_2ndFlatTextBox.Location = new System.Drawing.Point(259, 108); + this.m_2ndFlatTextBox.Name = "m_2ndFlatTextBox"; + this.m_2ndFlatTextBox.ReadOnly = true; + this.m_2ndFlatTextBox.Size = new System.Drawing.Size(134, 20); + this.m_2ndFlatTextBox.TabIndex = 20; + // + // m_3rdFlatTextBox + // + this.m_3rdFlatTextBox.Location = new System.Drawing.Point(259, 134); + this.m_3rdFlatTextBox.Name = "m_3rdFlatTextBox"; + this.m_3rdFlatTextBox.ReadOnly = true; + this.m_3rdFlatTextBox.Size = new System.Drawing.Size(134, 20); + this.m_3rdFlatTextBox.TabIndex = 21; + // + // m_ecc2TextBox + // + this.m_ecc2TextBox.Location = new System.Drawing.Point(259, 160); + this.m_ecc2TextBox.Name = "m_ecc2TextBox"; + this.m_ecc2TextBox.ReadOnly = true; + this.m_ecc2TextBox.Size = new System.Drawing.Size(134, 20); + this.m_ecc2TextBox.TabIndex = 22; + // + // m_2ecc2TextBox + // + this.m_2ecc2TextBox.Location = new System.Drawing.Point(259, 186); + this.m_2ecc2TextBox.Name = "m_2ecc2TextBox"; + this.m_2ecc2TextBox.ReadOnly = true; + this.m_2ecc2TextBox.Size = new System.Drawing.Size(134, 20); + this.m_2ecc2TextBox.TabIndex = 23; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(402, 8); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(22, 13); + this.label11.TabIndex = 24; + this.label11.Text = "Phi"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(402, 34); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(98, 13); + this.label12.TabIndex = 25; + this.label12.Text = "Parametric Latitude"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(402, 60); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(100, 13); + this.label13.TabIndex = 26; + this.label13.Text = "Geocentric Latitude"; + // + // m_phiTextBox + // + this.m_phiTextBox.Location = new System.Drawing.Point(512, 4); + this.m_phiTextBox.Name = "m_phiTextBox"; + this.m_phiTextBox.Size = new System.Drawing.Size(100, 20); + this.m_phiTextBox.TabIndex = 27; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(402, 86); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(95, 13); + this.label14.TabIndex = 28; + this.label14.Text = "Rectifying Latitude"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(402, 112); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(86, 13); + this.label15.TabIndex = 29; + this.label15.Text = "Authalic Latitude"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(402, 138); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(95, 13); + this.label16.TabIndex = 30; + this.label16.Text = "Conformal Latitude"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(402, 164); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(90, 13); + this.label17.TabIndex = 31; + this.label17.Text = "Isometric Latitude"; + // + // m_parametericLatTextBox + // + this.m_parametericLatTextBox.Location = new System.Drawing.Point(512, 30); + this.m_parametericLatTextBox.Name = "m_parametericLatTextBox"; + this.m_parametericLatTextBox.ReadOnly = true; + this.m_parametericLatTextBox.Size = new System.Drawing.Size(100, 20); + this.m_parametericLatTextBox.TabIndex = 32; + // + // m_geocentricLatTextBox + // + this.m_geocentricLatTextBox.Location = new System.Drawing.Point(512, 56); + this.m_geocentricLatTextBox.Name = "m_geocentricLatTextBox"; + this.m_geocentricLatTextBox.ReadOnly = true; + this.m_geocentricLatTextBox.Size = new System.Drawing.Size(100, 20); + this.m_geocentricLatTextBox.TabIndex = 33; + // + // m_rectifyingLatTextBox + // + this.m_rectifyingLatTextBox.Location = new System.Drawing.Point(512, 82); + this.m_rectifyingLatTextBox.Name = "m_rectifyingLatTextBox"; + this.m_rectifyingLatTextBox.ReadOnly = true; + this.m_rectifyingLatTextBox.Size = new System.Drawing.Size(100, 20); + this.m_rectifyingLatTextBox.TabIndex = 34; + // + // m_authalicLatTextBox + // + this.m_authalicLatTextBox.Location = new System.Drawing.Point(512, 108); + this.m_authalicLatTextBox.Name = "m_authalicLatTextBox"; + this.m_authalicLatTextBox.ReadOnly = true; + this.m_authalicLatTextBox.Size = new System.Drawing.Size(100, 20); + this.m_authalicLatTextBox.TabIndex = 35; + // + // m_conformalTextBox + // + this.m_conformalTextBox.Location = new System.Drawing.Point(512, 134); + this.m_conformalTextBox.Name = "m_conformalTextBox"; + this.m_conformalTextBox.ReadOnly = true; + this.m_conformalTextBox.Size = new System.Drawing.Size(100, 20); + this.m_conformalTextBox.TabIndex = 36; + // + // m_isometricLatTextBox + // + this.m_isometricLatTextBox.Location = new System.Drawing.Point(512, 160); + this.m_isometricLatTextBox.Name = "m_isometricLatTextBox"; + this.m_isometricLatTextBox.ReadOnly = true; + this.m_isometricLatTextBox.Size = new System.Drawing.Size(100, 20); + this.m_isometricLatTextBox.TabIndex = 37; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(435, 185); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(126, 23); + this.button1.TabIndex = 38; + this.button1.Text = "Calculate Latitudes"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnCalculateLatitudes); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(18, 150); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 39; + this.button2.Text = "Validate"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnValidate); + // + // EllipsoidPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.m_isometricLatTextBox); + this.Controls.Add(this.m_conformalTextBox); + this.Controls.Add(this.m_authalicLatTextBox); + this.Controls.Add(this.m_rectifyingLatTextBox); + this.Controls.Add(this.m_geocentricLatTextBox); + this.Controls.Add(this.m_parametericLatTextBox); + this.Controls.Add(this.label17); + this.Controls.Add(this.label16); + this.Controls.Add(this.label15); + this.Controls.Add(this.label14); + this.Controls.Add(this.m_phiTextBox); + this.Controls.Add(this.label13); + this.Controls.Add(this.label12); + this.Controls.Add(this.label11); + this.Controls.Add(this.m_2ecc2TextBox); + this.Controls.Add(this.m_ecc2TextBox); + this.Controls.Add(this.m_3rdFlatTextBox); + this.Controls.Add(this.m_2ndFlatTextBox); + this.Controls.Add(this.m_volumeTextBox); + this.Controls.Add(this.m_areaTextBox); + this.Controls.Add(this.m_quarterMeridianTextBox); + this.Controls.Add(this.m_minorRadiusTextBox); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.groupBox1); + this.Name = "EllipsoidPanel"; + this.Size = new System.Drawing.Size(798, 356); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button m_setButton; + private System.Windows.Forms.TextBox m_flatteningTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox m_minorRadiusTextBox; + private System.Windows.Forms.TextBox m_quarterMeridianTextBox; + private System.Windows.Forms.TextBox m_areaTextBox; + private System.Windows.Forms.TextBox m_volumeTextBox; + private System.Windows.Forms.TextBox m_2ndFlatTextBox; + private System.Windows.Forms.TextBox m_3rdFlatTextBox; + private System.Windows.Forms.TextBox m_ecc2TextBox; + private System.Windows.Forms.TextBox m_2ecc2TextBox; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.TextBox m_phiTextBox; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.TextBox m_parametericLatTextBox; + private System.Windows.Forms.TextBox m_geocentricLatTextBox; + private System.Windows.Forms.TextBox m_rectifyingLatTextBox; + private System.Windows.Forms.TextBox m_authalicLatTextBox; + private System.Windows.Forms.TextBox m_conformalTextBox; + private System.Windows.Forms.TextBox m_isometricLatTextBox; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.cs new file mode 100644 index 000000000..85372a863 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.cs @@ -0,0 +1,117 @@ +/** + * \file NETGeographicLib\EllipsoidPanel.cs + * \brief NETGeographicLib.Ellipsoid example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class EllipsoidPanel : UserControl + { + Ellipsoid m_ell = null; + public EllipsoidPanel() + { + InitializeComponent(); + m_ell = new Ellipsoid(); + m_majorRadiusTextBox.Text = m_ell.MajorRadius.ToString(); + m_flatteningTextBox.Text = m_ell.Flattening.ToString(); + + m_minorRadiusTextBox.Text = m_ell.MinorRadius.ToString(); + m_quarterMeridianTextBox.Text = m_ell.QuarterMeridian.ToString(); + m_areaTextBox.Text = m_ell.Area.ToString(); + m_volumeTextBox.Text = m_ell.Volume.ToString(); + m_2ndFlatTextBox.Text = m_ell.SecondFlattening.ToString(); + m_3rdFlatTextBox.Text = m_ell.ThirdFlattening.ToString(); + m_ecc2TextBox.Text = m_ell.EccentricitySq.ToString(); + m_2ecc2TextBox.Text = m_ell.SecondEccentricitySq.ToString(); + } + + private void OnSet(object sender, EventArgs e) + { + try + { + double a = Double.Parse(m_majorRadiusTextBox.Text); + double f = Double.Parse(m_flatteningTextBox.Text); + m_ell = new Ellipsoid(a, f); + + m_minorRadiusTextBox.Text = m_ell.MinorRadius.ToString(); + m_quarterMeridianTextBox.Text = m_ell.QuarterMeridian.ToString(); + m_areaTextBox.Text = m_ell.Area.ToString(); + m_volumeTextBox.Text = m_ell.Volume.ToString(); + m_2ndFlatTextBox.Text = m_ell.SecondFlattening.ToString(); + m_3rdFlatTextBox.Text = m_ell.ThirdFlattening.ToString(); + m_ecc2TextBox.Text = m_ell.EccentricitySq.ToString(); + m_2ecc2TextBox.Text = m_ell.SecondEccentricitySq.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnCalculateLatitudes(object sender, EventArgs e) + { + try + { + double phi = Double.Parse(m_phiTextBox.Text); + m_parametericLatTextBox.Text = m_ell.ParametricLatitude(phi).ToString(); + m_geocentricLatTextBox.Text = m_ell.GeocentricLatitude(phi).ToString(); + m_rectifyingLatTextBox.Text = m_ell.RectifyingLatitude(phi).ToString(); + m_authalicLatTextBox.Text = m_ell.AuthalicLatitude(phi).ToString(); + m_conformalTextBox.Text = m_ell.ConformalLatitude(phi).ToString(); + m_isometricLatTextBox.Text = m_ell.IsometricLatitude(phi).ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + Ellipsoid ee = new Ellipsoid(50000.0, .003); + ee = new Ellipsoid(); + ee.AuthalicLatitude(30.0); + ee.CircleHeight(30.0); + ee.CircleRadius(30.0); + ee.ConformalLatitude(30.0); + ee.GeocentricLatitude(30.0); + ee.InverseAuthalicLatitude(30.0); + ee.InverseConformalLatitude(30.0); + ee.InverseGeocentricLatitude(30.0); + ee.InverseIsometricLatitude(30.0); + ee.InverseParametricLatitude(30.0); + ee.InverseRectifyingLatitude(30.0); + ee.IsometricLatitude(30.0); + ee.MeridianDistance(30.0); + ee.MeridionalCurvatureRadius(30.0); + ee.NormalCurvatureRadius(30.0, 60.0); + ee.ParametricLatitude(30.0); + ee.RectifyingLatitude(30.0); + ee.TransverseCurvatureRadius(30.0); + + MessageBox.Show("no errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.resx new file mode 100644 index 000000000..3ec30e045 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipsoidPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.Designer.cs new file mode 100644 index 000000000..7952dfb6e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.Designer.cs @@ -0,0 +1,529 @@ +namespace Projections +{ + partial class EllipticPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.label4 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.m_k2TextBox = new System.Windows.Forms.TextBox(); + this.m_alpha2TextBox = new System.Windows.Forms.TextBox(); + this.m_kp2TextBox = new System.Windows.Forms.TextBox(); + this.m_alphap2TextBox = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.m_constructorComboBox = new System.Windows.Forms.ComboBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.m_KtextBox = new System.Windows.Forms.TextBox(); + this.m_EtextBox = new System.Windows.Forms.TextBox(); + this.m_DtextBox = new System.Windows.Forms.TextBox(); + this.m_KEtextBox = new System.Windows.Forms.TextBox(); + this.m_PItextBox = new System.Windows.Forms.TextBox(); + this.m_GtextBox = new System.Windows.Forms.TextBox(); + this.m_HtextBox = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.m_phiTextBox = new System.Windows.Forms.TextBox(); + this.m_EphiTextBox = new System.Windows.Forms.TextBox(); + this.m_DphiTextBox = new System.Windows.Forms.TextBox(); + this.m_FphiTextBox = new System.Windows.Forms.TextBox(); + this.m_PiphiTextBox = new System.Windows.Forms.TextBox(); + this.m_GphiTextBox = new System.Windows.Forms.TextBox(); + this.m_HphiTextBox = new System.Windows.Forms.TextBox(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(9, 11); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(19, 13); + this.label4.TabIndex = 0; + this.label4.Text = "k2"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(9, 37); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(39, 13); + this.label1.TabIndex = 1; + this.label1.Text = "alpha2"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(9, 63); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(25, 13); + this.label2.TabIndex = 2; + this.label2.Text = "kp2"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(9, 89); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(45, 13); + this.label3.TabIndex = 3; + this.label3.Text = "alphap2"; + // + // m_k2TextBox + // + this.m_k2TextBox.Location = new System.Drawing.Point(76, 7); + this.m_k2TextBox.Name = "m_k2TextBox"; + this.m_k2TextBox.Size = new System.Drawing.Size(100, 20); + this.m_k2TextBox.TabIndex = 4; + // + // m_alpha2TextBox + // + this.m_alpha2TextBox.Location = new System.Drawing.Point(76, 33); + this.m_alpha2TextBox.Name = "m_alpha2TextBox"; + this.m_alpha2TextBox.Size = new System.Drawing.Size(100, 20); + this.m_alpha2TextBox.TabIndex = 5; + // + // m_kp2TextBox + // + this.m_kp2TextBox.Location = new System.Drawing.Point(76, 59); + this.m_kp2TextBox.Name = "m_kp2TextBox"; + this.m_kp2TextBox.Size = new System.Drawing.Size(100, 20); + this.m_kp2TextBox.TabIndex = 6; + // + // m_alphap2TextBox + // + this.m_alphap2TextBox.Location = new System.Drawing.Point(76, 85); + this.m_alphap2TextBox.Name = "m_alphap2TextBox"; + this.m_alphap2TextBox.Size = new System.Drawing.Size(100, 20); + this.m_alphap2TextBox.TabIndex = 7; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(47, 141); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 8; + this.button1.Text = "Set"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnSet); + // + // m_constructorComboBox + // + this.m_constructorComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_constructorComboBox.FormattingEnabled = true; + this.m_constructorComboBox.Items.AddRange(new object[] { + "Constructor #1", + "Constructor #2"}); + this.m_constructorComboBox.Location = new System.Drawing.Point(76, 113); + this.m_constructorComboBox.Name = "m_constructorComboBox"; + this.m_constructorComboBox.Size = new System.Drawing.Size(100, 21); + this.m_constructorComboBox.TabIndex = 9; + this.m_toolTip.SetToolTip(this.m_constructorComboBox, "Selects the constructor"); + this.m_constructorComboBox.SelectedIndexChanged += new System.EventHandler(this.OnConstructor); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(9, 117); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(61, 13); + this.label5.TabIndex = 10; + this.label5.Text = "Constructor"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(186, 11); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(14, 13); + this.label6.TabIndex = 11; + this.label6.Text = "K"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(186, 37); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(14, 13); + this.label7.TabIndex = 12; + this.label7.Text = "E"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(186, 63); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(15, 13); + this.label8.TabIndex = 13; + this.label8.Text = "D"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(186, 89); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(21, 13); + this.label9.TabIndex = 14; + this.label9.Text = "KE"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(186, 113); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(16, 13); + this.label10.TabIndex = 15; + this.label10.Text = "Pi"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(186, 141); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(15, 13); + this.label11.TabIndex = 16; + this.label11.Text = "G"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(186, 168); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(15, 13); + this.label12.TabIndex = 17; + this.label12.Text = "H"; + // + // m_KtextBox + // + this.m_KtextBox.Location = new System.Drawing.Point(218, 7); + this.m_KtextBox.Name = "m_KtextBox"; + this.m_KtextBox.ReadOnly = true; + this.m_KtextBox.Size = new System.Drawing.Size(100, 20); + this.m_KtextBox.TabIndex = 18; + // + // m_EtextBox + // + this.m_EtextBox.Location = new System.Drawing.Point(218, 33); + this.m_EtextBox.Name = "m_EtextBox"; + this.m_EtextBox.ReadOnly = true; + this.m_EtextBox.Size = new System.Drawing.Size(100, 20); + this.m_EtextBox.TabIndex = 19; + // + // m_DtextBox + // + this.m_DtextBox.Location = new System.Drawing.Point(218, 59); + this.m_DtextBox.Name = "m_DtextBox"; + this.m_DtextBox.ReadOnly = true; + this.m_DtextBox.Size = new System.Drawing.Size(100, 20); + this.m_DtextBox.TabIndex = 20; + // + // m_KEtextBox + // + this.m_KEtextBox.Location = new System.Drawing.Point(218, 85); + this.m_KEtextBox.Name = "m_KEtextBox"; + this.m_KEtextBox.ReadOnly = true; + this.m_KEtextBox.Size = new System.Drawing.Size(100, 20); + this.m_KEtextBox.TabIndex = 21; + // + // m_PItextBox + // + this.m_PItextBox.Location = new System.Drawing.Point(218, 111); + this.m_PItextBox.Name = "m_PItextBox"; + this.m_PItextBox.ReadOnly = true; + this.m_PItextBox.Size = new System.Drawing.Size(100, 20); + this.m_PItextBox.TabIndex = 22; + // + // m_GtextBox + // + this.m_GtextBox.Location = new System.Drawing.Point(218, 137); + this.m_GtextBox.Name = "m_GtextBox"; + this.m_GtextBox.ReadOnly = true; + this.m_GtextBox.Size = new System.Drawing.Size(100, 20); + this.m_GtextBox.TabIndex = 23; + // + // m_HtextBox + // + this.m_HtextBox.Location = new System.Drawing.Point(218, 163); + this.m_HtextBox.Name = "m_HtextBox"; + this.m_HtextBox.ReadOnly = true; + this.m_HtextBox.Size = new System.Drawing.Size(100, 20); + this.m_HtextBox.TabIndex = 24; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(329, 11); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(21, 13); + this.label13.TabIndex = 25; + this.label13.Text = "phi"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(329, 37); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(34, 13); + this.label14.TabIndex = 26; + this.label14.Text = "E(phi)"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(329, 89); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(33, 13); + this.label15.TabIndex = 27; + this.label15.Text = "F(phi)"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(329, 63); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(35, 13); + this.label16.TabIndex = 28; + this.label16.Text = "D(phi)"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(329, 115); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(36, 13); + this.label17.TabIndex = 29; + this.label17.Text = "Pi(phi)"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(329, 141); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(35, 13); + this.label18.TabIndex = 30; + this.label18.Text = "G(phi)"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(329, 167); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(35, 13); + this.label19.TabIndex = 31; + this.label19.Text = "H(phi)"; + // + // m_phiTextBox + // + this.m_phiTextBox.Location = new System.Drawing.Point(371, 7); + this.m_phiTextBox.Name = "m_phiTextBox"; + this.m_phiTextBox.Size = new System.Drawing.Size(100, 20); + this.m_phiTextBox.TabIndex = 32; + // + // m_EphiTextBox + // + this.m_EphiTextBox.Location = new System.Drawing.Point(371, 33); + this.m_EphiTextBox.Name = "m_EphiTextBox"; + this.m_EphiTextBox.ReadOnly = true; + this.m_EphiTextBox.Size = new System.Drawing.Size(100, 20); + this.m_EphiTextBox.TabIndex = 33; + // + // m_DphiTextBox + // + this.m_DphiTextBox.Location = new System.Drawing.Point(372, 59); + this.m_DphiTextBox.Name = "m_DphiTextBox"; + this.m_DphiTextBox.ReadOnly = true; + this.m_DphiTextBox.Size = new System.Drawing.Size(100, 20); + this.m_DphiTextBox.TabIndex = 34; + // + // m_FphiTextBox + // + this.m_FphiTextBox.Location = new System.Drawing.Point(371, 85); + this.m_FphiTextBox.Name = "m_FphiTextBox"; + this.m_FphiTextBox.ReadOnly = true; + this.m_FphiTextBox.Size = new System.Drawing.Size(100, 20); + this.m_FphiTextBox.TabIndex = 35; + // + // m_PiphiTextBox + // + this.m_PiphiTextBox.Location = new System.Drawing.Point(371, 111); + this.m_PiphiTextBox.Name = "m_PiphiTextBox"; + this.m_PiphiTextBox.ReadOnly = true; + this.m_PiphiTextBox.Size = new System.Drawing.Size(100, 20); + this.m_PiphiTextBox.TabIndex = 36; + // + // m_GphiTextBox + // + this.m_GphiTextBox.Location = new System.Drawing.Point(371, 137); + this.m_GphiTextBox.Name = "m_GphiTextBox"; + this.m_GphiTextBox.ReadOnly = true; + this.m_GphiTextBox.Size = new System.Drawing.Size(100, 20); + this.m_GphiTextBox.TabIndex = 37; + // + // m_HphiTextBox + // + this.m_HphiTextBox.Location = new System.Drawing.Point(371, 163); + this.m_HphiTextBox.Name = "m_HphiTextBox"; + this.m_HphiTextBox.ReadOnly = true; + this.m_HphiTextBox.Size = new System.Drawing.Size(100, 20); + this.m_HphiTextBox.TabIndex = 38; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(332, 190); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(139, 23); + this.button2.TabIndex = 39; + this.button2.Text = "Calculate phi functions"; + this.m_toolTip.SetToolTip(this.button2, "Calculate all functions that use phi as an input"); + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnComputePhi); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(47, 168); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 40; + this.button3.Text = "Validate"; + this.m_toolTip.SetToolTip(this.button3, "Verifies Elliptic Function interfaces"); + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.OnValidate); + // + // EllipticPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.m_HphiTextBox); + this.Controls.Add(this.m_GphiTextBox); + this.Controls.Add(this.m_PiphiTextBox); + this.Controls.Add(this.m_FphiTextBox); + this.Controls.Add(this.m_DphiTextBox); + this.Controls.Add(this.m_EphiTextBox); + this.Controls.Add(this.m_phiTextBox); + this.Controls.Add(this.label19); + this.Controls.Add(this.label18); + this.Controls.Add(this.label17); + this.Controls.Add(this.label16); + this.Controls.Add(this.label15); + this.Controls.Add(this.label14); + this.Controls.Add(this.label13); + this.Controls.Add(this.m_HtextBox); + this.Controls.Add(this.m_GtextBox); + this.Controls.Add(this.m_PItextBox); + this.Controls.Add(this.m_KEtextBox); + this.Controls.Add(this.m_DtextBox); + this.Controls.Add(this.m_EtextBox); + this.Controls.Add(this.m_KtextBox); + this.Controls.Add(this.label12); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.m_constructorComboBox); + this.Controls.Add(this.button1); + this.Controls.Add(this.m_alphap2TextBox); + this.Controls.Add(this.m_kp2TextBox); + this.Controls.Add(this.m_alpha2TextBox); + this.Controls.Add(this.m_k2TextBox); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.label4); + this.Name = "EllipticPanel"; + this.Size = new System.Drawing.Size(764, 377); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox m_k2TextBox; + private System.Windows.Forms.TextBox m_alpha2TextBox; + private System.Windows.Forms.TextBox m_kp2TextBox; + private System.Windows.Forms.TextBox m_alphap2TextBox; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.ComboBox m_constructorComboBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.TextBox m_KtextBox; + private System.Windows.Forms.TextBox m_EtextBox; + private System.Windows.Forms.TextBox m_DtextBox; + private System.Windows.Forms.TextBox m_KEtextBox; + private System.Windows.Forms.TextBox m_PItextBox; + private System.Windows.Forms.TextBox m_GtextBox; + private System.Windows.Forms.TextBox m_HtextBox; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.TextBox m_phiTextBox; + private System.Windows.Forms.TextBox m_EphiTextBox; + private System.Windows.Forms.TextBox m_DphiTextBox; + private System.Windows.Forms.TextBox m_FphiTextBox; + private System.Windows.Forms.TextBox m_PiphiTextBox; + private System.Windows.Forms.TextBox m_GphiTextBox; + private System.Windows.Forms.TextBox m_HphiTextBox; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.cs new file mode 100644 index 000000000..715441a2d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.cs @@ -0,0 +1,136 @@ +/** + * \file NETGeographicLib\EllipticPanel.cs + * \brief NETGeographicLib.EllipticFunction example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class EllipticPanel : UserControl + { + EllipticFunction m_func = null; + + public EllipticPanel() + { + InitializeComponent(); + m_constructorComboBox.SelectedIndex = 0; + m_k2TextBox.Text = "0.5"; + m_alpha2TextBox.Text = "0.5"; + OnSet(null, null); + } + + private void OnSet(object sender, EventArgs e) + { + try + { + double k2 = Double.Parse(m_k2TextBox.Text); + double alpha2 = Double.Parse(m_alpha2TextBox.Text); + if (m_constructorComboBox.SelectedIndex == 0) + m_func = new EllipticFunction(k2, alpha2); + else + { + double kp2 = Double.Parse(m_kp2TextBox.Text); + double alphap2 = Double.Parse(m_alphap2TextBox.Text); + m_func = new EllipticFunction(k2, alpha2, kp2, alphap2); + } + m_KtextBox.Text = m_func.K().ToString(); + m_EtextBox.Text = m_func.E().ToString(); + m_DtextBox.Text = m_func.D().ToString(); + m_KEtextBox.Text = m_func.KE().ToString(); + m_PItextBox.Text = m_func.Pi().ToString(); + m_GtextBox.Text = m_func.G().ToString(); + m_HtextBox.Text = m_func.H().ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnConstructor(object sender, EventArgs e) + { + m_kp2TextBox.ReadOnly = m_alphap2TextBox.ReadOnly = m_constructorComboBox.SelectedIndex == 0; + } + + private void OnComputePhi(object sender, EventArgs e) + { + try + { + double phi = Double.Parse(m_phiTextBox.Text); + m_EphiTextBox.Text = m_func.E(phi).ToString(); + m_FphiTextBox.Text = m_func.F(phi).ToString(); + m_DphiTextBox.Text = m_func.D(phi).ToString(); + m_GphiTextBox.Text = m_func.G(phi).ToString(); + m_HphiTextBox.Text = m_func.H(phi).ToString(); + m_PiphiTextBox.Text = m_func.Pi(phi).ToString(); + } + catch ( Exception xcpt ) + { + MessageBox.Show( xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + double phi = 0.8; + EllipticFunction f = new EllipticFunction(0.3, 0.4, 0.7, 0.6); + f.Reset(0.2, 0.3, 0.8, 0.7); + f = new EllipticFunction(0.3, 0.4); + f.Reset(0.2, 0.3); + double cn, sn, dn; + f.sncndn(0.3, out sn, out cn, out dn); + f.Delta(sn, cn); + f.D(); + f.D(phi); + f.D(sn, cn, dn); + f.Pi(); + f.Pi(phi); + f.Pi(sn, cn, dn); + f.KE(); + f.K(); + f.H(); + f.H(phi); + f.H(sn, cn, dn); + f.G(); + f.G(phi); + f.G(sn, cn, dn); + f.F(phi); + f.F(sn, cn, dn); + f.Einv(0.75); + f.Ed(60.0); + f.E(); + f.E(phi); + f.E(sn, cn, dn); + double tau = 3.1415927 / 10.0; + f.deltaEinv(Math.Sin(tau), Math.Cos(tau)); + f.deltaD(sn, cn, dn); + f.deltaE(sn, cn, dn); + f.deltaF(sn, cn, dn); + f.deltaG(sn, cn, dn); + f.deltaH(sn, cn, dn); + f.deltaPi(sn, cn, dn); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.resx new file mode 100644 index 000000000..3ec30e045 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/EllipticPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.Designer.cs new file mode 100644 index 000000000..8f5198054 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.Designer.cs @@ -0,0 +1,266 @@ +namespace Projections +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.m_tabControl = new System.Windows.Forms.TabControl(); + this.m_geocentricTabPage = new System.Windows.Forms.TabPage(); + this.m_geodesicTabPage = new System.Windows.Forms.TabPage(); + this.m_localCartesianPage = new System.Windows.Forms.TabPage(); + this.m_albersPage = new System.Windows.Forms.TabPage(); + this.m_typeIIProjections = new System.Windows.Forms.TabPage(); + this.m_typeIIIProjPage = new System.Windows.Forms.TabPage(); + this.m_polarStereoPage = new System.Windows.Forms.TabPage(); + this.m_sphericalPage = new System.Windows.Forms.TabPage(); + this.m_ellipticPage = new System.Windows.Forms.TabPage(); + this.m_ellipsoidPage = new System.Windows.Forms.TabPage(); + this.m_miscPage = new System.Windows.Forms.TabPage(); + this.m_geoidPage = new System.Windows.Forms.TabPage(); + this.m_gravityPage = new System.Windows.Forms.TabPage(); + this.m_magneticPage = new System.Windows.Forms.TabPage(); + this.m_polyPage = new System.Windows.Forms.TabPage(); + this.m_accumPage = new System.Windows.Forms.TabPage(); + this.m_tabControl.SuspendLayout(); + this.SuspendLayout(); + // + // m_tabControl + // + this.m_tabControl.Controls.Add(this.m_geocentricTabPage); + this.m_tabControl.Controls.Add(this.m_geodesicTabPage); + this.m_tabControl.Controls.Add(this.m_localCartesianPage); + this.m_tabControl.Controls.Add(this.m_albersPage); + this.m_tabControl.Controls.Add(this.m_typeIIProjections); + this.m_tabControl.Controls.Add(this.m_typeIIIProjPage); + this.m_tabControl.Controls.Add(this.m_polarStereoPage); + this.m_tabControl.Controls.Add(this.m_sphericalPage); + this.m_tabControl.Controls.Add(this.m_ellipticPage); + this.m_tabControl.Controls.Add(this.m_ellipsoidPage); + this.m_tabControl.Controls.Add(this.m_miscPage); + this.m_tabControl.Controls.Add(this.m_geoidPage); + this.m_tabControl.Controls.Add(this.m_gravityPage); + this.m_tabControl.Controls.Add(this.m_magneticPage); + this.m_tabControl.Controls.Add(this.m_polyPage); + this.m_tabControl.Controls.Add(this.m_accumPage); + this.m_tabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.m_tabControl.Location = new System.Drawing.Point(0, 0); + this.m_tabControl.Name = "m_tabControl"; + this.m_tabControl.SelectedIndex = 0; + this.m_tabControl.ShowToolTips = true; + this.m_tabControl.Size = new System.Drawing.Size(944, 262); + this.m_tabControl.TabIndex = 0; + // + // m_geocentricTabPage + // + this.m_geocentricTabPage.Location = new System.Drawing.Point(4, 22); + this.m_geocentricTabPage.Name = "m_geocentricTabPage"; + this.m_geocentricTabPage.Size = new System.Drawing.Size(936, 236); + this.m_geocentricTabPage.TabIndex = 1; + this.m_geocentricTabPage.Text = "Geocentric"; + this.m_geocentricTabPage.UseVisualStyleBackColor = true; + // + // m_geodesicTabPage + // + this.m_geodesicTabPage.Location = new System.Drawing.Point(4, 22); + this.m_geodesicTabPage.Name = "m_geodesicTabPage"; + this.m_geodesicTabPage.Padding = new System.Windows.Forms.Padding(3); + this.m_geodesicTabPage.Size = new System.Drawing.Size(936, 236); + this.m_geodesicTabPage.TabIndex = 0; + this.m_geodesicTabPage.Text = "Geodesic"; + this.m_geodesicTabPage.ToolTipText = "Geodesic, GeodesicExact, GeodesicLine, & GeodesicLineExact"; + this.m_geodesicTabPage.UseVisualStyleBackColor = true; + // + // m_localCartesianPage + // + this.m_localCartesianPage.Location = new System.Drawing.Point(4, 22); + this.m_localCartesianPage.Name = "m_localCartesianPage"; + this.m_localCartesianPage.Size = new System.Drawing.Size(936, 236); + this.m_localCartesianPage.TabIndex = 2; + this.m_localCartesianPage.Text = "LocalCartesian"; + this.m_localCartesianPage.UseVisualStyleBackColor = true; + // + // m_albersPage + // + this.m_albersPage.Location = new System.Drawing.Point(4, 22); + this.m_albersPage.Name = "m_albersPage"; + this.m_albersPage.Size = new System.Drawing.Size(936, 236); + this.m_albersPage.TabIndex = 3; + this.m_albersPage.Text = "Type I Projections"; + this.m_albersPage.ToolTipText = "Albers Equal Area, Lambert Conformal Conic, Transverse Mercator, and Transverse M" + + "ercator Exact Projections"; + this.m_albersPage.UseVisualStyleBackColor = true; + // + // m_typeIIProjections + // + this.m_typeIIProjections.Location = new System.Drawing.Point(4, 22); + this.m_typeIIProjections.Name = "m_typeIIProjections"; + this.m_typeIIProjections.Size = new System.Drawing.Size(936, 236); + this.m_typeIIProjections.TabIndex = 4; + this.m_typeIIProjections.Text = "Type II Projections"; + this.m_typeIIProjections.ToolTipText = "Azimuth Equidistant, Cassini Soldner, and Gnomonic Projections"; + this.m_typeIIProjections.UseVisualStyleBackColor = true; + // + // m_typeIIIProjPage + // + this.m_typeIIIProjPage.Location = new System.Drawing.Point(4, 22); + this.m_typeIIIProjPage.Name = "m_typeIIIProjPage"; + this.m_typeIIIProjPage.Size = new System.Drawing.Size(936, 236); + this.m_typeIIIProjPage.TabIndex = 11; + this.m_typeIIIProjPage.Text = "Type III Projections"; + this.m_typeIIIProjPage.ToolTipText = "MGRS/OSGB/UTMUPS"; + this.m_typeIIIProjPage.UseVisualStyleBackColor = true; + // + // m_polarStereoPage + // + this.m_polarStereoPage.Location = new System.Drawing.Point(4, 22); + this.m_polarStereoPage.Name = "m_polarStereoPage"; + this.m_polarStereoPage.Size = new System.Drawing.Size(936, 236); + this.m_polarStereoPage.TabIndex = 5; + this.m_polarStereoPage.Text = "Polar Stereographic"; + this.m_polarStereoPage.UseVisualStyleBackColor = true; + // + // m_sphericalPage + // + this.m_sphericalPage.Location = new System.Drawing.Point(4, 22); + this.m_sphericalPage.Name = "m_sphericalPage"; + this.m_sphericalPage.Size = new System.Drawing.Size(936, 236); + this.m_sphericalPage.TabIndex = 6; + this.m_sphericalPage.Text = "Spherical Harmonics"; + this.m_sphericalPage.ToolTipText = "Spherical Harmonic, Spherical Harmonic 1, and Spherical Harmonic 2"; + this.m_sphericalPage.UseVisualStyleBackColor = true; + // + // m_ellipticPage + // + this.m_ellipticPage.Location = new System.Drawing.Point(4, 22); + this.m_ellipticPage.Name = "m_ellipticPage"; + this.m_ellipticPage.Size = new System.Drawing.Size(936, 236); + this.m_ellipticPage.TabIndex = 7; + this.m_ellipticPage.Text = "Elliptic Function"; + this.m_ellipticPage.UseVisualStyleBackColor = true; + // + // m_ellipsoidPage + // + this.m_ellipsoidPage.Location = new System.Drawing.Point(4, 22); + this.m_ellipsoidPage.Name = "m_ellipsoidPage"; + this.m_ellipsoidPage.Size = new System.Drawing.Size(936, 236); + this.m_ellipsoidPage.TabIndex = 8; + this.m_ellipsoidPage.Text = "Ellipsoid"; + this.m_ellipsoidPage.UseVisualStyleBackColor = true; + // + // m_miscPage + // + this.m_miscPage.Location = new System.Drawing.Point(4, 22); + this.m_miscPage.Name = "m_miscPage"; + this.m_miscPage.Size = new System.Drawing.Size(936, 236); + this.m_miscPage.TabIndex = 9; + this.m_miscPage.Text = "Miscellaneous"; + this.m_miscPage.ToolTipText = "DDS/Geohash"; + this.m_miscPage.UseVisualStyleBackColor = true; + // + // m_geoidPage + // + this.m_geoidPage.Location = new System.Drawing.Point(4, 22); + this.m_geoidPage.Name = "m_geoidPage"; + this.m_geoidPage.Size = new System.Drawing.Size(936, 236); + this.m_geoidPage.TabIndex = 10; + this.m_geoidPage.Text = "Geoid"; + this.m_geoidPage.UseVisualStyleBackColor = true; + // + // m_gravityPage + // + this.m_gravityPage.Location = new System.Drawing.Point(4, 22); + this.m_gravityPage.Name = "m_gravityPage"; + this.m_gravityPage.Size = new System.Drawing.Size(936, 236); + this.m_gravityPage.TabIndex = 12; + this.m_gravityPage.Text = "Gravity"; + this.m_gravityPage.ToolTipText = "GravityModel/GravityCircle/NormalGravity"; + this.m_gravityPage.UseVisualStyleBackColor = true; + // + // m_magneticPage + // + this.m_magneticPage.Location = new System.Drawing.Point(4, 22); + this.m_magneticPage.Name = "m_magneticPage"; + this.m_magneticPage.Size = new System.Drawing.Size(936, 236); + this.m_magneticPage.TabIndex = 13; + this.m_magneticPage.Text = "Magnetic"; + this.m_magneticPage.ToolTipText = "MagneticModel/MagneticCircle"; + this.m_magneticPage.UseVisualStyleBackColor = true; + // + // m_polyPage + // + this.m_polyPage.Location = new System.Drawing.Point(4, 22); + this.m_polyPage.Name = "m_polyPage"; + this.m_polyPage.Size = new System.Drawing.Size(936, 236); + this.m_polyPage.TabIndex = 14; + this.m_polyPage.Text = "PolygonArea"; + this.m_polyPage.UseVisualStyleBackColor = true; + // + // m_accumPage + // + this.m_accumPage.Location = new System.Drawing.Point(4, 22); + this.m_accumPage.Name = "m_accumPage"; + this.m_accumPage.Size = new System.Drawing.Size(936, 236); + this.m_accumPage.TabIndex = 15; + this.m_accumPage.Text = "Accumulator"; + this.m_accumPage.UseVisualStyleBackColor = true; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(944, 262); + this.Controls.Add(this.m_tabControl); + this.Name = "Form1"; + this.Text = "Projections"; + this.m_tabControl.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl m_tabControl; + private System.Windows.Forms.TabPage m_geodesicTabPage; + private System.Windows.Forms.TabPage m_geocentricTabPage; + private System.Windows.Forms.TabPage m_localCartesianPage; + private System.Windows.Forms.TabPage m_albersPage; + private System.Windows.Forms.TabPage m_typeIIProjections; + private System.Windows.Forms.TabPage m_polarStereoPage; + private System.Windows.Forms.TabPage m_sphericalPage; + private System.Windows.Forms.TabPage m_ellipticPage; + private System.Windows.Forms.TabPage m_ellipsoidPage; + private System.Windows.Forms.TabPage m_miscPage; + private System.Windows.Forms.TabPage m_geoidPage; + private System.Windows.Forms.TabPage m_typeIIIProjPage; + private System.Windows.Forms.TabPage m_gravityPage; + private System.Windows.Forms.TabPage m_magneticPage; + private System.Windows.Forms.TabPage m_polyPage; + private System.Windows.Forms.TabPage m_accumPage; + + } +} + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.cs new file mode 100644 index 000000000..d93f46edf --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.cs @@ -0,0 +1,49 @@ +/** + * \file NETGeographicLib\Form1.cs + * \brief Main Form for C# example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class Form1 : Form + { + public Form1() + { + InitializeComponent(); + Text = "NETGeographicLib Demo - Version " + VersionInfo.GetString(); + + // set up the tab control + m_geodesicTabPage.Controls.Add(new GeodesicPanel()); + m_geocentricTabPage.Controls.Add(new GeocentricPanel()); + m_localCartesianPage.Controls.Add(new LocalCartesianPanel()); + m_albersPage.Controls.Add(new AlbersPanel()); + m_typeIIProjections.Controls.Add(new ProjectionsPanel()); + m_typeIIIProjPage.Controls.Add(new TypeIIIProjPanel()); + m_polarStereoPage.Controls.Add(new PolarStereoPanel()); + m_sphericalPage.Controls.Add(new SphericalHarmonicsPanel()); + m_ellipticPage.Controls.Add(new EllipticPanel()); + m_ellipsoidPage.Controls.Add(new EllipsoidPanel()); + m_miscPage.Controls.Add(new MiscPanel()); + m_geoidPage.Controls.Add(new GeoidPanel()); + m_gravityPage.Controls.Add(new GravityPanel()); + m_magneticPage.Controls.Add(new MagneticPanel()); + m_polyPage.Controls.Add(new PolyPanel()); + m_accumPage.Controls.Add(new AccumPanel()); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.resx new file mode 100644 index 000000000..ed0aef934 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.Designer.cs new file mode 100644 index 000000000..fcf2d02bf --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.Designer.cs @@ -0,0 +1,426 @@ +namespace Projections +{ + partial class GeocentricPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.m_setButton = new System.Windows.Forms.Button(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.m_flatteningTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.m_toolTips = new System.Windows.Forms.ToolTip(this.components); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_altitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_XTextBox = new System.Windows.Forms.TextBox(); + this.m_YTextBox = new System.Windows.Forms.TextBox(); + this.m_ZTextBox = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.m_functionComboBox = new System.Windows.Forms.ComboBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.m_textBox00 = new System.Windows.Forms.TextBox(); + this.m_textBox01 = new System.Windows.Forms.TextBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.m_textBox02 = new System.Windows.Forms.TextBox(); + this.m_textBox12 = new System.Windows.Forms.TextBox(); + this.m_textBox10 = new System.Windows.Forms.TextBox(); + this.m_textBox11 = new System.Windows.Forms.TextBox(); + this.m_textBox22 = new System.Windows.Forms.TextBox(); + this.m_textBox20 = new System.Windows.Forms.TextBox(); + this.m_textBox21 = new System.Windows.Forms.TextBox(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // m_setButton + // + this.m_setButton.Location = new System.Drawing.Point(12, 107); + this.m_setButton.Name = "m_setButton"; + this.m_setButton.Size = new System.Drawing.Size(75, 23); + this.m_setButton.TabIndex = 4; + this.m_setButton.Text = "Set"; + this.m_toolTips.SetToolTip(this.m_setButton, "Set ellipsoid parameters"); + this.m_setButton.UseVisualStyleBackColor = true; + this.m_setButton.Click += new System.EventHandler(this.OnSetParameters); + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(12, 42); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(125, 20); + this.m_majorRadiusTextBox.TabIndex = 2; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.m_setButton); + this.groupBox1.Controls.Add(this.m_flatteningTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.m_majorRadiusTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(7, 7); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(146, 140); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Ellipsoid Parameters"; + // + // m_flatteningTextBox + // + this.m_flatteningTextBox.Location = new System.Drawing.Point(12, 83); + this.m_flatteningTextBox.Name = "m_flatteningTextBox"; + this.m_flatteningTextBox.Size = new System.Drawing.Size(125, 20); + this.m_flatteningTextBox.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(109, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Major Radius (meters)"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Flattening"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(166, 11); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(95, 13); + this.label3.TabIndex = 6; + this.label3.Text = "Latitude ( degrees)"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(166, 38); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(101, 13); + this.label4.TabIndex = 7; + this.label4.Text = "Longitude (degrees)"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(166, 65); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(82, 13); + this.label5.TabIndex = 8; + this.label5.Text = "Altitude (meters)"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(166, 92); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(54, 13); + this.label6.TabIndex = 9; + this.label6.Text = "X (meters)"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(166, 119); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(54, 13); + this.label7.TabIndex = 10; + this.label7.Text = "Y (meters)"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(166, 146); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(54, 13); + this.label8.TabIndex = 11; + this.label8.Text = "Z (meters)"; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(273, 7); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_latitudeTextBox.TabIndex = 12; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(273, 34); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_longitudeTextBox.TabIndex = 13; + // + // m_altitudeTextBox + // + this.m_altitudeTextBox.Location = new System.Drawing.Point(273, 61); + this.m_altitudeTextBox.Name = "m_altitudeTextBox"; + this.m_altitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_altitudeTextBox.TabIndex = 14; + // + // m_XTextBox + // + this.m_XTextBox.Location = new System.Drawing.Point(273, 88); + this.m_XTextBox.Name = "m_XTextBox"; + this.m_XTextBox.Size = new System.Drawing.Size(100, 20); + this.m_XTextBox.TabIndex = 15; + // + // m_YTextBox + // + this.m_YTextBox.Location = new System.Drawing.Point(273, 115); + this.m_YTextBox.Name = "m_YTextBox"; + this.m_YTextBox.Size = new System.Drawing.Size(100, 20); + this.m_YTextBox.TabIndex = 16; + // + // m_ZTextBox + // + this.m_ZTextBox.Location = new System.Drawing.Point(273, 142); + this.m_ZTextBox.Name = "m_ZTextBox"; + this.m_ZTextBox.Size = new System.Drawing.Size(100, 20); + this.m_ZTextBox.TabIndex = 17; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(169, 175); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(48, 13); + this.label9.TabIndex = 18; + this.label9.Text = "Function"; + // + // m_functionComboBox + // + this.m_functionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_functionComboBox.FormattingEnabled = true; + this.m_functionComboBox.Items.AddRange(new object[] { + "Forward", + "Reverse"}); + this.m_functionComboBox.Location = new System.Drawing.Point(273, 171); + this.m_functionComboBox.Name = "m_functionComboBox"; + this.m_functionComboBox.Size = new System.Drawing.Size(100, 21); + this.m_functionComboBox.TabIndex = 19; + this.m_toolTips.SetToolTip(this.m_functionComboBox, "Forward/Reverse"); + this.m_functionComboBox.SelectedIndexChanged += new System.EventHandler(this.OnFunctionChanged); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(386, 169); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 20; + this.button1.Text = "Convert"; + this.m_toolTips.SetToolTip(this.button1, "Converts the coordinates using the selected Function"); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnConvert); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(7, 170); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 21; + this.button2.Text = "Validate"; + this.m_toolTips.SetToolTip(this.button2, "Tests Geocentric interfaces"); + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnValidate); + // + // m_textBox00 + // + this.m_textBox00.Location = new System.Drawing.Point(6, 25); + this.m_textBox00.Name = "m_textBox00"; + this.m_textBox00.ReadOnly = true; + this.m_textBox00.Size = new System.Drawing.Size(100, 20); + this.m_textBox00.TabIndex = 22; + // + // m_textBox01 + // + this.m_textBox01.Location = new System.Drawing.Point(112, 25); + this.m_textBox01.Name = "m_textBox01"; + this.m_textBox01.ReadOnly = true; + this.m_textBox01.Size = new System.Drawing.Size(100, 20); + this.m_textBox01.TabIndex = 23; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.m_textBox22); + this.groupBox2.Controls.Add(this.m_textBox20); + this.groupBox2.Controls.Add(this.m_textBox21); + this.groupBox2.Controls.Add(this.m_textBox12); + this.groupBox2.Controls.Add(this.m_textBox10); + this.groupBox2.Controls.Add(this.m_textBox11); + this.groupBox2.Controls.Add(this.m_textBox02); + this.groupBox2.Controls.Add(this.m_textBox00); + this.groupBox2.Controls.Add(this.m_textBox01); + this.groupBox2.Location = new System.Drawing.Point(380, 11); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(325, 99); + this.groupBox2.TabIndex = 24; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Rotation Matrix - ENU to ECEF"; + // + // m_textBox02 + // + this.m_textBox02.Location = new System.Drawing.Point(218, 25); + this.m_textBox02.Name = "m_textBox02"; + this.m_textBox02.ReadOnly = true; + this.m_textBox02.Size = new System.Drawing.Size(100, 20); + this.m_textBox02.TabIndex = 24; + // + // m_textBox12 + // + this.m_textBox12.Location = new System.Drawing.Point(218, 50); + this.m_textBox12.Name = "m_textBox12"; + this.m_textBox12.ReadOnly = true; + this.m_textBox12.Size = new System.Drawing.Size(100, 20); + this.m_textBox12.TabIndex = 27; + // + // m_textBox10 + // + this.m_textBox10.Location = new System.Drawing.Point(6, 50); + this.m_textBox10.Name = "m_textBox10"; + this.m_textBox10.ReadOnly = true; + this.m_textBox10.Size = new System.Drawing.Size(100, 20); + this.m_textBox10.TabIndex = 25; + // + // m_textBox11 + // + this.m_textBox11.Location = new System.Drawing.Point(112, 50); + this.m_textBox11.Name = "m_textBox11"; + this.m_textBox11.ReadOnly = true; + this.m_textBox11.Size = new System.Drawing.Size(100, 20); + this.m_textBox11.TabIndex = 26; + // + // m_textBox22 + // + this.m_textBox22.Location = new System.Drawing.Point(218, 74); + this.m_textBox22.Name = "m_textBox22"; + this.m_textBox22.ReadOnly = true; + this.m_textBox22.Size = new System.Drawing.Size(100, 20); + this.m_textBox22.TabIndex = 30; + // + // m_textBox20 + // + this.m_textBox20.Location = new System.Drawing.Point(6, 74); + this.m_textBox20.Name = "m_textBox20"; + this.m_textBox20.ReadOnly = true; + this.m_textBox20.Size = new System.Drawing.Size(100, 20); + this.m_textBox20.TabIndex = 28; + // + // m_textBox21 + // + this.m_textBox21.Location = new System.Drawing.Point(112, 74); + this.m_textBox21.Name = "m_textBox21"; + this.m_textBox21.ReadOnly = true; + this.m_textBox21.Size = new System.Drawing.Size(100, 20); + this.m_textBox21.TabIndex = 29; + // + // GeocentricPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.m_functionComboBox); + this.Controls.Add(this.label9); + this.Controls.Add(this.m_ZTextBox); + this.Controls.Add(this.m_YTextBox); + this.Controls.Add(this.m_XTextBox); + this.Controls.Add(this.m_altitudeTextBox); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.groupBox1); + this.Name = "GeocentricPanel"; + this.Size = new System.Drawing.Size(771, 231); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button m_setButton; + private System.Windows.Forms.ToolTip m_toolTips; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.TextBox m_flatteningTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.TextBox m_altitudeTextBox; + private System.Windows.Forms.TextBox m_XTextBox; + private System.Windows.Forms.TextBox m_YTextBox; + private System.Windows.Forms.TextBox m_ZTextBox; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.ComboBox m_functionComboBox; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.TextBox m_textBox00; + private System.Windows.Forms.TextBox m_textBox01; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox m_textBox22; + private System.Windows.Forms.TextBox m_textBox20; + private System.Windows.Forms.TextBox m_textBox21; + private System.Windows.Forms.TextBox m_textBox12; + private System.Windows.Forms.TextBox m_textBox10; + private System.Windows.Forms.TextBox m_textBox11; + private System.Windows.Forms.TextBox m_textBox02; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.cs new file mode 100644 index 000000000..a3231b34f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.cs @@ -0,0 +1,150 @@ +/** + * \file NETGeographicLib\GeocentricPanel.cs + * \brief NETGeographicLib.Geocentric example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class GeocentricPanel : UserControl + { + enum Functions + { + Forward, + Inverse + }; + Functions m_function = Functions.Forward; + Geocentric m_geocentric = null; + + public GeocentricPanel() + { + InitializeComponent(); + + try + { + m_geocentric = new Geocentric(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + m_majorRadiusTextBox.Text = m_geocentric.MajorRadius.ToString(); + m_flatteningTextBox.Text = m_geocentric.Flattening.ToString(); + m_functionComboBox.SelectedIndex = (int)m_function; + } + + private void OnSetParameters(object sender, EventArgs e) + { + try + { + double a = Double.Parse( m_majorRadiusTextBox.Text ); + double f = Double.Parse(m_flatteningTextBox.Text); + m_geocentric = new Geocentric(a, f); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Data entry error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + + private void OnFunctionChanged(object sender, EventArgs e) + { + m_function = (Functions)m_functionComboBox.SelectedIndex; + switch (m_function) + { + case Functions.Forward: + m_latitudeTextBox.ReadOnly = m_longitudeTextBox.ReadOnly = m_altitudeTextBox.ReadOnly = false; + m_XTextBox.ReadOnly = m_YTextBox.ReadOnly = m_ZTextBox.ReadOnly = true; + break; + case Functions.Inverse: + m_latitudeTextBox.ReadOnly = m_longitudeTextBox.ReadOnly = m_altitudeTextBox.ReadOnly = true; + m_XTextBox.ReadOnly = m_YTextBox.ReadOnly = m_ZTextBox.ReadOnly = false; + break; + } + } + + private void OnConvert(object sender, EventArgs e) + { + try + { + double lat, lon, alt, x, y, z; + double[,] rot = null; + switch (m_function) + { + case Functions.Forward: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + alt = Double.Parse(m_altitudeTextBox.Text); + m_geocentric.Forward(lat, lon, alt, out x, out y, out z, out rot); + m_XTextBox.Text = x.ToString(); + m_YTextBox.Text = y.ToString(); + m_ZTextBox.Text = z.ToString(); + break; + case Functions.Inverse: + x = Double.Parse(m_XTextBox.Text); + y = Double.Parse(m_YTextBox.Text); + z = Double.Parse(m_ZTextBox.Text); + m_geocentric.Reverse(x, y, z, out lat, out lon, out alt, out rot); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + m_altitudeTextBox.Text = alt.ToString(); + break; + } + m_textBox00.Text = rot[0, 0].ToString(); + m_textBox01.Text = rot[0, 1].ToString(); + m_textBox02.Text = rot[0, 2].ToString(); + m_textBox10.Text = rot[1, 0].ToString(); + m_textBox11.Text = rot[1, 1].ToString(); + m_textBox12.Text = rot[1, 2].ToString(); + m_textBox20.Text = rot[2, 0].ToString(); + m_textBox21.Text = rot[2, 1].ToString(); + m_textBox22.Text = rot[2, 2].ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + Geocentric g = new Geocentric(); + string test = g.ToString(); + g = new Geocentric(g.MajorRadius, g.Flattening); + double x, y, z, lat, lon, alt, tx, ty, tz; + double[,] rot; + g.Forward(32.0, -86.0, 45.0, out x, out y, out z, out rot); + g.Forward(32.0, -86.0, 45.0, out tx, out ty, out tz); + if (x != tx || y != ty || z != tz) + throw new Exception("Error in Forward"); + g.Reverse(x, y, z, out lat, out lon, out alt, out rot); + g.Reverse(x, y, z, out tx, out ty, out tz); + if ( lat != tx || lon != ty || alt != tz ) + throw new Exception("Error in Reverse"); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error detected", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.resx new file mode 100644 index 000000000..a34b31bc4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeocentricPanel.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.Designer.cs new file mode 100644 index 000000000..dfbd89d35 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.Designer.cs @@ -0,0 +1,484 @@ +namespace Projections +{ + partial class GeodesicPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.m_flatteningTextBox = new System.Windows.Forms.TextBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.m_setButton = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.m_distanceRadioButton = new System.Windows.Forms.RadioButton(); + this.m_arcLengthRadioButton = new System.Windows.Forms.RadioButton(); + this.m_originLatitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_originLongitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_originAzimuthTextBox = new System.Windows.Forms.TextBox(); + this.m_distanceTextBox = new System.Windows.Forms.TextBox(); + this.m_ArcLengthTextBox = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.m12Label = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_finalLatitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_finalLongitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_finalAzimuthTextBox = new System.Windows.Forms.TextBox(); + this.m_reducedLengthTextBox = new System.Windows.Forms.TextBox(); + this.m_M12TextBox = new System.Windows.Forms.TextBox(); + this.m_M21TextBox = new System.Windows.Forms.TextBox(); + this.m_S12TextBox = new System.Windows.Forms.TextBox(); + this.m_functionComboBox = new System.Windows.Forms.ComboBox(); + this.FunctionLabel = new System.Windows.Forms.Label(); + this.m_classComboBox = new System.Windows.Forms.ComboBox(); + this.label12 = new System.Windows.Forms.Label(); + this.m_tooltips = new System.Windows.Forms.ToolTip(this.components); + this.m_validateButton = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(14, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(109, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Major Radius (meters)"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(14, 51); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Flattening"; + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(129, 21); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(125, 20); + this.m_majorRadiusTextBox.TabIndex = 2; + // + // m_flatteningTextBox + // + this.m_flatteningTextBox.Location = new System.Drawing.Point(129, 47); + this.m_flatteningTextBox.Name = "m_flatteningTextBox"; + this.m_flatteningTextBox.Size = new System.Drawing.Size(125, 20); + this.m_flatteningTextBox.TabIndex = 3; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.m_setButton); + this.groupBox1.Controls.Add(this.m_flatteningTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.m_majorRadiusTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(4, 4); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(267, 107); + this.groupBox1.TabIndex = 4; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Ellipsoid Parameters"; + // + // m_setButton + // + this.m_setButton.Location = new System.Drawing.Point(176, 74); + this.m_setButton.Name = "m_setButton"; + this.m_setButton.Size = new System.Drawing.Size(75, 23); + this.m_setButton.TabIndex = 4; + this.m_setButton.Text = "Set"; + this.m_setButton.UseVisualStyleBackColor = true; + this.m_setButton.Click += new System.EventHandler(this.OnSet); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(183, 143); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 5; + this.button1.Text = "Execute"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Enter += new System.EventHandler(this.OnForward); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(279, 14); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(122, 13); + this.label3.TabIndex = 6; + this.label3.Text = "Origin Latitude (degrees)"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(279, 41); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(131, 13); + this.label4.TabIndex = 7; + this.label4.Text = "Origin Longitude (degrees)"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(279, 68); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(121, 13); + this.label5.TabIndex = 8; + this.label5.Text = "Origin Azimuth (degrees)"; + // + // m_distanceRadioButton + // + this.m_distanceRadioButton.AutoSize = true; + this.m_distanceRadioButton.Checked = true; + this.m_distanceRadioButton.Location = new System.Drawing.Point(279, 93); + this.m_distanceRadioButton.Name = "m_distanceRadioButton"; + this.m_distanceRadioButton.Size = new System.Drawing.Size(107, 17); + this.m_distanceRadioButton.TabIndex = 9; + this.m_distanceRadioButton.TabStop = true; + this.m_distanceRadioButton.Text = "Distance (meters)"; + this.m_distanceRadioButton.UseVisualStyleBackColor = true; + this.m_distanceRadioButton.Click += new System.EventHandler(this.OnDistance); + // + // m_arcLengthRadioButton + // + this.m_arcLengthRadioButton.AutoSize = true; + this.m_arcLengthRadioButton.Location = new System.Drawing.Point(279, 120); + this.m_arcLengthRadioButton.Name = "m_arcLengthRadioButton"; + this.m_arcLengthRadioButton.Size = new System.Drawing.Size(124, 17); + this.m_arcLengthRadioButton.TabIndex = 10; + this.m_arcLengthRadioButton.Text = "Arc Length (degrees)"; + this.m_arcLengthRadioButton.UseVisualStyleBackColor = true; + this.m_arcLengthRadioButton.Click += new System.EventHandler(this.OnArcLength); + // + // m_originLatitudeTextBox + // + this.m_originLatitudeTextBox.Location = new System.Drawing.Point(416, 10); + this.m_originLatitudeTextBox.Name = "m_originLatitudeTextBox"; + this.m_originLatitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_originLatitudeTextBox.TabIndex = 11; + // + // m_originLongitudeTextBox + // + this.m_originLongitudeTextBox.Location = new System.Drawing.Point(416, 37); + this.m_originLongitudeTextBox.Name = "m_originLongitudeTextBox"; + this.m_originLongitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_originLongitudeTextBox.TabIndex = 12; + // + // m_originAzimuthTextBox + // + this.m_originAzimuthTextBox.Location = new System.Drawing.Point(416, 64); + this.m_originAzimuthTextBox.Name = "m_originAzimuthTextBox"; + this.m_originAzimuthTextBox.Size = new System.Drawing.Size(100, 20); + this.m_originAzimuthTextBox.TabIndex = 13; + // + // m_distanceTextBox + // + this.m_distanceTextBox.Location = new System.Drawing.Point(416, 91); + this.m_distanceTextBox.Name = "m_distanceTextBox"; + this.m_distanceTextBox.Size = new System.Drawing.Size(100, 20); + this.m_distanceTextBox.TabIndex = 14; + // + // m_ArcLengthTextBox + // + this.m_ArcLengthTextBox.Location = new System.Drawing.Point(416, 118); + this.m_ArcLengthTextBox.Name = "m_ArcLengthTextBox"; + this.m_ArcLengthTextBox.ReadOnly = true; + this.m_ArcLengthTextBox.Size = new System.Drawing.Size(100, 20); + this.m_ArcLengthTextBox.TabIndex = 15; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(525, 14); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(117, 13); + this.label6.TabIndex = 16; + this.label6.Text = "Final Latitude (degrees)"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(525, 41); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(126, 13); + this.label7.TabIndex = 17; + this.label7.Text = "Final Longitude (degrees)"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(525, 68); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(116, 13); + this.label8.TabIndex = 18; + this.label8.Text = "Final Azimuth (degrees)"; + // + // m12Label + // + this.m12Label.AutoSize = true; + this.m12Label.Location = new System.Drawing.Point(525, 95); + this.m12Label.Name = "m12Label"; + this.m12Label.Size = new System.Drawing.Size(127, 13); + this.m12Label.TabIndex = 19; + this.m12Label.Text = "Reduced Length (meters)"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(525, 122); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(28, 13); + this.label9.TabIndex = 20; + this.label9.Text = "M12"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(525, 149); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(28, 13); + this.label10.TabIndex = 21; + this.label10.Text = "M21"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(525, 176); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(26, 13); + this.label11.TabIndex = 22; + this.label11.Text = "S12"; + // + // m_finalLatitudeTextBox + // + this.m_finalLatitudeTextBox.Location = new System.Drawing.Point(660, 10); + this.m_finalLatitudeTextBox.Name = "m_finalLatitudeTextBox"; + this.m_finalLatitudeTextBox.ReadOnly = true; + this.m_finalLatitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_finalLatitudeTextBox.TabIndex = 23; + // + // m_finalLongitudeTextBox + // + this.m_finalLongitudeTextBox.Location = new System.Drawing.Point(660, 37); + this.m_finalLongitudeTextBox.Name = "m_finalLongitudeTextBox"; + this.m_finalLongitudeTextBox.ReadOnly = true; + this.m_finalLongitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_finalLongitudeTextBox.TabIndex = 24; + // + // m_finalAzimuthTextBox + // + this.m_finalAzimuthTextBox.Location = new System.Drawing.Point(660, 64); + this.m_finalAzimuthTextBox.Name = "m_finalAzimuthTextBox"; + this.m_finalAzimuthTextBox.ReadOnly = true; + this.m_finalAzimuthTextBox.Size = new System.Drawing.Size(100, 20); + this.m_finalAzimuthTextBox.TabIndex = 25; + // + // m_reducedLengthTextBox + // + this.m_reducedLengthTextBox.Location = new System.Drawing.Point(660, 91); + this.m_reducedLengthTextBox.Name = "m_reducedLengthTextBox"; + this.m_reducedLengthTextBox.ReadOnly = true; + this.m_reducedLengthTextBox.Size = new System.Drawing.Size(100, 20); + this.m_reducedLengthTextBox.TabIndex = 26; + // + // m_M12TextBox + // + this.m_M12TextBox.Location = new System.Drawing.Point(660, 118); + this.m_M12TextBox.Name = "m_M12TextBox"; + this.m_M12TextBox.ReadOnly = true; + this.m_M12TextBox.Size = new System.Drawing.Size(100, 20); + this.m_M12TextBox.TabIndex = 27; + // + // m_M21TextBox + // + this.m_M21TextBox.Location = new System.Drawing.Point(660, 145); + this.m_M21TextBox.Name = "m_M21TextBox"; + this.m_M21TextBox.ReadOnly = true; + this.m_M21TextBox.Size = new System.Drawing.Size(100, 20); + this.m_M21TextBox.TabIndex = 28; + // + // m_S12TextBox + // + this.m_S12TextBox.Location = new System.Drawing.Point(660, 172); + this.m_S12TextBox.Name = "m_S12TextBox"; + this.m_S12TextBox.ReadOnly = true; + this.m_S12TextBox.Size = new System.Drawing.Size(100, 20); + this.m_S12TextBox.TabIndex = 29; + // + // m_functionComboBox + // + this.m_functionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_functionComboBox.FormattingEnabled = true; + this.m_functionComboBox.Items.AddRange(new object[] { + "Direct", + "Inverse"}); + this.m_functionComboBox.Location = new System.Drawing.Point(416, 145); + this.m_functionComboBox.Name = "m_functionComboBox"; + this.m_functionComboBox.Size = new System.Drawing.Size(100, 21); + this.m_functionComboBox.TabIndex = 30; + this.m_functionComboBox.SelectedIndexChanged += new System.EventHandler(this.OnFunction); + // + // FunctionLabel + // + this.FunctionLabel.AutoSize = true; + this.FunctionLabel.Location = new System.Drawing.Point(282, 149); + this.FunctionLabel.Name = "FunctionLabel"; + this.FunctionLabel.Size = new System.Drawing.Size(48, 13); + this.FunctionLabel.TabIndex = 31; + this.FunctionLabel.Text = "Function"; + // + // m_classComboBox + // + this.m_classComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_classComboBox.FormattingEnabled = true; + this.m_classComboBox.Items.AddRange(new object[] { + "Geodesic", + "GeodesicExact", + "GeodesicLine", + "GeodesicLineExact"}); + this.m_classComboBox.Location = new System.Drawing.Point(395, 172); + this.m_classComboBox.Name = "m_classComboBox"; + this.m_classComboBox.Size = new System.Drawing.Size(121, 21); + this.m_classComboBox.TabIndex = 32; + this.m_classComboBox.SelectedIndexChanged += new System.EventHandler(this.OnClassChanged); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(282, 176); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(32, 13); + this.label12.TabIndex = 33; + this.label12.Text = "Class"; + // + // m_validateButton + // + this.m_validateButton.Location = new System.Drawing.Point(21, 143); + this.m_validateButton.Name = "m_validateButton"; + this.m_validateButton.Size = new System.Drawing.Size(75, 23); + this.m_validateButton.TabIndex = 34; + this.m_validateButton.Text = "Validate"; + this.m_validateButton.UseVisualStyleBackColor = true; + this.m_validateButton.Click += new System.EventHandler(this.OnValidate); + // + // GeodesicPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.m_validateButton); + this.Controls.Add(this.label12); + this.Controls.Add(this.m_classComboBox); + this.Controls.Add(this.FunctionLabel); + this.Controls.Add(this.m_functionComboBox); + this.Controls.Add(this.m_S12TextBox); + this.Controls.Add(this.m_M21TextBox); + this.Controls.Add(this.m_M12TextBox); + this.Controls.Add(this.m_reducedLengthTextBox); + this.Controls.Add(this.m_finalAzimuthTextBox); + this.Controls.Add(this.m_finalLongitudeTextBox); + this.Controls.Add(this.m_finalLatitudeTextBox); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.m12Label); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.m_ArcLengthTextBox); + this.Controls.Add(this.m_distanceTextBox); + this.Controls.Add(this.m_originAzimuthTextBox); + this.Controls.Add(this.m_originLongitudeTextBox); + this.Controls.Add(this.m_originLatitudeTextBox); + this.Controls.Add(this.m_arcLengthRadioButton); + this.Controls.Add(this.m_distanceRadioButton); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.button1); + this.Controls.Add(this.groupBox1); + this.Name = "GeodesicPanel"; + this.Size = new System.Drawing.Size(794, 220); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.TextBox m_flatteningTextBox; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button m_setButton; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.RadioButton m_distanceRadioButton; + private System.Windows.Forms.RadioButton m_arcLengthRadioButton; + private System.Windows.Forms.TextBox m_originLatitudeTextBox; + private System.Windows.Forms.TextBox m_originLongitudeTextBox; + private System.Windows.Forms.TextBox m_originAzimuthTextBox; + private System.Windows.Forms.TextBox m_distanceTextBox; + private System.Windows.Forms.TextBox m_ArcLengthTextBox; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label m12Label; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox m_finalLatitudeTextBox; + private System.Windows.Forms.TextBox m_finalLongitudeTextBox; + private System.Windows.Forms.TextBox m_finalAzimuthTextBox; + private System.Windows.Forms.TextBox m_reducedLengthTextBox; + private System.Windows.Forms.TextBox m_M12TextBox; + private System.Windows.Forms.TextBox m_M21TextBox; + private System.Windows.Forms.TextBox m_S12TextBox; + private System.Windows.Forms.ComboBox m_functionComboBox; + private System.Windows.Forms.Label FunctionLabel; + private System.Windows.Forms.ComboBox m_classComboBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.ToolTip m_tooltips; + private System.Windows.Forms.Button m_validateButton; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.cs new file mode 100644 index 000000000..24e78eeb7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.cs @@ -0,0 +1,633 @@ +/** + * \file NETGeographicLib\GeodesicPanel.cs + * \brief NETGeographicLib.Geodesic example + * + * NETGeographicLib.Geodesic, + * NETGeographicLib.GeodesicLine, + * NETGeographicLib.GeodesicExact, + * NETGeographicLib.GeodesicLineExact + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class GeodesicPanel : UserControl + { + public string warning = "GeographicLib Error"; + public string warning2 = "Data Conversion Error"; + + enum Function + { + Direct = 0, + Inverse = 1 + }; + Function m_function = Function.Direct; + + enum Variable + { + Distance = 0, + ArcLength = 2 + }; + Variable m_variable = Variable.Distance; + + enum Classes + { + GEODESIC = 0, + GEODESICEXACT= 1, + GEODESICLINE = 2, + GEODESICLINEEXACT = 3 + }; + Classes m_class = Classes.GEODESIC; + + Geodesic m_geodesic = null; + + public GeodesicPanel() + { + InitializeComponent(); + m_tooltips.SetToolTip(button1, "Performs the selected function with the selected class"); + m_tooltips.SetToolTip(m_setButton, "Sets the ellipsoid attributes"); + m_tooltips.SetToolTip(m_validateButton, "Validates Geodesic, GeodesicExact, GeodesicLine, and GeodesicLineExact interfaces"); + try + { + m_geodesic = new Geodesic(); + } + catch (GeographicErr err) + { + MessageBox.Show(err.Message, warning, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + m_majorRadiusTextBox.Text = m_geodesic.MajorRadius.ToString(); + m_flatteningTextBox.Text = m_geodesic.Flattening.ToString(); + m_functionComboBox.SelectedIndex = 0; + m_classComboBox.SelectedIndex = 0; + } + + // gets the major radius and flattening and creates a new Geodesic + private void OnSet(object sender, EventArgs e) + { + try + { + double radius = Double.Parse(m_majorRadiusTextBox.Text); + double flattening = Double.Parse(m_flatteningTextBox.Text); + m_geodesic = new Geodesic(radius, flattening); + } + catch (GeographicErr err) + { + MessageBox.Show(err.Message, warning, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + catch (Exception err2) + { + MessageBox.Show(err2.Message, warning2, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + // Gets the input parameters and calls the appropriate function + private void OnForward(object sender, EventArgs e) + { + double origLatitude = 0.0, origLongitude = 0.0, origAzimuth = 0.0, + distance = 0.0, finalLatitude = 0.0, finalLongitude = 0.0; + // get & validate inputs + try + { + if ( m_function == Function.Direct ) + { + distance = Double.Parse( m_variable == Variable.Distance ? + m_distanceTextBox.Text : m_ArcLengthTextBox.Text ); + origAzimuth = Double.Parse( m_originAzimuthTextBox.Text ); + if ( origAzimuth < -180.0 || origAzimuth > 180.0 ) + { + m_originAzimuthTextBox.Focus(); + throw new Exception( "Range Error: -180 <= initial azimuth <= 180 degrees" ); + } + } + else + { + finalLatitude = Double.Parse( m_finalLatitudeTextBox.Text ); + if (finalLatitude < -90.0 || finalLatitude > 90.0) + { + m_finalLatitudeTextBox.Focus(); + throw new Exception("Range Error: -90 <= final latitude <= 90 degrees"); + } + finalLongitude = Double.Parse( m_finalLongitudeTextBox.Text ); + if (finalLongitude < -540.0 || finalLongitude > 540.0) + { + m_finalLongitudeTextBox.Focus(); + throw new Exception("Range Error: -540 <= final longitude <= 540 degrees"); + } + } + origLatitude = Double.Parse( m_originLatitudeTextBox.Text ); + if (origLatitude < -90.0 || origLatitude > 90.0) + { + m_originLatitudeTextBox.Focus(); + throw new Exception("Range Error: -90 <= initial latitude <= 90 degrees"); + } + origLongitude = Double.Parse(m_originLongitudeTextBox.Text); + if (origLongitude < -540.0 || origLongitude > 540.0) + { + m_originLongitudeTextBox.Focus(); + throw new Exception("Range Error: -540 <= initial longitude <= 540 degrees"); + } + } + catch ( Exception xcpt ) + { + MessageBox.Show(xcpt.Message, warning2, MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + // excute the appropriate function. + double finalAzimuth = 0.0, reducedLength = 0.0, M12 = 0.0, M21 = 0.0, + S12 = 0.0, arcDistance = 0.0; + int sw = (int)m_function | (int)m_variable; + if (sw == 3) sw = 1; // cases 1 & 3 are identical. + try + { + switch (m_class) + { + case Classes.GEODESIC: + switch (sw) + { + case 0: // function == Direct, variable == distance + m_ArcLengthTextBox.Text = + m_geodesic.Direct(origLatitude, origLongitude, origAzimuth, distance, + out finalLatitude, out finalLongitude, out finalAzimuth, out reducedLength, + out M12, out M21, out S12).ToString(); + m_finalLatitudeTextBox.Text = finalLatitude.ToString(); + m_finalLongitudeTextBox.Text = finalLongitude.ToString(); + break; + case 1: // function == Inverse, variable == distance + m_ArcLengthTextBox.Text = + m_geodesic.Inverse(origLatitude, origLongitude, finalLatitude, finalLongitude, + out distance, out origAzimuth, out finalAzimuth, out reducedLength, out M12, + out M21, out S12).ToString(); + m_distanceTextBox.Text = distance.ToString(); + m_originAzimuthTextBox.Text = origAzimuth.ToString(); + break; + case 2: // function == Direct, variable == arc length + m_geodesic.ArcDirect(origLatitude, origLongitude, origAzimuth, distance, + out finalLatitude, out finalLongitude, out finalAzimuth, out arcDistance, + out reducedLength, out M12, out M21, out S12); + m_distanceTextBox.Text = arcDistance.ToString(); + m_finalLatitudeTextBox.Text = finalLatitude.ToString(); + m_finalLongitudeTextBox.Text = finalLongitude.ToString(); + break; + } + m_finalAzimuthTextBox.Text = finalAzimuth.ToString(); + m_reducedLengthTextBox.Text = reducedLength.ToString(); + m_M12TextBox.Text = M12.ToString(); + m_M21TextBox.Text = M21.ToString(); + m_S12TextBox.Text = S12.ToString(); + break; + case Classes.GEODESICEXACT: + GeodesicExact ge = new GeodesicExact(m_geodesic.MajorRadius, m_geodesic.Flattening); + switch (sw) + { + case 0: // function == Direct, variable == distance + m_ArcLengthTextBox.Text = + ge.Direct(origLatitude, origLongitude, origAzimuth, distance, + out finalLatitude, out finalLongitude, out finalAzimuth, out reducedLength, + out M12, out M21, out S12).ToString(); + m_finalLatitudeTextBox.Text = finalLatitude.ToString(); + m_finalLongitudeTextBox.Text = finalLongitude.ToString(); + break; + case 1: // function == Inverse, variable == distance + m_ArcLengthTextBox.Text = + ge.Inverse(origLatitude, origLongitude, finalLatitude, finalLongitude, + out distance, out origAzimuth, out finalAzimuth, out reducedLength, out M12, + out M21, out S12).ToString(); + m_distanceTextBox.Text = distance.ToString(); + m_originAzimuthTextBox.Text = origAzimuth.ToString(); + break; + case 2: // function == Direct, variable == arc length + ge.ArcDirect(origLatitude, origLongitude, origAzimuth, distance, + out finalLatitude, out finalLongitude, out finalAzimuth, out arcDistance, + out reducedLength, out M12, out M21, out S12); + m_distanceTextBox.Text = arcDistance.ToString(); + m_finalLatitudeTextBox.Text = finalLatitude.ToString(); + m_finalLongitudeTextBox.Text = finalLongitude.ToString(); + break; + } + m_finalAzimuthTextBox.Text = finalAzimuth.ToString(); + m_reducedLengthTextBox.Text = reducedLength.ToString(); + m_M12TextBox.Text = M12.ToString(); + m_M21TextBox.Text = M21.ToString(); + m_S12TextBox.Text = S12.ToString(); + break; + case Classes.GEODESICLINE: + GeodesicLine gl = new GeodesicLine(m_geodesic, origLatitude, origLongitude, origAzimuth, Mask.ALL); + switch (sw) + { + case 0: // function == Direct, variable == distance + m_ArcLengthTextBox.Text = + gl.Position(distance, + out finalLatitude, out finalLongitude, out finalAzimuth, out reducedLength, + out M12, out M21, out S12).ToString(); + m_finalLatitudeTextBox.Text = finalLatitude.ToString(); + m_finalLongitudeTextBox.Text = finalLongitude.ToString(); + break; + case 1: // function == Inverse, variable == distance + throw new Exception("GeodesicLine does not have an Inverse function"); + case 2: // function == Direct, variable == arc length + gl.ArcPosition(distance, + out finalLatitude, out finalLongitude, out finalAzimuth, out arcDistance, + out reducedLength, out M12, out M21, out S12); + m_distanceTextBox.Text = arcDistance.ToString(); + m_finalLatitudeTextBox.Text = finalLatitude.ToString(); + m_finalLongitudeTextBox.Text = finalLongitude.ToString(); + break; + } + m_finalAzimuthTextBox.Text = finalAzimuth.ToString(); + m_reducedLengthTextBox.Text = reducedLength.ToString(); + m_M12TextBox.Text = M12.ToString(); + m_M21TextBox.Text = M21.ToString(); + m_S12TextBox.Text = S12.ToString(); + break; + case Classes.GEODESICLINEEXACT: + GeodesicLineExact gle = new GeodesicLineExact(origLatitude, origLongitude, origAzimuth, Mask.ALL); + switch (sw) + { + case 0: // function == Direct, variable == distance + m_ArcLengthTextBox.Text = + gle.Position(distance, + out finalLatitude, out finalLongitude, out finalAzimuth, out reducedLength, + out M12, out M21, out S12).ToString(); + m_finalLatitudeTextBox.Text = finalLatitude.ToString(); + m_finalLongitudeTextBox.Text = finalLongitude.ToString(); + break; + case 1: // function == Inverse, variable == distance + throw new Exception("GeodesicLineExact does not have an Inverse function"); + case 2: // function == Direct, variable == arc length + gle.ArcPosition(distance, + out finalLatitude, out finalLongitude, out finalAzimuth, out arcDistance, + out reducedLength, out M12, out M21, out S12); + m_distanceTextBox.Text = arcDistance.ToString(); + m_finalLatitudeTextBox.Text = finalLatitude.ToString(); + m_finalLongitudeTextBox.Text = finalLongitude.ToString(); + break; + } + m_finalAzimuthTextBox.Text = finalAzimuth.ToString(); + m_reducedLengthTextBox.Text = reducedLength.ToString(); + m_M12TextBox.Text = M12.ToString(); + m_M21TextBox.Text = M21.ToString(); + m_S12TextBox.Text = S12.ToString(); + break; + } + } + catch (Exception err) + { + MessageBox.Show(err.Message, warning, MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + // gui stuff + private void OnDistance(object sender, EventArgs e) + { + m_distanceTextBox.ReadOnly = false; + m_ArcLengthTextBox.ReadOnly = true; + m_variable = Variable.Distance; + } + + // gui stuff + private void OnArcLength(object sender, EventArgs e) + { + m_distanceTextBox.ReadOnly = true; + m_ArcLengthTextBox.ReadOnly = false; + m_variable = Variable.ArcLength; + } + + // gui stuff + private void OnFunction(object sender, EventArgs e) + { + m_function = (Function)m_functionComboBox.SelectedIndex; + switch (m_function) + { + case Function.Direct: + m_distanceTextBox.ReadOnly = m_variable == Variable.ArcLength; + m_ArcLengthTextBox.ReadOnly = m_variable == Variable.Distance; + m_originAzimuthTextBox.ReadOnly = false; + m_finalLatitudeTextBox.ReadOnly = true; + m_finalLongitudeTextBox.ReadOnly = true; + break; + case Function.Inverse: + m_distanceTextBox.ReadOnly = true; + m_ArcLengthTextBox.ReadOnly = true; + m_originAzimuthTextBox.ReadOnly = true; + m_finalLatitudeTextBox.ReadOnly = false; + m_finalLongitudeTextBox.ReadOnly = false; + break; + } + } + // gui stuff + private void OnClassChanged(object sender, EventArgs e) + { + m_class = (Classes)m_classComboBox.SelectedIndex; + } + + // a simple validation function...does not change GUI elements + private void OnValidate(object sender, EventArgs e) + { + double finalAzimuth = 0.0, reducedLength = 0.0, M12 = 0.0, M21 = 0.0, + S12 = 0.0, arcDistance = 0.0, finalLatitude = 0.0, finalLongitude = 0.0, + distance = 0.0; + try + { + Geodesic g = new Geodesic(); + g = new Geodesic(g.MajorRadius, g.Flattening); + arcDistance = g.Direct(32.0, -86.0, 45.0, 20000.0, out finalLatitude, out finalLongitude, + out finalAzimuth, out reducedLength, out M12, out M21, + out S12); + double flat = 0.0, flon = 0.0, faz = 0.0, frd = 0.0, fm12 = 0.0, fm21 = 0.0, fs12 = 0.0, fad = 0.0; + fad = g.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude) + throw new Exception("Geodesic.Direct #1 failed"); + fad = g.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon, out faz); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth) + throw new Exception("Geodesic.Direct #2 failed"); + fad = g.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon, out faz, out frd); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength) + throw new Exception("Geodesic.Direct #3 failed"); + fad = g.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon, out faz, out fm12, out fm21); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || fm12 != M12 || fm21 != M21) + throw new Exception("Geodesic.Direct #4 failed"); + fad = g.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon, out faz, out frd, out fm12, out fm21); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength || fm12 != M12 || fm21 != M21) + throw new Exception("Geodesic.Direct #5 failed"); + double outd = 0.0; + fad = g.GenDirect(32.0, -86.0, 45.0, false, 20000.0, Mask.ALL, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21, out fs12); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength || fm12 != M12 || fm21 != M21 || + outd != 20000.0 || fs12 != S12) + throw new Exception("Geodesic.GenDirect (false) failed"); + g.ArcDirect(32.0, -86.0, 45.0, 1.0, out finalLatitude, out finalLongitude, out finalAzimuth, + out arcDistance, out reducedLength, out M12, out M21, out S12); + g.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon); + if (flat != finalLatitude || flon != finalLongitude) + throw new Exception("Geodesic.ArcDirect #1 failed"); + g.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon, out faz); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth) + throw new Exception("Geodesic.ArcDirect #2 failed"); + g.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon, out faz, out fad); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + fad != arcDistance) + throw new Exception("Geodesic.ArcDirect #3 failed"); + g.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon, out faz, out fad, out frd); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + fad != arcDistance || frd != reducedLength) + throw new Exception("Geodesic.ArcDirect #4 failed"); + g.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon, out faz, out fad, out fm12, out fm21); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + fad != arcDistance || fm12 != M12 || fm21 != M21) + throw new Exception("Geodesic.ArcDirect #5 failed"); + fad = g.GenDirect(32.0, -86.0, 45.0, true, 1.0, Mask.ALL, out flat, out flon, + out faz, out outd, out frd, out fm12, out fm21, out fs12); + if (outd != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength || fm12 != M12 || fm21 != M21 || + fs12 != S12 || fad != 1.0) + throw new Exception("Geodesic.GenDirect (true) failed"); + double initAzimuth = 0.0, iaz = 0.0; + arcDistance = g.Inverse(32.0, -86.0, 33.0, -87.0, out distance, out initAzimuth, out finalAzimuth, + out reducedLength, out M12, out M21, out S12); + fad = g.Inverse(32.0, -86.0, 33.0, -87.0, out outd); + if (fad != arcDistance || outd != distance) + throw new Exception("Geodesic.Inverse #1 failed"); + fad = g.Inverse(32.0, -86.0, 33.0, -87.0, out iaz, out faz); + if (fad != arcDistance || iaz != initAzimuth || faz != finalAzimuth) + throw new Exception("Geodesic.Inverse #2 failed"); + fad = g.Inverse(32.0, -86.0, 33.0, -87.0, out outd, out iaz, out faz); + if (fad != arcDistance || outd != distance || faz != finalAzimuth || + outd != distance) + throw new Exception("Geodesic.Inverse #3 failed"); + fad = g.Inverse(32.0, -86.0, 33.0, -87.0, out outd, out iaz, out faz, out frd); + if (fad != arcDistance || outd != distance || faz != finalAzimuth || + outd != distance || frd != reducedLength) + throw new Exception("Geodesic.Inverse #4 failed"); + fad = g.Inverse(32.0, -86.0, 33.0, -87.0, out outd, out iaz, out faz, out fm12, out fm21 ); + if (fad != arcDistance || outd != distance || faz != finalAzimuth || + outd != distance || fm12 != M12 || fm21 != M21 ) + throw new Exception("Geodesic.Inverse #5 failed"); + fad = g.Inverse(32.0, -86.0, 33.0, -87.0, out outd, out iaz, out faz, out frd, out fm12, out fm21); + if (fad != arcDistance || outd != distance || faz != finalAzimuth || + outd != distance || fm12 != M12 || fm21 != M21 || frd != reducedLength) + throw new Exception("Geodesic.Inverse #6 failed"); + GeodesicLine gl = g.Line(32.0, -86.0, 45.0, Mask.ALL); + gl = new GeodesicLine(32.0, -86.0, 45.0, Mask.ALL); + gl = new GeodesicLine(g, 32.0, -86.0, 45.0, Mask.ALL); + arcDistance = gl.Position(10000.0, out finalLatitude, out finalLongitude, out finalAzimuth, + out reducedLength, out M12, out M21, out S12); + fad = gl.Position(10000.0, out flat, out flon); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude) + throw new Exception("GeodesicLine.Position #1 failed"); + fad = gl.Position(10000.0, out flat, out flon, out faz); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth) + throw new Exception("GeodesicLine.Position #2 failed"); + fad = gl.Position(10000.0, out flat, out flon, out faz, out frd); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength) + throw new Exception("GeodesicLine.Position #3 failed"); + fad = gl.Position(10000.0, out flat, out flon, out faz, out fm12, out fm21); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || fm12 != M12 || fm21 != M21) + throw new Exception("GeodesicLine.Position #4 failed"); + fad = gl.Position(10000.0, out flat, out flon, out faz, out frd, out fm12, out fm21); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || fm12 != M12 || fm21 != M21 || frd != reducedLength ) + throw new Exception("GeodesicLine.Position #5 failed"); + fad = gl.GenPosition(false, 10000.0, Mask.ALL, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21, out fs12); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || outd != 10000.0 || fm12 != M12 || fm21 != M21 || + frd != reducedLength || fs12 != S12 ) + throw new Exception("GeodesicLine.GenPosition (false) failed"); + gl.ArcPosition(1.0, out finalLatitude, out finalLongitude, out finalAzimuth, + out distance, out reducedLength, out M12, out M21, out S12); + gl.ArcPosition(1.0, out flat, out flon); + if (flat != finalLatitude || flon != finalLongitude) + throw new Exception("GeodesicLine.ArcPosition #1 failed"); + gl.ArcPosition(1.0, out flat, out flon, out faz); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth) + throw new Exception("GeodesicLine.ArcPosition #2 failed"); + gl.ArcPosition(1.0, out flat, out flon, out faz, out outd); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + outd != distance) + throw new Exception("GeodesicLine.ArcPosition #3 failed"); + gl.ArcPosition(1.0, out flat, out flon, out faz, out outd, out frd); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + outd != distance || frd != reducedLength) + throw new Exception("GeodesicLine.ArcPosition #4 failed"); + gl.ArcPosition(1.0, out flat, out flon, out faz, out outd, out fm12, out fm21); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + outd != distance || fm12 != M12 || fm21 != M21) + throw new Exception("GeodesicLine.ArcPosition #5 failed"); + gl.ArcPosition(1.0, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + outd != distance || fm12 != M12 || fm21 != M21 || frd != reducedLength) + throw new Exception("GeodesicLine.ArcPosition #6 failed"); + fad = gl.GenPosition(true, 1.0, Mask.ALL, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21, out fs12); + if (fad != 1.0 || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || outd != distance || fm12 != M12 || fm21 != M21 || + frd != reducedLength || fs12 != S12) + throw new Exception("GeodesicLine.GenPosition (false) failed"); + + GeodesicExact ge = new GeodesicExact(); + ge = new GeodesicExact(g.MajorRadius, g.Flattening); + arcDistance = ge.Direct(32.0, -86.0, 45.0, 20000.0, out finalLatitude, out finalLongitude, + out finalAzimuth, out reducedLength, out M12, out M21, + out S12); + fad = ge.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude) + throw new Exception("GeodesicExact.Direct #1 failed"); + fad = ge.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon, out faz); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth) + throw new Exception("GeodesicExact.Direct #2 failed"); + fad = ge.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon, out faz, out frd); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength) + throw new Exception("GeodesicExact.Direct #3 failed"); + fad = ge.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon, out faz, out fm12, out fm21); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || fm12 != M12 || fm21 != M21) + throw new Exception("GeodesicExact.Direct #4 failed"); + fad = ge.Direct(32.0, -86.0, 45.0, 20000.0, out flat, out flon, out faz, out frd, out fm12, out fm21); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength || fm12 != M12 || fm21 != M21) + throw new Exception("GeodesicExact.Direct #5 failed"); + fad = ge.GenDirect(32.0, -86.0, 45.0, false, 20000.0, Mask.ALL, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21, out fs12); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength || fm12 != M12 || fm21 != M21 || + outd != 20000.0 || fs12 != S12) + throw new Exception("GeodesicExact.GenDirect (false) failed"); + ge.ArcDirect(32.0, -86.0, 45.0, 1.0, out finalLatitude, out finalLongitude, out finalAzimuth, + out arcDistance, out reducedLength, out M12, out M21, out S12); + ge.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon); + if (flat != finalLatitude || flon != finalLongitude) + throw new Exception("GeodesicExact.ArcDirect #1 failed"); + ge.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon, out faz); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth) + throw new Exception("GeodesicExact.ArcDirect #2 failed"); + ge.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon, out faz, out fad); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + fad != arcDistance) + throw new Exception("GeodesicExact.ArcDirect #3 failed"); + ge.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon, out faz, out fad, out frd); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + fad != arcDistance || frd != reducedLength) + throw new Exception("GeodesicExact.ArcDirect #4 failed"); + ge.ArcDirect(32.0, -86.0, 45.0, 1.0, out flat, out flon, out faz, out fad, out fm12, out fm21); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + fad != arcDistance || fm12 != M12 || fm21 != M21) + throw new Exception("GeodesicExact.ArcDirect #5 failed"); + fad = ge.GenDirect(32.0, -86.0, 45.0, true, 1.0, Mask.ALL, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21, out fs12); + if (outd != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength || fm12 != M12 || fm21 != M21 || + fad != 1.0 || fs12 != S12) + throw new Exception("GeodesicExact.GenDirect (true) failed"); + arcDistance = ge.Inverse(32.0, -86.0, 33.0, -87.0, out distance, out initAzimuth, out finalAzimuth, + out reducedLength, out M12, out M21, out S12); + fad = ge.Inverse(32.0, -86.0, 33.0, -87.0, out outd); + if (fad != arcDistance || outd != distance) + throw new Exception("GeodesicExact.Inverse #1 failed"); + fad = ge.Inverse(32.0, -86.0, 33.0, -87.0, out iaz, out faz); + if (fad != arcDistance || iaz != initAzimuth || faz != finalAzimuth) + throw new Exception("GeodesicExact.Inverse #2 failed"); + fad = ge.Inverse(32.0, -86.0, 33.0, -87.0, out outd, out iaz, out faz); + if (fad != arcDistance || outd != distance || faz != finalAzimuth || + outd != distance) + throw new Exception("GeodesicExact.Inverse #3 failed"); + fad = ge.Inverse(32.0, -86.0, 33.0, -87.0, out outd, out iaz, out faz, out frd); + if (fad != arcDistance || outd != distance || faz != finalAzimuth || + outd != distance || frd != reducedLength) + throw new Exception("GeodesicExact.Inverse #4 failed"); + fad = ge.Inverse(32.0, -86.0, 33.0, -87.0, out outd, out iaz, out faz, out fm12, out fm21); + if (fad != arcDistance || outd != distance || faz != finalAzimuth || + outd != distance || fm12 != M12 || fm21 != M21) + throw new Exception("GeodesicExact.Inverse #5 failed"); + fad = ge.Inverse(32.0, -86.0, 33.0, -87.0, out outd, out iaz, out faz, out frd, out fm12, out fm21); + if (fad != arcDistance || outd != distance || faz != finalAzimuth || + outd != distance || fm12 != M12 || fm21 != M21 || frd != reducedLength) + throw new Exception("GeodesicExact.Inverse #6 failed"); + GeodesicLineExact gle = ge.Line(32.0, -86.0, 45.0, Mask.ALL); + gle = new GeodesicLineExact(32.0, -86.0, 45.0, Mask.ALL); + gle = new GeodesicLineExact(ge, 32.0, -86.0, 45.0, Mask.ALL); + arcDistance = gle.Position(10000.0, out finalLatitude, out finalLongitude, out finalAzimuth, + out reducedLength, out M12, out M21, out S12); + fad = gle.Position(10000.0, out flat, out flon); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude) + throw new Exception("GeodesicLineExact.Position #1 failed"); + fad = gle.Position(10000.0, out flat, out flon, out faz); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth) + throw new Exception("GeodesicLineExact.Position #2 failed"); + fad = gle.Position(10000.0, out flat, out flon, out faz, out frd); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || frd != reducedLength) + throw new Exception("GeodesicLineExact.Position #3 failed"); + fad = gle.Position(10000.0, out flat, out flon, out faz, out fm12, out fm21); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || fm12 != M12 || fm21 != M21) + throw new Exception("GeodesicLineExact.Position #4 failed"); + fad = gle.Position(10000.0, out flat, out flon, out faz, out frd, out fm12, out fm21); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || fm12 != M12 || fm21 != M21 || frd != reducedLength) + throw new Exception("GeodesicLineExact.Position #5 failed"); + fad = gle.GenPosition(false, 10000.0, Mask.ALL, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21, out fs12); + if (fad != arcDistance || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || outd != 10000.0 || fm12 != M12 || fm21 != M21 || + frd != reducedLength || fs12 != S12) + throw new Exception("GeodesicLineExact.GenPosition (false) failed"); + gle.ArcPosition(1.0, out finalLatitude, out finalLongitude, out finalAzimuth, + out distance, out reducedLength, out M12, out M21, out S12); + gle.ArcPosition(1.0, out flat, out flon); + if (flat != finalLatitude || flon != finalLongitude) + throw new Exception("GeodesicLineExact.ArcPosition #1 failed"); + gle.ArcPosition(1.0, out flat, out flon, out faz); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth) + throw new Exception("GeodesicLineExact.ArcPosition #2 failed"); + gle.ArcPosition(1.0, out flat, out flon, out faz, out outd); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + outd != distance) + throw new Exception("GeodesicLineExact.ArcPosition #3 failed"); + gle.ArcPosition(1.0, out flat, out flon, out faz, out outd, out frd); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + outd != distance || frd != reducedLength) + throw new Exception("GeodesicLineExact.ArcPosition #4 failed"); + gle.ArcPosition(1.0, out flat, out flon, out faz, out outd, out fm12, out fm21); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + outd != distance || fm12 != M12 || fm21 != M21) + throw new Exception("GeodesicLineExact.ArcPosition #5 failed"); + gle.ArcPosition(1.0, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21); + if (flat != finalLatitude || flon != finalLongitude || faz != finalAzimuth || + outd != distance || fm12 != M12 || fm21 != M21 || frd != reducedLength) + throw new Exception("GeodesicLineExact.ArcPosition #6 failed"); + fad = gle.GenPosition(true, 1.0, Mask.ALL, out flat, out flon, out faz, out outd, out frd, out fm12, out fm21, out fs12); + if (fad != 1.0 || flat != finalLatitude || flon != finalLongitude || + faz != finalAzimuth || outd != distance || fm12 != M12 || fm21 != M21 || + frd != reducedLength || fs12 != S12) + throw new Exception("GeodesicLineExact.GenPosition (false) failed"); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Interface Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + MessageBox.Show("No errors detected", "Interfaces OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.resx new file mode 100644 index 000000000..cd3e124e7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeodesicPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.Designer.cs new file mode 100644 index 000000000..32be9329f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.Designer.cs @@ -0,0 +1,441 @@ +namespace Projections +{ + partial class GeoidPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.label1 = new System.Windows.Forms.Label(); + this.m_geoidFileNameTextBox = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.m_threadSafeCheckBox = new System.Windows.Forms.CheckBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.m_dateTimeTextBox = new System.Windows.Forms.TextBox(); + this.m_descriptionTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.m_flatteningTtextBox = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.m_northTextBox = new System.Windows.Forms.TextBox(); + this.m_southTextBox = new System.Windows.Forms.TextBox(); + this.m_eastTextBox = new System.Windows.Forms.TextBox(); + this.m_westTextBox = new System.Windows.Forms.TextBox(); + this.m_cacheButton = new System.Windows.Forms.Button(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_ellipsoidTextBox = new System.Windows.Forms.TextBox(); + this.m_geoidTextBox = new System.Windows.Forms.TextBox(); + this.m_convertEllipsodButton = new System.Windows.Forms.Button(); + this.m_convertGeoidButton = new System.Windows.Forms.Button(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.m_heightButton = new System.Windows.Forms.Button(); + this.m_validateButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 5); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(54, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Geoid File"; + // + // m_geoidFileNameTextBox + // + this.m_geoidFileNameTextBox.Location = new System.Drawing.Point(9, 21); + this.m_geoidFileNameTextBox.Name = "m_geoidFileNameTextBox"; + this.m_geoidFileNameTextBox.Size = new System.Drawing.Size(388, 20); + this.m_geoidFileNameTextBox.TabIndex = 1; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(404, 20); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(25, 23); + this.button1.TabIndex = 2; + this.button1.Text = "..."; + this.m_toolTip.SetToolTip(this.button1, "Select Geoid File"); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnSelectFile); + // + // m_threadSafeCheckBox + // + this.m_threadSafeCheckBox.AutoSize = true; + this.m_threadSafeCheckBox.Location = new System.Drawing.Point(9, 48); + this.m_threadSafeCheckBox.Name = "m_threadSafeCheckBox"; + this.m_threadSafeCheckBox.Size = new System.Drawing.Size(85, 17); + this.m_threadSafeCheckBox.TabIndex = 3; + this.m_threadSafeCheckBox.Text = "Thread Safe"; + this.m_threadSafeCheckBox.UseVisualStyleBackColor = true; + this.m_threadSafeCheckBox.CheckedChanged += new System.EventHandler(this.OnThreadSafe); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(7, 72); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(58, 13); + this.label2.TabIndex = 4; + this.label2.Text = "Date/Time"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(7, 101); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(60, 13); + this.label3.TabIndex = 5; + this.label3.Text = "Description"; + // + // m_dateTimeTextBox + // + this.m_dateTimeTextBox.Location = new System.Drawing.Point(80, 68); + this.m_dateTimeTextBox.Name = "m_dateTimeTextBox"; + this.m_dateTimeTextBox.ReadOnly = true; + this.m_dateTimeTextBox.Size = new System.Drawing.Size(181, 20); + this.m_dateTimeTextBox.TabIndex = 6; + // + // m_descriptionTextBox + // + this.m_descriptionTextBox.Location = new System.Drawing.Point(80, 97); + this.m_descriptionTextBox.Name = "m_descriptionTextBox"; + this.m_descriptionTextBox.ReadOnly = true; + this.m_descriptionTextBox.Size = new System.Drawing.Size(349, 20); + this.m_descriptionTextBox.TabIndex = 7; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(7, 130); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(69, 13); + this.label4.TabIndex = 8; + this.label4.Text = "Major Radius"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(7, 159); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(53, 13); + this.label5.TabIndex = 9; + this.label5.Text = "Flattening"; + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(83, 126); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.ReadOnly = true; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(126, 20); + this.m_majorRadiusTextBox.TabIndex = 10; + // + // m_flatteningTtextBox + // + this.m_flatteningTtextBox.Location = new System.Drawing.Point(83, 155); + this.m_flatteningTtextBox.Name = "m_flatteningTtextBox"; + this.m_flatteningTtextBox.ReadOnly = true; + this.m_flatteningTtextBox.Size = new System.Drawing.Size(126, 20); + this.m_flatteningTtextBox.TabIndex = 11; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(442, 12); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(33, 13); + this.label6.TabIndex = 12; + this.label6.Text = "North"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(442, 38); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(35, 13); + this.label7.TabIndex = 13; + this.label7.Text = "South"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(442, 64); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(28, 13); + this.label8.TabIndex = 14; + this.label8.Text = "East"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(442, 90); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(32, 13); + this.label9.TabIndex = 15; + this.label9.Text = "West"; + // + // m_northTextBox + // + this.m_northTextBox.Location = new System.Drawing.Point(482, 8); + this.m_northTextBox.Name = "m_northTextBox"; + this.m_northTextBox.Size = new System.Drawing.Size(100, 20); + this.m_northTextBox.TabIndex = 16; + // + // m_southTextBox + // + this.m_southTextBox.Location = new System.Drawing.Point(482, 34); + this.m_southTextBox.Name = "m_southTextBox"; + this.m_southTextBox.Size = new System.Drawing.Size(100, 20); + this.m_southTextBox.TabIndex = 17; + // + // m_eastTextBox + // + this.m_eastTextBox.Location = new System.Drawing.Point(482, 60); + this.m_eastTextBox.Name = "m_eastTextBox"; + this.m_eastTextBox.Size = new System.Drawing.Size(100, 20); + this.m_eastTextBox.TabIndex = 18; + // + // m_westTextBox + // + this.m_westTextBox.Location = new System.Drawing.Point(482, 86); + this.m_westTextBox.Name = "m_westTextBox"; + this.m_westTextBox.Size = new System.Drawing.Size(100, 20); + this.m_westTextBox.TabIndex = 19; + // + // m_cacheButton + // + this.m_cacheButton.Location = new System.Drawing.Point(492, 113); + this.m_cacheButton.Name = "m_cacheButton"; + this.m_cacheButton.Size = new System.Drawing.Size(75, 23); + this.m_cacheButton.TabIndex = 20; + this.m_cacheButton.Text = "Cache"; + this.m_toolTip.SetToolTip(this.m_cacheButton, "Cache Geoid Data"); + this.m_cacheButton.UseVisualStyleBackColor = true; + this.m_cacheButton.Click += new System.EventHandler(this.OnCache); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(606, 63); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(113, 13); + this.label10.TabIndex = 21; + this.label10.Text = "Height Above Ellipsoid"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(754, 63); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(102, 13); + this.label11.TabIndex = 22; + this.label11.Text = "Height above Geoid"; + // + // m_ellipsoidTextBox + // + this.m_ellipsoidTextBox.Location = new System.Drawing.Point(596, 85); + this.m_ellipsoidTextBox.Name = "m_ellipsoidTextBox"; + this.m_ellipsoidTextBox.Size = new System.Drawing.Size(132, 20); + this.m_ellipsoidTextBox.TabIndex = 23; + // + // m_geoidTextBox + // + this.m_geoidTextBox.Location = new System.Drawing.Point(739, 85); + this.m_geoidTextBox.Name = "m_geoidTextBox"; + this.m_geoidTextBox.Size = new System.Drawing.Size(132, 20); + this.m_geoidTextBox.TabIndex = 24; + // + // m_convertEllipsodButton + // + this.m_convertEllipsodButton.Enabled = false; + this.m_convertEllipsodButton.Location = new System.Drawing.Point(625, 109); + this.m_convertEllipsodButton.Name = "m_convertEllipsodButton"; + this.m_convertEllipsodButton.Size = new System.Drawing.Size(75, 23); + this.m_convertEllipsodButton.TabIndex = 25; + this.m_convertEllipsodButton.Text = "Convert ->"; + this.m_toolTip.SetToolTip(this.m_convertEllipsodButton, "Convert Ellipsod Height to Geoid Height"); + this.m_convertEllipsodButton.UseVisualStyleBackColor = true; + this.m_convertEllipsodButton.Click += new System.EventHandler(this.OnConvertEllipsod); + // + // m_convertGeoidButton + // + this.m_convertGeoidButton.Enabled = false; + this.m_convertGeoidButton.Location = new System.Drawing.Point(768, 109); + this.m_convertGeoidButton.Name = "m_convertGeoidButton"; + this.m_convertGeoidButton.Size = new System.Drawing.Size(75, 23); + this.m_convertGeoidButton.TabIndex = 26; + this.m_convertGeoidButton.Text = "<- Convert"; + this.m_toolTip.SetToolTip(this.m_convertGeoidButton, "Convert Geoid Height to Ellipsoid Height"); + this.m_convertGeoidButton.UseVisualStyleBackColor = true; + this.m_convertGeoidButton.Click += new System.EventHandler(this.OnConvertGeoid); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(593, 12); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(45, 13); + this.label12.TabIndex = 27; + this.label12.Text = "Latitude"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(593, 38); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(54, 13); + this.label13.TabIndex = 28; + this.label13.Text = "Longitude"; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(653, 8); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_latitudeTextBox.TabIndex = 29; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(653, 34); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_longitudeTextBox.TabIndex = 30; + // + // m_heightButton + // + this.m_heightButton.Enabled = false; + this.m_heightButton.Location = new System.Drawing.Point(768, 18); + this.m_heightButton.Name = "m_heightButton"; + this.m_heightButton.Size = new System.Drawing.Size(75, 23); + this.m_heightButton.TabIndex = 31; + this.m_heightButton.Text = "Height"; + this.m_toolTip.SetToolTip(this.m_heightButton, "Calculate Geoid Height at Longitude/Latitude"); + this.m_heightButton.UseVisualStyleBackColor = true; + this.m_heightButton.Click += new System.EventHandler(this.OnHeight); + // + // m_validateButton + // + this.m_validateButton.Enabled = false; + this.m_validateButton.Location = new System.Drawing.Point(638, 148); + this.m_validateButton.Name = "m_validateButton"; + this.m_validateButton.Size = new System.Drawing.Size(75, 23); + this.m_validateButton.TabIndex = 32; + this.m_validateButton.Text = "Validate"; + this.m_validateButton.UseVisualStyleBackColor = true; + this.m_validateButton.Click += new System.EventHandler(this.OnValidate); + // + // GeoidPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.m_validateButton); + this.Controls.Add(this.m_heightButton); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.label13); + this.Controls.Add(this.label12); + this.Controls.Add(this.m_convertGeoidButton); + this.Controls.Add(this.m_convertEllipsodButton); + this.Controls.Add(this.m_geoidTextBox); + this.Controls.Add(this.m_ellipsoidTextBox); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.m_cacheButton); + this.Controls.Add(this.m_westTextBox); + this.Controls.Add(this.m_eastTextBox); + this.Controls.Add(this.m_southTextBox); + this.Controls.Add(this.m_northTextBox); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.m_flatteningTtextBox); + this.Controls.Add(this.m_majorRadiusTextBox); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.m_descriptionTextBox); + this.Controls.Add(this.m_dateTimeTextBox); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.m_threadSafeCheckBox); + this.Controls.Add(this.button1); + this.Controls.Add(this.m_geoidFileNameTextBox); + this.Controls.Add(this.label1); + this.Name = "GeoidPanel"; + this.Size = new System.Drawing.Size(1002, 273); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_geoidFileNameTextBox; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.CheckBox m_threadSafeCheckBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox m_dateTimeTextBox; + private System.Windows.Forms.TextBox m_descriptionTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.TextBox m_flatteningTtextBox; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox m_northTextBox; + private System.Windows.Forms.TextBox m_southTextBox; + private System.Windows.Forms.TextBox m_eastTextBox; + private System.Windows.Forms.TextBox m_westTextBox; + private System.Windows.Forms.Button m_cacheButton; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox m_ellipsoidTextBox; + private System.Windows.Forms.TextBox m_geoidTextBox; + private System.Windows.Forms.Button m_convertEllipsodButton; + private System.Windows.Forms.Button m_convertGeoidButton; + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.Button m_heightButton; + private System.Windows.Forms.Button m_validateButton; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.cs new file mode 100644 index 000000000..7a1a7d550 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.cs @@ -0,0 +1,170 @@ +/** + * \file NETGeographicLib\GeoidPanel.cs + * \brief NETGeographicLib.Geoid example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +using System.IO; + +namespace Projections +{ + public partial class GeoidPanel : UserControl + { + Geoid m_geoid = null; + string m_path; + string m_fileName; + + public GeoidPanel() + { + InitializeComponent(); + m_threadSafeCheckBox.Checked = true; + } + + private void OnSelectFile(object sender, EventArgs e) + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Geoid File (*.pgm)|*.pgm"; + dlg.DefaultExt = "pgm"; + dlg.Title = "Open Geoid File"; + + if (dlg.ShowDialog() == DialogResult.Cancel) return; + + m_path = dlg.FileName.Substring(0, dlg.FileName.LastIndexOf('\\')).Replace('\\', '/'); + int length = dlg.FileName.LastIndexOf('.') - dlg.FileName.LastIndexOf('\\') - 1; + m_fileName = dlg.FileName.Substring(dlg.FileName.LastIndexOf('\\') + 1, length); + + try + { + m_geoid = new Geoid(m_fileName, m_path, true, m_threadSafeCheckBox.Checked); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + m_convertEllipsodButton.Enabled = m_convertGeoidButton.Enabled = m_heightButton.Enabled = m_validateButton.Enabled = true; + m_geoidFileNameTextBox.Text = dlg.FileName; + m_dateTimeTextBox.Text = m_geoid.DateTime; + m_descriptionTextBox.Text = m_geoid.Description; + m_majorRadiusTextBox.Text = m_geoid.MajorRadius.ToString(); + m_flatteningTtextBox.Text = m_geoid.Flattening.ToString(); + } + + private void OnThreadSafe(object sender, EventArgs e) + { + if (m_geoidFileNameTextBox.Text.Length > 0) + { + try + { + m_geoid = new Geoid(m_fileName, m_path, true, m_threadSafeCheckBox.Checked); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + } + m_cacheButton.Enabled = !m_threadSafeCheckBox.Checked; + m_northTextBox.ReadOnly = m_southTextBox.ReadOnly = m_eastTextBox.ReadOnly = m_westTextBox.ReadOnly = m_threadSafeCheckBox.Checked; + } + + private void OnCache(object sender, EventArgs e) + { + if (m_geoid == null) return; + + try + { + double south = Double.Parse(m_southTextBox.Text); + double north = Double.Parse(m_northTextBox.Text); + double west = Double.Parse(m_westTextBox.Text); + double east = Double.Parse(m_eastTextBox.Text); + m_geoid.CacheArea(south, west, north, east); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnConvertEllipsod(object sender, EventArgs e) + { + try + { + double lat = Double.Parse(m_latitudeTextBox.Text); + double lon = Double.Parse(m_longitudeTextBox.Text); + double h = Double.Parse(m_ellipsoidTextBox.Text); + m_geoidTextBox.Text = m_geoid.ConvertHeight(lat, lon, h, Geoid.ConvertFlag.ELLIPSOIDTOGEOID).ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnConvertGeoid(object sender, EventArgs e) + { + try + { + double lat = Double.Parse(m_latitudeTextBox.Text); + double lon = Double.Parse(m_longitudeTextBox.Text); + double h = Double.Parse(m_geoidTextBox.Text); + m_ellipsoidTextBox.Text = m_geoid.ConvertHeight(lat, lon, h, Geoid.ConvertFlag.GEOIDTOELLIPSOID).ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnHeight(object sender, EventArgs e) + { + try + { + double lat = Double.Parse(m_latitudeTextBox.Text); + double lon = Double.Parse(m_longitudeTextBox.Text); + m_ellipsoidTextBox.Text = m_geoid.Height(lat, lon).ToString(); + m_geoidTextBox.Text = "0"; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + Geoid g = new Geoid(m_fileName, m_path, false, false); + g.CacheArea(20.0, -30.0, 30.0, -20.0); + g.CacheAll(); + double gradx, grady; + double h1 = g.Height(32.0, -60.0, out gradx, out grady); + double h2 = g.Height(32.0, -60.0); + if (h1 != h2) + throw new Exception("Error in Geoid.Height"); + g.ConvertHeight(32.0, -60.0, 100.0, Geoid.ConvertFlag.ELLIPSOIDTOGEOID); + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.resx new file mode 100644 index 000000000..3ec30e045 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GeoidPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.Designer.cs new file mode 100644 index 000000000..cfd8781d5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.Designer.cs @@ -0,0 +1,382 @@ +namespace Projections +{ + partial class GravityPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.button1 = new System.Windows.Forms.Button(); + this.m_updateButton = new System.Windows.Forms.Button(); + this.m_gravityModelNameTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.m_nameTextBox = new System.Windows.Forms.TextBox(); + this.m_descriptionTextBox = new System.Windows.Forms.TextBox(); + this.m_dateTextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.m_longitudetextBoxT = new System.Windows.Forms.TextBox(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_altitudeTextBox = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_accelXTextBox = new System.Windows.Forms.TextBox(); + this.m_accelYTextBox = new System.Windows.Forms.TextBox(); + this.m_accelZTextBox = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.m_geoidTextBox = new System.Windows.Forms.TextBox(); + this.m_normGravButton = new System.Windows.Forms.Button(); + this.m_GravityCircleButton = new System.Windows.Forms.Button(); + this.m_validateButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(391, 21); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(29, 23); + this.button1.TabIndex = 2; + this.button1.Text = "..."; + this.toolTip1.SetToolTip(this.button1, "Select gravity model file"); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnSelectGravityModel); + // + // m_updateButton + // + this.m_updateButton.Enabled = false; + this.m_updateButton.Location = new System.Drawing.Point(565, 106); + this.m_updateButton.Name = "m_updateButton"; + this.m_updateButton.Size = new System.Drawing.Size(75, 23); + this.m_updateButton.TabIndex = 24; + this.m_updateButton.Text = "Update"; + this.toolTip1.SetToolTip(this.m_updateButton, "Calculate acceleration and geoid height"); + this.m_updateButton.UseVisualStyleBackColor = true; + this.m_updateButton.Click += new System.EventHandler(this.OnUpdate); + // + // m_gravityModelNameTextBox + // + this.m_gravityModelNameTextBox.Location = new System.Drawing.Point(7, 22); + this.m_gravityModelNameTextBox.Name = "m_gravityModelNameTextBox"; + this.m_gravityModelNameTextBox.Size = new System.Drawing.Size(377, 20); + this.m_gravityModelNameTextBox.TabIndex = 0; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(4, 6); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(72, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Gravity Model"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(7, 52); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 13); + this.label2.TabIndex = 3; + this.label2.Text = "Name"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(10, 79); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(60, 13); + this.label3.TabIndex = 4; + this.label3.Text = "Description"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(13, 106); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(30, 13); + this.label4.TabIndex = 5; + this.label4.Text = "Date"; + // + // m_nameTextBox + // + this.m_nameTextBox.Location = new System.Drawing.Point(85, 48); + this.m_nameTextBox.Name = "m_nameTextBox"; + this.m_nameTextBox.ReadOnly = true; + this.m_nameTextBox.Size = new System.Drawing.Size(299, 20); + this.m_nameTextBox.TabIndex = 6; + // + // m_descriptionTextBox + // + this.m_descriptionTextBox.Location = new System.Drawing.Point(85, 75); + this.m_descriptionTextBox.Name = "m_descriptionTextBox"; + this.m_descriptionTextBox.ReadOnly = true; + this.m_descriptionTextBox.Size = new System.Drawing.Size(299, 20); + this.m_descriptionTextBox.TabIndex = 7; + // + // m_dateTextBox + // + this.m_dateTextBox.Location = new System.Drawing.Point(85, 102); + this.m_dateTextBox.Name = "m_dateTextBox"; + this.m_dateTextBox.ReadOnly = true; + this.m_dateTextBox.Size = new System.Drawing.Size(299, 20); + this.m_dateTextBox.TabIndex = 8; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(433, 32); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(101, 13); + this.label5.TabIndex = 9; + this.label5.Text = "Longitude (degrees)"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(433, 58); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(92, 13); + this.label6.TabIndex = 10; + this.label6.Text = "Latitude (degrees)"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(433, 84); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(82, 13); + this.label7.TabIndex = 11; + this.label7.Text = "Altitude (meters)"; + // + // m_longitudetextBoxT + // + this.m_longitudetextBoxT.Location = new System.Drawing.Point(539, 28); + this.m_longitudetextBoxT.Name = "m_longitudetextBoxT"; + this.m_longitudetextBoxT.Size = new System.Drawing.Size(126, 20); + this.m_longitudetextBoxT.TabIndex = 12; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(539, 54); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(126, 20); + this.m_latitudeTextBox.TabIndex = 13; + // + // m_altitudeTextBox + // + this.m_altitudeTextBox.Location = new System.Drawing.Point(539, 80); + this.m_altitudeTextBox.Name = "m_altitudeTextBox"; + this.m_altitudeTextBox.Size = new System.Drawing.Size(126, 20); + this.m_altitudeTextBox.TabIndex = 14; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(670, 32); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(14, 13); + this.label8.TabIndex = 15; + this.label8.Text = "X"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(670, 58); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(14, 13); + this.label9.TabIndex = 16; + this.label9.Text = "Y"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(670, 84); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(14, 13); + this.label10.TabIndex = 17; + this.label10.Text = "Z"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(700, 6); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(105, 13); + this.label11.TabIndex = 18; + this.label11.Text = "Acceleration (m/s^2)"; + // + // m_accelXTextBox + // + this.m_accelXTextBox.Location = new System.Drawing.Point(691, 28); + this.m_accelXTextBox.Name = "m_accelXTextBox"; + this.m_accelXTextBox.ReadOnly = true; + this.m_accelXTextBox.Size = new System.Drawing.Size(122, 20); + this.m_accelXTextBox.TabIndex = 19; + // + // m_accelYTextBox + // + this.m_accelYTextBox.Location = new System.Drawing.Point(690, 54); + this.m_accelYTextBox.Name = "m_accelYTextBox"; + this.m_accelYTextBox.ReadOnly = true; + this.m_accelYTextBox.Size = new System.Drawing.Size(122, 20); + this.m_accelYTextBox.TabIndex = 20; + // + // m_accelZTextBox + // + this.m_accelZTextBox.Location = new System.Drawing.Point(691, 80); + this.m_accelZTextBox.Name = "m_accelZTextBox"; + this.m_accelZTextBox.ReadOnly = true; + this.m_accelZTextBox.Size = new System.Drawing.Size(122, 20); + this.m_accelZTextBox.TabIndex = 21; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(709, 106); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(86, 13); + this.label12.TabIndex = 22; + this.label12.Text = "Geoid Height (m)"; + // + // m_geoidTextBox + // + this.m_geoidTextBox.Location = new System.Drawing.Point(691, 125); + this.m_geoidTextBox.Name = "m_geoidTextBox"; + this.m_geoidTextBox.ReadOnly = true; + this.m_geoidTextBox.Size = new System.Drawing.Size(122, 20); + this.m_geoidTextBox.TabIndex = 23; + // + // m_normGravButton + // + this.m_normGravButton.Enabled = false; + this.m_normGravButton.Location = new System.Drawing.Point(544, 135); + this.m_normGravButton.Name = "m_normGravButton"; + this.m_normGravButton.Size = new System.Drawing.Size(117, 42); + this.m_normGravButton.TabIndex = 25; + this.m_normGravButton.Text = "Acceleration using NormalGravity"; + this.m_normGravButton.UseVisualStyleBackColor = true; + this.m_normGravButton.Click += new System.EventHandler(this.OnNormGravity); + // + // m_GravityCircleButton + // + this.m_GravityCircleButton.Enabled = false; + this.m_GravityCircleButton.Location = new System.Drawing.Point(403, 135); + this.m_GravityCircleButton.Name = "m_GravityCircleButton"; + this.m_GravityCircleButton.Size = new System.Drawing.Size(131, 54); + this.m_GravityCircleButton.TabIndex = 26; + this.m_GravityCircleButton.Text = "Acceleration and geoid height using GravityCircle"; + this.m_GravityCircleButton.UseVisualStyleBackColor = true; + this.m_GravityCircleButton.Click += new System.EventHandler(this.OnGravityCircle); + // + // m_validateButton + // + this.m_validateButton.Enabled = false; + this.m_validateButton.Location = new System.Drawing.Point(43, 145); + this.m_validateButton.Name = "m_validateButton"; + this.m_validateButton.Size = new System.Drawing.Size(75, 23); + this.m_validateButton.TabIndex = 27; + this.m_validateButton.Text = "Validate"; + this.m_validateButton.UseVisualStyleBackColor = true; + this.m_validateButton.Click += new System.EventHandler(this.OnValidate); + // + // GravityPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.m_validateButton); + this.Controls.Add(this.m_GravityCircleButton); + this.Controls.Add(this.m_normGravButton); + this.Controls.Add(this.m_updateButton); + this.Controls.Add(this.m_geoidTextBox); + this.Controls.Add(this.label12); + this.Controls.Add(this.m_accelZTextBox); + this.Controls.Add(this.m_accelYTextBox); + this.Controls.Add(this.m_accelXTextBox); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.m_altitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.m_longitudetextBoxT); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.m_dateTextBox); + this.Controls.Add(this.m_descriptionTextBox); + this.Controls.Add(this.m_nameTextBox); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Controls.Add(this.m_gravityModelNameTextBox); + this.Name = "GravityPanel"; + this.Size = new System.Drawing.Size(1083, 403); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.TextBox m_gravityModelNameTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox m_nameTextBox; + private System.Windows.Forms.TextBox m_descriptionTextBox; + private System.Windows.Forms.TextBox m_dateTextBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox m_longitudetextBoxT; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_altitudeTextBox; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox m_accelXTextBox; + private System.Windows.Forms.TextBox m_accelYTextBox; + private System.Windows.Forms.TextBox m_accelZTextBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.TextBox m_geoidTextBox; + private System.Windows.Forms.Button m_updateButton; + private System.Windows.Forms.Button m_normGravButton; + private System.Windows.Forms.Button m_GravityCircleButton; + private System.Windows.Forms.Button m_validateButton; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.cs new file mode 100644 index 000000000..8e4d5ba3d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.cs @@ -0,0 +1,188 @@ +/** + * \file NETGeographicLib\GravityPanel.cs + * \brief NETGeographicLib.GravityModel example + * + * NETGeographicLib.GravityModel, + * NETGeographicLib.NormalGravity, and + * NETGeographicLib.GravityCircle example. + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class GravityPanel : UserControl + { + GravityModel m_gm = null; + string m_path; + string m_name; + public GravityPanel() + { + InitializeComponent(); + } + + private void OnSelectGravityModel(object sender, EventArgs e) + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Gravity Model (*.egm)|*.egm"; + dlg.DefaultExt = "egm"; + + if (dlg.ShowDialog() == DialogResult.Cancel) return; + + m_path = dlg.FileName.Substring(0, dlg.FileName.LastIndexOf('\\')).Replace('\\', '/'); + int length = dlg.FileName.LastIndexOf('.') - dlg.FileName.LastIndexOf('\\') - 1; + m_name = dlg.FileName.Substring(dlg.FileName.LastIndexOf('\\') + 1, length); + + try + { + m_gm = new GravityModel(m_name, m_path); + m_gravityModelNameTextBox.Text = dlg.FileName; + m_nameTextBox.Text = m_gm.GravityModelName; + m_descriptionTextBox.Text = m_gm.Description; + m_dateTextBox.Text = m_gm.DateTime; + m_updateButton.Enabled = true; + m_normGravButton.Enabled = true; + m_GravityCircleButton.Enabled = true; + m_validateButton.Enabled = true; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnUpdate(object sender, EventArgs e) + { + Cursor = Cursors.WaitCursor; + try + { + double lon = Double.Parse(m_longitudetextBoxT.Text); + double lat = Double.Parse(m_latitudeTextBox.Text); + double alt = Double.Parse(m_altitudeTextBox.Text); + + double gx, gy, gz; + m_gm.Gravity(lat, lon, alt, out gx, out gy, out gz); + m_accelXTextBox.Text = gx.ToString(); + m_accelYTextBox.Text = gy.ToString(); + m_accelZTextBox.Text = gz.ToString(); + m_geoidTextBox.Text = m_gm.GeoidHeight(lat, lon).ToString(); + Cursor = Cursors.Default; + } + catch (Exception xcpt) + { + Cursor = Cursors.Default; + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnNormGravity(object sender, EventArgs e) + { + try + { + double lat = Double.Parse(m_latitudeTextBox.Text); + double alt = Double.Parse(m_altitudeTextBox.Text); + + double gx, gz; + NormalGravity ng = m_gm.ReferenceEllipsoid(); + ng.Gravity(lat, alt, out gx, out gz); + m_accelXTextBox.Text = gx.ToString(); + m_accelYTextBox.Text = "0.0"; + m_accelZTextBox.Text = gz.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + } + + private void OnGravityCircle(object sender, EventArgs e) + { + Cursor = Cursors.WaitCursor; + try + { + double lon = Double.Parse(m_longitudetextBoxT.Text); + double lat = Double.Parse(m_latitudeTextBox.Text); + double alt = Double.Parse(m_altitudeTextBox.Text); + + double gx, gy, gz; + GravityCircle gc = m_gm.Circle(lat, alt, GravityModel.Mask.GEOID_HEIGHT|GravityModel.Mask.GRAVITY); + gc.Gravity(lon, out gx, out gy, out gz); + m_accelXTextBox.Text = gx.ToString(); + m_accelYTextBox.Text = gy.ToString(); + m_accelZTextBox.Text = gz.ToString(); + if (alt != 0.0) + MessageBox.Show("Geoid height cannot be calculated with GravityCircle if altitude is not 0", "", MessageBoxButtons.OK, MessageBoxIcon.Information); + else + m_geoidTextBox.Text = gc.GeoidHeight(lon).ToString(); + Cursor = Cursors.Default; + } + catch (Exception xcpt) + { + Cursor = Cursors.Default; + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + double lon = -86.0; + double lat = 32.0; + double alt = 0.0; + + double x, y, z; + GravityModel gm = new GravityModel(m_name,m_path); + gm.Disturbance( lat, lon, alt, out x, out y, out z); + gm.GeoidHeight(lat,lon); + gm.Gravity(lat,lon,alt,out x,out y, out z); + gm.Phi(5000000.0,5000000.0,out x,out y); + gm.SphericalAnomaly(lat,lon,alt,out x, out y, out z); + gm.T(5000000.0,5000000.0,5000000.0); + gm.U(5000000.0,5000000.0,5000000.0,out x,out y,out z); + gm.V(5000000.0,5000000.0,5000000.0,out x,out y,out z); + gm.W(5000000.0,5000000.0,5000000.0,out x,out y,out z); + NormalGravity ng = new NormalGravity(NormalGravity.StandardModels.GRS80); + ng = new NormalGravity( NormalGravity.StandardModels.WGS84); + ng = new NormalGravity(6378137.0,3.986005e+14,7.292115147e-5,-1.0,1.08263e-3); + ng = gm.ReferenceEllipsoid(); + ng.DynamicalFormFactor(1); + Geocentric geo = ng.Earth(); + ng.Gravity(lat,alt,out x, out z); + ng.Phi(5000000.0,5000000.0,out x,out y); + ng.SurfaceGravity(lat); + ng.U(5000000.0,5000000.0,5000000.0,out x, out y, out z); + ng.V0(5000000.0,5000000.0,5000000.0,out x, out y, out z); + GravityCircle gc = gm.Circle(lat,0.0,GravityModel.Mask.ALL); + gc.Capabilities(); + gc.Capabilities(GravityModel.Mask.GRAVITY); + gc.Disturbance(lon, out x, out y, out z); + gc.GeoidHeight(lon); + gc.Gravity(lon, out x, out y, out z); + gc.SphericalAnomaly(lon, out x, out y, out z); + gc.T(lon); + gc.V(lon, out x, out y, out z); + gc.W(lon, out x, out y, out z); + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.resx new file mode 100644 index 000000000..749de3c20 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/GravityPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.Designer.cs new file mode 100644 index 000000000..3a3958f49 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.Designer.cs @@ -0,0 +1,520 @@ +namespace Projections +{ + partial class LocalCartesianPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.m_setButton = new System.Windows.Forms.Button(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.m_flatteningTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.m_altitudeTextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_latTextBox = new System.Windows.Forms.TextBox(); + this.m_lonTextBox = new System.Windows.Forms.TextBox(); + this.m_altTextBox = new System.Windows.Forms.TextBox(); + this.m_XTextBox = new System.Windows.Forms.TextBox(); + this.m_YTextBox = new System.Windows.Forms.TextBox(); + this.m_ZTextBox = new System.Windows.Forms.TextBox(); + this.m_functionComboBox = new System.Windows.Forms.ComboBox(); + this.label12 = new System.Windows.Forms.Label(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.m_textBox22 = new System.Windows.Forms.TextBox(); + this.m_textBox20 = new System.Windows.Forms.TextBox(); + this.m_textBox21 = new System.Windows.Forms.TextBox(); + this.m_textBox12 = new System.Windows.Forms.TextBox(); + this.m_textBox10 = new System.Windows.Forms.TextBox(); + this.m_textBox11 = new System.Windows.Forms.TextBox(); + this.m_textBox02 = new System.Windows.Forms.TextBox(); + this.m_textBox00 = new System.Windows.Forms.TextBox(); + this.m_textBox01 = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.SuspendLayout(); + // + // m_setButton + // + this.m_setButton.Location = new System.Drawing.Point(12, 107); + this.m_setButton.Name = "m_setButton"; + this.m_setButton.Size = new System.Drawing.Size(75, 23); + this.m_setButton.TabIndex = 4; + this.m_setButton.Text = "Set"; + this.m_toolTip.SetToolTip(this.m_setButton, "Sets the Ellipsoid Parameters"); + this.m_setButton.UseVisualStyleBackColor = true; + this.m_setButton.Click += new System.EventHandler(this.OnSetEllipsoid); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(16, 150); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 6; + this.button1.Text = "Set"; + this.m_toolTip.SetToolTip(this.button1, "Sets the reference coordinates"); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnSetReference); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(517, 163); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 22; + this.button2.Text = "Convert"; + this.m_toolTip.SetToolTip(this.button2, "Executes the current function"); + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnConvert); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.m_setButton); + this.groupBox1.Controls.Add(this.m_flatteningTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.m_majorRadiusTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(146, 140); + this.groupBox1.TabIndex = 6; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Ellipsoid Parameters"; + // + // m_flatteningTextBox + // + this.m_flatteningTextBox.Location = new System.Drawing.Point(12, 83); + this.m_flatteningTextBox.Name = "m_flatteningTextBox"; + this.m_flatteningTextBox.Size = new System.Drawing.Size(125, 20); + this.m_flatteningTextBox.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(109, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Major Radius (meters)"; + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(12, 42); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(125, 20); + this.m_majorRadiusTextBox.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Flattening"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.button1); + this.groupBox2.Controls.Add(this.m_altitudeTextBox); + this.groupBox2.Controls.Add(this.label5); + this.groupBox2.Controls.Add(this.m_longitudeTextBox); + this.groupBox2.Controls.Add(this.label4); + this.groupBox2.Controls.Add(this.m_latitudeTextBox); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Location = new System.Drawing.Point(155, 6); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(128, 178); + this.groupBox2.TabIndex = 7; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Origin"; + // + // m_altitudeTextBox + // + this.m_altitudeTextBox.Location = new System.Drawing.Point(16, 123); + this.m_altitudeTextBox.Name = "m_altitudeTextBox"; + this.m_altitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_altitudeTextBox.TabIndex = 5; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(13, 106); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(82, 13); + this.label5.TabIndex = 4; + this.label5.Text = "Altitude (meters)"; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(13, 79); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_longitudeTextBox.TabIndex = 3; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(10, 63); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(101, 13); + this.label4.TabIndex = 2; + this.label4.Text = "Longitude (degrees)"; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(10, 38); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_latitudeTextBox.TabIndex = 1; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(7, 22); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(92, 13); + this.label3.TabIndex = 0; + this.label3.Text = "Latitude (degrees)"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(295, 10); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(92, 13); + this.label6.TabIndex = 8; + this.label6.Text = "Latitude (degrees)"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(295, 36); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(101, 13); + this.label7.TabIndex = 9; + this.label7.Text = "Longitude (degrees)"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(295, 62); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(82, 13); + this.label8.TabIndex = 10; + this.label8.Text = "Altitude (meters)"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(295, 88); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(54, 13); + this.label9.TabIndex = 11; + this.label9.Text = "X (meters)"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(295, 114); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(54, 13); + this.label10.TabIndex = 12; + this.label10.Text = "Y (meters)"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(295, 140); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(54, 13); + this.label11.TabIndex = 13; + this.label11.Text = "Z (meters)"; + // + // m_latTextBox + // + this.m_latTextBox.Location = new System.Drawing.Point(405, 6); + this.m_latTextBox.Name = "m_latTextBox"; + this.m_latTextBox.Size = new System.Drawing.Size(100, 20); + this.m_latTextBox.TabIndex = 14; + // + // m_lonTextBox + // + this.m_lonTextBox.Location = new System.Drawing.Point(405, 32); + this.m_lonTextBox.Name = "m_lonTextBox"; + this.m_lonTextBox.Size = new System.Drawing.Size(100, 20); + this.m_lonTextBox.TabIndex = 15; + // + // m_altTextBox + // + this.m_altTextBox.Location = new System.Drawing.Point(405, 58); + this.m_altTextBox.Name = "m_altTextBox"; + this.m_altTextBox.Size = new System.Drawing.Size(100, 20); + this.m_altTextBox.TabIndex = 16; + // + // m_XTextBox + // + this.m_XTextBox.Location = new System.Drawing.Point(405, 84); + this.m_XTextBox.Name = "m_XTextBox"; + this.m_XTextBox.Size = new System.Drawing.Size(100, 20); + this.m_XTextBox.TabIndex = 17; + // + // m_YTextBox + // + this.m_YTextBox.Location = new System.Drawing.Point(405, 110); + this.m_YTextBox.Name = "m_YTextBox"; + this.m_YTextBox.Size = new System.Drawing.Size(100, 20); + this.m_YTextBox.TabIndex = 18; + // + // m_ZTextBox + // + this.m_ZTextBox.Location = new System.Drawing.Point(405, 136); + this.m_ZTextBox.Name = "m_ZTextBox"; + this.m_ZTextBox.Size = new System.Drawing.Size(100, 20); + this.m_ZTextBox.TabIndex = 19; + // + // m_functionComboBox + // + this.m_functionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_functionComboBox.FormattingEnabled = true; + this.m_functionComboBox.Items.AddRange(new object[] { + "Forward", + "Reverse"}); + this.m_functionComboBox.Location = new System.Drawing.Point(405, 163); + this.m_functionComboBox.Name = "m_functionComboBox"; + this.m_functionComboBox.Size = new System.Drawing.Size(100, 21); + this.m_functionComboBox.TabIndex = 20; + this.m_functionComboBox.SelectedIndexChanged += new System.EventHandler(this.OnNewFunction); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(295, 167); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(48, 13); + this.label12.TabIndex = 21; + this.label12.Text = "Function"; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.m_textBox22); + this.groupBox3.Controls.Add(this.m_textBox20); + this.groupBox3.Controls.Add(this.m_textBox21); + this.groupBox3.Controls.Add(this.m_textBox12); + this.groupBox3.Controls.Add(this.m_textBox10); + this.groupBox3.Controls.Add(this.m_textBox11); + this.groupBox3.Controls.Add(this.m_textBox02); + this.groupBox3.Controls.Add(this.m_textBox00); + this.groupBox3.Controls.Add(this.m_textBox01); + this.groupBox3.Location = new System.Drawing.Point(511, 10); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(325, 99); + this.groupBox3.TabIndex = 25; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Rotation Matrix"; + // + // m_textBox22 + // + this.m_textBox22.Location = new System.Drawing.Point(218, 74); + this.m_textBox22.Name = "m_textBox22"; + this.m_textBox22.ReadOnly = true; + this.m_textBox22.Size = new System.Drawing.Size(100, 20); + this.m_textBox22.TabIndex = 30; + // + // m_textBox20 + // + this.m_textBox20.Location = new System.Drawing.Point(6, 74); + this.m_textBox20.Name = "m_textBox20"; + this.m_textBox20.ReadOnly = true; + this.m_textBox20.Size = new System.Drawing.Size(100, 20); + this.m_textBox20.TabIndex = 28; + // + // m_textBox21 + // + this.m_textBox21.Location = new System.Drawing.Point(112, 74); + this.m_textBox21.Name = "m_textBox21"; + this.m_textBox21.ReadOnly = true; + this.m_textBox21.Size = new System.Drawing.Size(100, 20); + this.m_textBox21.TabIndex = 29; + // + // m_textBox12 + // + this.m_textBox12.Location = new System.Drawing.Point(218, 50); + this.m_textBox12.Name = "m_textBox12"; + this.m_textBox12.ReadOnly = true; + this.m_textBox12.Size = new System.Drawing.Size(100, 20); + this.m_textBox12.TabIndex = 27; + // + // m_textBox10 + // + this.m_textBox10.Location = new System.Drawing.Point(6, 50); + this.m_textBox10.Name = "m_textBox10"; + this.m_textBox10.ReadOnly = true; + this.m_textBox10.Size = new System.Drawing.Size(100, 20); + this.m_textBox10.TabIndex = 25; + // + // m_textBox11 + // + this.m_textBox11.Location = new System.Drawing.Point(112, 50); + this.m_textBox11.Name = "m_textBox11"; + this.m_textBox11.ReadOnly = true; + this.m_textBox11.Size = new System.Drawing.Size(100, 20); + this.m_textBox11.TabIndex = 26; + // + // m_textBox02 + // + this.m_textBox02.Location = new System.Drawing.Point(218, 25); + this.m_textBox02.Name = "m_textBox02"; + this.m_textBox02.ReadOnly = true; + this.m_textBox02.Size = new System.Drawing.Size(100, 20); + this.m_textBox02.TabIndex = 24; + // + // m_textBox00 + // + this.m_textBox00.Location = new System.Drawing.Point(6, 25); + this.m_textBox00.Name = "m_textBox00"; + this.m_textBox00.ReadOnly = true; + this.m_textBox00.Size = new System.Drawing.Size(100, 20); + this.m_textBox00.TabIndex = 22; + // + // m_textBox01 + // + this.m_textBox01.Location = new System.Drawing.Point(112, 25); + this.m_textBox01.Name = "m_textBox01"; + this.m_textBox01.ReadOnly = true; + this.m_textBox01.Size = new System.Drawing.Size(100, 20); + this.m_textBox01.TabIndex = 23; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(18, 155); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 26; + this.button3.Text = "Validate"; + this.m_toolTip.SetToolTip(this.button3, "Verifies LocalCartesian Interfaces"); + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.OnValidate); + // + // LocalCartesianPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button3); + this.Controls.Add(this.groupBox3); + this.Controls.Add(this.button2); + this.Controls.Add(this.label12); + this.Controls.Add(this.m_functionComboBox); + this.Controls.Add(this.m_ZTextBox); + this.Controls.Add(this.m_YTextBox); + this.Controls.Add(this.m_XTextBox); + this.Controls.Add(this.m_altTextBox); + this.Controls.Add(this.m_lonTextBox); + this.Controls.Add(this.m_latTextBox); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); + this.Name = "LocalCartesianPanel"; + this.Size = new System.Drawing.Size(842, 295); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button m_setButton; + private System.Windows.Forms.TextBox m_flatteningTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox m_altitudeTextBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox m_latTextBox; + private System.Windows.Forms.TextBox m_lonTextBox; + private System.Windows.Forms.TextBox m_altTextBox; + private System.Windows.Forms.TextBox m_XTextBox; + private System.Windows.Forms.TextBox m_YTextBox; + private System.Windows.Forms.TextBox m_ZTextBox; + private System.Windows.Forms.ComboBox m_functionComboBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.TextBox m_textBox22; + private System.Windows.Forms.TextBox m_textBox20; + private System.Windows.Forms.TextBox m_textBox21; + private System.Windows.Forms.TextBox m_textBox12; + private System.Windows.Forms.TextBox m_textBox10; + private System.Windows.Forms.TextBox m_textBox11; + private System.Windows.Forms.TextBox m_textBox02; + private System.Windows.Forms.TextBox m_textBox00; + private System.Windows.Forms.TextBox m_textBox01; + private System.Windows.Forms.Button button3; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.cs new file mode 100644 index 000000000..2f9a9e90d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.cs @@ -0,0 +1,173 @@ +/** + * \file NETGeographicLib\LocalCartesianPanel.cs + * \brief NETGeographicLib.LocalCartesian example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class LocalCartesianPanel : UserControl + { + LocalCartesian m_lc = null; + enum Functions + { + Forward, + Reverse + }; + Functions m_function = Functions.Forward; + + public LocalCartesianPanel() + { + InitializeComponent(); + + Geocentric g = new Geocentric(); + m_majorRadiusTextBox.Text = g.MajorRadius.ToString(); + m_flatteningTextBox.Text = g.Flattening.ToString(); + m_lc = new LocalCartesian(g); + m_functionComboBox.SelectedIndex = (int)m_function; + } + + private void OnSetEllipsoid(object sender, EventArgs e) + { + double a, f; + try + { + a = Double.Parse(m_majorRadiusTextBox.Text); + f = Double.Parse(m_flatteningTextBox.Text); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Data Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + try + { + m_lc = new LocalCartesian(new Geocentric(a, f)); + } + catch (GeographicErr err) + { + MessageBox.Show(err.Message, "GeographicLib error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnSetReference(object sender, EventArgs e) + { + double lat, lon, alt; + try + { + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + alt = Double.Parse(m_altitudeTextBox.Text); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Data Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + + m_lc.Reset(lat, lon, alt); + } + + private void OnConvert(object sender, EventArgs e) + { + try + { + double lat, lon, alt, x, y, z; + double[,] rot = null; + switch (m_function) + { + case Functions.Forward: + lat = Double.Parse(m_latTextBox.Text); + lon = Double.Parse(m_lonTextBox.Text); + alt = Double.Parse(m_altTextBox.Text); + m_lc.Forward(lat, lon, alt, out x, out y, out z, out rot); + m_XTextBox.Text = x.ToString("0.00###"); + m_YTextBox.Text = y.ToString("0.00###"); + m_ZTextBox.Text = z.ToString("0.00###"); + break; + case Functions.Reverse: + x = Double.Parse(m_XTextBox.Text); + y = Double.Parse(m_YTextBox.Text); + z = Double.Parse(m_ZTextBox.Text); + m_lc.Reverse(x, y, z, out lat, out lon, out alt, out rot); + m_latTextBox.Text = lat.ToString(); + m_lonTextBox.Text = lon.ToString(); + m_altTextBox.Text = alt.ToString(); + break; + } + m_textBox00.Text = rot[0, 0].ToString("#.000000000000"); + m_textBox01.Text = rot[0, 1].ToString("#.000000000000"); + m_textBox02.Text = rot[0, 2].ToString("#.000000000000"); + m_textBox10.Text = rot[1, 0].ToString("#.000000000000"); + m_textBox11.Text = rot[1, 1].ToString("#.000000000000"); + m_textBox12.Text = rot[1, 2].ToString("#.000000000000"); + m_textBox20.Text = rot[2, 0].ToString("#.000000000000"); + m_textBox21.Text = rot[2, 1].ToString("#.000000000000"); + m_textBox22.Text = rot[2, 2].ToString("#.000000000000"); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnNewFunction(object sender, EventArgs e) + { + m_function = (Functions)m_functionComboBox.SelectedIndex; + switch (m_function) + { + case Functions.Forward: + m_latTextBox.ReadOnly = m_lonTextBox.ReadOnly = m_altTextBox.ReadOnly = false; + m_XTextBox.ReadOnly = m_YTextBox.ReadOnly = m_ZTextBox.ReadOnly = true; + break; + case Functions.Reverse: + m_latTextBox.ReadOnly = m_lonTextBox.ReadOnly = m_altTextBox.ReadOnly = true; + m_XTextBox.ReadOnly = m_YTextBox.ReadOnly = m_ZTextBox.ReadOnly = false; + break; + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + LocalCartesian p = new LocalCartesian(); + p = new LocalCartesian(new Geocentric()); + p = new LocalCartesian(32.0, -86.0, 45.0); + p = new LocalCartesian(32.0, -86.0, 45.0, new Geocentric()); + double x, y, z, x1, y1, z1; + double[,] rot; + p.Forward(32.0, -86.0, 45.0, out x, out y, out z, out rot); + p.Forward(32.0, -86.0, 45.0, out x1, out y1, out z1); + if (x != x1 || y != y1 || z != z1) + throw new Exception("Error in Forward"); + double lat, lon, alt; + p.Reverse(x, y, z, out lat, out lon, out alt, out rot); + p.Reverse(x, y, z, out x1, out y1, out z1); + if (lat != x1 || lon != y1 || alt != z1) + throw new Exception("Error in Reverse"); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.resx new file mode 100644 index 000000000..3ec30e045 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/LocalCartesianPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.Designer.cs new file mode 100644 index 000000000..0671e4bd6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.Designer.cs @@ -0,0 +1,411 @@ +namespace Projections +{ + partial class MagneticPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.m_validateButton = new System.Windows.Forms.Button(); + this.m_dateTextBox = new System.Windows.Forms.TextBox(); + this.m_descriptionTextBox = new System.Windows.Forms.TextBox(); + this.m_nameTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.m_magneticModelNameTextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.m_timeTextBox = new System.Windows.Forms.TextBox(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_altitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_updateButton = new System.Windows.Forms.Button(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.m_mfXTextBox = new System.Windows.Forms.TextBox(); + this.m_mfYTextBox = new System.Windows.Forms.TextBox(); + this.label11 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.m_mfZTextBox = new System.Windows.Forms.TextBox(); + this.m_mfdXTextBox = new System.Windows.Forms.TextBox(); + this.m_mfdYTextBox = new System.Windows.Forms.TextBox(); + this.m_mfdZTextBox = new System.Windows.Forms.TextBox(); + this.m_magCircButton = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // m_validateButton + // + this.m_validateButton.Enabled = false; + this.m_validateButton.Location = new System.Drawing.Point(182, 126); + this.m_validateButton.Name = "m_validateButton"; + this.m_validateButton.Size = new System.Drawing.Size(75, 23); + this.m_validateButton.TabIndex = 37; + this.m_validateButton.Text = "Validate"; + this.m_validateButton.UseVisualStyleBackColor = true; + this.m_validateButton.Click += new System.EventHandler(this.OnValidate); + // + // m_dateTextBox + // + this.m_dateTextBox.Location = new System.Drawing.Point(82, 100); + this.m_dateTextBox.Name = "m_dateTextBox"; + this.m_dateTextBox.ReadOnly = true; + this.m_dateTextBox.Size = new System.Drawing.Size(299, 20); + this.m_dateTextBox.TabIndex = 36; + // + // m_descriptionTextBox + // + this.m_descriptionTextBox.Location = new System.Drawing.Point(82, 73); + this.m_descriptionTextBox.Name = "m_descriptionTextBox"; + this.m_descriptionTextBox.ReadOnly = true; + this.m_descriptionTextBox.Size = new System.Drawing.Size(299, 20); + this.m_descriptionTextBox.TabIndex = 35; + // + // m_nameTextBox + // + this.m_nameTextBox.Location = new System.Drawing.Point(82, 46); + this.m_nameTextBox.Name = "m_nameTextBox"; + this.m_nameTextBox.ReadOnly = true; + this.m_nameTextBox.Size = new System.Drawing.Size(299, 20); + this.m_nameTextBox.TabIndex = 34; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(9, 104); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(30, 13); + this.label4.TabIndex = 33; + this.label4.Text = "Date"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(9, 77); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(60, 13); + this.label3.TabIndex = 32; + this.label3.Text = "Description"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(9, 50); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 13); + this.label2.TabIndex = 31; + this.label2.Text = "Name"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(388, 19); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(29, 23); + this.button1.TabIndex = 30; + this.button1.Text = "..."; + this.toolTip1.SetToolTip(this.button1, "Select gravity model file"); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnSelectMagneticModel); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(9, 4); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(83, 13); + this.label1.TabIndex = 29; + this.label1.Text = "Magnetic Model"; + // + // m_magneticModelNameTextBox + // + this.m_magneticModelNameTextBox.Location = new System.Drawing.Point(9, 20); + this.m_magneticModelNameTextBox.Name = "m_magneticModelNameTextBox"; + this.m_magneticModelNameTextBox.Size = new System.Drawing.Size(377, 20); + this.m_magneticModelNameTextBox.TabIndex = 28; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(429, 8); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(64, 13); + this.label5.TabIndex = 38; + this.label5.Text = "Time (years)"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(429, 34); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(101, 13); + this.label6.TabIndex = 39; + this.label6.Text = "Longitude (degrees)"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(429, 60); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(92, 13); + this.label7.TabIndex = 40; + this.label7.Text = "Latitude (degrees)"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(429, 86); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(82, 13); + this.label8.TabIndex = 41; + this.label8.Text = "Altitude (meters)"; + // + // m_timeTextBox + // + this.m_timeTextBox.Location = new System.Drawing.Point(544, 4); + this.m_timeTextBox.Name = "m_timeTextBox"; + this.m_timeTextBox.Size = new System.Drawing.Size(118, 20); + this.m_timeTextBox.TabIndex = 42; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(544, 30); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(118, 20); + this.m_longitudeTextBox.TabIndex = 43; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(544, 56); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(118, 20); + this.m_latitudeTextBox.TabIndex = 44; + // + // m_altitudeTextBox + // + this.m_altitudeTextBox.Location = new System.Drawing.Point(544, 82); + this.m_altitudeTextBox.Name = "m_altitudeTextBox"; + this.m_altitudeTextBox.Size = new System.Drawing.Size(118, 20); + this.m_altitudeTextBox.TabIndex = 45; + // + // m_updateButton + // + this.m_updateButton.Enabled = false; + this.m_updateButton.Location = new System.Drawing.Point(566, 108); + this.m_updateButton.Name = "m_updateButton"; + this.m_updateButton.Size = new System.Drawing.Size(75, 23); + this.m_updateButton.TabIndex = 46; + this.m_updateButton.Text = "Update"; + this.m_updateButton.UseVisualStyleBackColor = true; + this.m_updateButton.Click += new System.EventHandler(this.OnUpdate); + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(709, 8); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(76, 13); + this.label9.TabIndex = 47; + this.label9.Text = "Magnetic Field"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(814, 8); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(116, 13); + this.label10.TabIndex = 48; + this.label10.Text = "Magnetic Field Change"; + // + // m_mfXTextBox + // + this.m_mfXTextBox.Location = new System.Drawing.Point(688, 30); + this.m_mfXTextBox.Name = "m_mfXTextBox"; + this.m_mfXTextBox.ReadOnly = true; + this.m_mfXTextBox.Size = new System.Drawing.Size(118, 20); + this.m_mfXTextBox.TabIndex = 49; + // + // m_mfYTextBox + // + this.m_mfYTextBox.Location = new System.Drawing.Point(688, 56); + this.m_mfYTextBox.Name = "m_mfYTextBox"; + this.m_mfYTextBox.ReadOnly = true; + this.m_mfYTextBox.Size = new System.Drawing.Size(118, 20); + this.m_mfYTextBox.TabIndex = 50; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(668, 34); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(14, 13); + this.label11.TabIndex = 51; + this.label11.Text = "X"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(668, 60); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(14, 13); + this.label12.TabIndex = 52; + this.label12.Text = "Y"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(668, 86); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(14, 13); + this.label13.TabIndex = 53; + this.label13.Text = "Z"; + // + // m_mfZTextBox + // + this.m_mfZTextBox.Location = new System.Drawing.Point(688, 82); + this.m_mfZTextBox.Name = "m_mfZTextBox"; + this.m_mfZTextBox.ReadOnly = true; + this.m_mfZTextBox.Size = new System.Drawing.Size(118, 20); + this.m_mfZTextBox.TabIndex = 54; + // + // m_mfdXTextBox + // + this.m_mfdXTextBox.Location = new System.Drawing.Point(813, 30); + this.m_mfdXTextBox.Name = "m_mfdXTextBox"; + this.m_mfdXTextBox.ReadOnly = true; + this.m_mfdXTextBox.Size = new System.Drawing.Size(118, 20); + this.m_mfdXTextBox.TabIndex = 55; + // + // m_mfdYTextBox + // + this.m_mfdYTextBox.Location = new System.Drawing.Point(813, 56); + this.m_mfdYTextBox.Name = "m_mfdYTextBox"; + this.m_mfdYTextBox.ReadOnly = true; + this.m_mfdYTextBox.Size = new System.Drawing.Size(118, 20); + this.m_mfdYTextBox.TabIndex = 56; + // + // m_mfdZTextBox + // + this.m_mfdZTextBox.Location = new System.Drawing.Point(813, 82); + this.m_mfdZTextBox.Name = "m_mfdZTextBox"; + this.m_mfdZTextBox.ReadOnly = true; + this.m_mfdZTextBox.Size = new System.Drawing.Size(118, 20); + this.m_mfdZTextBox.TabIndex = 57; + // + // m_magCircButton + // + this.m_magCircButton.Enabled = false; + this.m_magCircButton.Location = new System.Drawing.Point(712, 108); + this.m_magCircButton.Name = "m_magCircButton"; + this.m_magCircButton.Size = new System.Drawing.Size(197, 23); + this.m_magCircButton.TabIndex = 58; + this.m_magCircButton.Text = "Use MagneticCircle to update Field"; + this.m_magCircButton.UseVisualStyleBackColor = true; + this.m_magCircButton.Click += new System.EventHandler(this.OnMagneticCircle); + // + // MagneticPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.m_magCircButton); + this.Controls.Add(this.m_mfdZTextBox); + this.Controls.Add(this.m_mfdYTextBox); + this.Controls.Add(this.m_mfdXTextBox); + this.Controls.Add(this.m_mfZTextBox); + this.Controls.Add(this.label13); + this.Controls.Add(this.label12); + this.Controls.Add(this.label11); + this.Controls.Add(this.m_mfYTextBox); + this.Controls.Add(this.m_mfXTextBox); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.m_updateButton); + this.Controls.Add(this.m_altitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.m_timeTextBox); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.m_validateButton); + this.Controls.Add(this.m_dateTextBox); + this.Controls.Add(this.m_descriptionTextBox); + this.Controls.Add(this.m_nameTextBox); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Controls.Add(this.m_magneticModelNameTextBox); + this.Name = "MagneticPanel"; + this.Size = new System.Drawing.Size(984, 428); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip toolTip1; + private System.Windows.Forms.Button m_validateButton; + private System.Windows.Forms.TextBox m_dateTextBox; + private System.Windows.Forms.TextBox m_descriptionTextBox; + private System.Windows.Forms.TextBox m_nameTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_magneticModelNameTextBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox m_timeTextBox; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_altitudeTextBox; + private System.Windows.Forms.Button m_updateButton; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.TextBox m_mfXTextBox; + private System.Windows.Forms.TextBox m_mfYTextBox; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.TextBox m_mfZTextBox; + private System.Windows.Forms.TextBox m_mfdXTextBox; + private System.Windows.Forms.TextBox m_mfdYTextBox; + private System.Windows.Forms.TextBox m_mfdZTextBox; + private System.Windows.Forms.Button m_magCircButton; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.cs new file mode 100644 index 000000000..653126570 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.cs @@ -0,0 +1,145 @@ +/** + * \file NETGeographicLib\MagneticPanel.cs + * \brief NETGeographicLib.MagneticModel example + * + * NETGeographicLib.MagneticModel and + * NETGeographicLib.MagneticCircle example. + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class MagneticPanel : UserControl + { + string m_path, m_name; + MagneticModel m_magnetic = null; + + public MagneticPanel() + { + InitializeComponent(); + } + + private void OnSelectMagneticModel(object sender, EventArgs e) + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Magnetic Model (*.wmm)|*.wmm"; + dlg.DefaultExt = "wmm"; + + if (dlg.ShowDialog() == DialogResult.Cancel) return; + + m_path = dlg.FileName.Substring(0, dlg.FileName.LastIndexOf('\\')).Replace('\\', '/'); + int length = dlg.FileName.LastIndexOf('.') - dlg.FileName.LastIndexOf('\\') - 1; + m_name = dlg.FileName.Substring(dlg.FileName.LastIndexOf('\\') + 1, length); + + try + { + m_magnetic = new MagneticModel(m_name, m_path); + m_magneticModelNameTextBox.Text = dlg.FileName; + m_nameTextBox.Text = m_magnetic.MagneticModelName; + m_descriptionTextBox.Text = m_magnetic.Description; + m_dateTextBox.Text = m_magnetic.DateTime; + m_updateButton.Enabled = true; + m_magCircButton.Enabled = true; + m_validateButton.Enabled = true; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + + } + + private void OnUpdate(object sender, EventArgs e) + { + try + { + double time = Double.Parse(m_timeTextBox.Text); + double lon = Double.Parse(m_longitudeTextBox.Text); + double lat = Double.Parse(m_latitudeTextBox.Text); + double alt = Double.Parse(m_altitudeTextBox.Text); + + double bx, by, bz, bxt, byt, bzt; + m_magnetic.Field(time, lat, lon, alt, out bx, out by, out bz, out bxt, out byt, out bzt); + m_mfXTextBox.Text = bx.ToString(); + m_mfYTextBox.Text = by.ToString(); + m_mfZTextBox.Text = bz.ToString(); + m_mfdXTextBox.Text = bxt.ToString(); + m_mfdYTextBox.Text = byt.ToString(); + m_mfdZTextBox.Text = bzt.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnMagneticCircle(object sender, EventArgs e) + { + try + { + double time = Double.Parse(m_timeTextBox.Text); + double lon = Double.Parse(m_longitudeTextBox.Text); + double lat = Double.Parse(m_latitudeTextBox.Text); + double alt = Double.Parse(m_altitudeTextBox.Text); + + double bx, by, bz, bxt, byt, bzt; + MagneticCircle mc = m_magnetic.Circle(time, lat, alt); + mc.Field(lon, out bx, out by, out bz, out bxt, out byt, out bzt); + m_mfXTextBox.Text = bx.ToString(); + m_mfYTextBox.Text = by.ToString(); + m_mfZTextBox.Text = bz.ToString(); + m_mfdXTextBox.Text = bxt.ToString(); + m_mfdYTextBox.Text = byt.ToString(); + m_mfdZTextBox.Text = bzt.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + double bx, by, bz, bxt, byt, bzt, x, y, z; + double time = 1.0; + double lon = -86.0; + double lat = 32.0; + double alt = 30.0; + + MagneticModel mag = new MagneticModel(m_name, m_path, new Geocentric()); + mag = new MagneticModel(m_name, m_path); + mag.Field(time, lat, lon, alt, out bx, out by, out bz, out bxt, out byt, out bzt); + mag.Field(time, lat, lon, alt, out x, out y, out z); + if (bx != x || by != y || bz != z) + throw new Exception("Error in MagneticField.Field"); + MagneticCircle mc = mag.Circle(time, lat, alt); + mc.Field(lon, out bx, out by, out bz); + mc.Field(lon, out x, out y, out z, out bxt, out byt, out bzt); + if (bx != x || by != y || bz != z ) + throw new Exception("Error in MagneticCircle.Field (2)"); + + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.resx new file mode 100644 index 000000000..749de3c20 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MagneticPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.Designer.cs new file mode 100644 index 000000000..fda76668b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.Designer.cs @@ -0,0 +1,212 @@ +namespace Projections +{ + partial class MiscPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.m_longitudeDMSTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.m_latitudeDMSTextBox = new System.Windows.Forms.TextBox(); + this.m_LongitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_geohashTextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.button4 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(13, 33); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(54, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Longitude"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(120, 4); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(31, 13); + this.label2.TabIndex = 1; + this.label2.Text = "DMS"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(229, 4); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(88, 13); + this.label3.TabIndex = 2; + this.label3.Text = "Decimal Degrees"; + // + // m_longitudeDMSTextBox + // + this.m_longitudeDMSTextBox.Location = new System.Drawing.Point(86, 29); + this.m_longitudeDMSTextBox.Name = "m_longitudeDMSTextBox"; + this.m_longitudeDMSTextBox.Size = new System.Drawing.Size(100, 20); + this.m_longitudeDMSTextBox.TabIndex = 3; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(13, 63); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(45, 13); + this.label4.TabIndex = 4; + this.label4.Text = "Latitude"; + // + // m_latitudeDMSTextBox + // + this.m_latitudeDMSTextBox.Location = new System.Drawing.Point(86, 56); + this.m_latitudeDMSTextBox.Name = "m_latitudeDMSTextBox"; + this.m_latitudeDMSTextBox.Size = new System.Drawing.Size(100, 20); + this.m_latitudeDMSTextBox.TabIndex = 5; + // + // m_LongitudeTextBox + // + this.m_LongitudeTextBox.Location = new System.Drawing.Point(203, 29); + this.m_LongitudeTextBox.Name = "m_LongitudeTextBox"; + this.m_LongitudeTextBox.Size = new System.Drawing.Size(137, 20); + this.m_LongitudeTextBox.TabIndex = 6; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(203, 55); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(137, 20); + this.m_latitudeTextBox.TabIndex = 7; + // + // m_geohashTextBox + // + this.m_geohashTextBox.Location = new System.Drawing.Point(360, 43); + this.m_geohashTextBox.Name = "m_geohashTextBox"; + this.m_geohashTextBox.Size = new System.Drawing.Size(155, 20); + this.m_geohashTextBox.TabIndex = 8; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(409, 4); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(50, 13); + this.label5.TabIndex = 9; + this.label5.Text = "Geohash"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(96, 83); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 10; + this.button1.Text = "Convert ->"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnConvertDMS); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(229, 83); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(85, 23); + this.button2.TabIndex = 11; + this.button2.Text = "<- Convert ->"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnConvert); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(400, 83); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 12; + this.button3.Text = "<- Convert"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.OnConvertGeohash); + // + // button4 + // + this.button4.Location = new System.Drawing.Point(541, 4); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(75, 23); + this.button4.TabIndex = 13; + this.button4.Text = "Validate"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.OnValidate); + // + // MiscPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button4); + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.label5); + this.Controls.Add(this.m_geohashTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.m_LongitudeTextBox); + this.Controls.Add(this.m_latitudeDMSTextBox); + this.Controls.Add(this.label4); + this.Controls.Add(this.m_longitudeDMSTextBox); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "MiscPanel"; + this.Size = new System.Drawing.Size(977, 389); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox m_longitudeDMSTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox m_latitudeDMSTextBox; + private System.Windows.Forms.TextBox m_LongitudeTextBox; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_geohashTextBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Button button4; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.cs new file mode 100644 index 000000000..0fcb9908b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.cs @@ -0,0 +1,118 @@ +/** + * \file NETGeographicLib\MiscPanel.cs + * \brief NETGeographicLib.DMS and NETGeographicLib.Geohash example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class MiscPanel : UserControl + { + public MiscPanel() + { + InitializeComponent(); + } + + private void OnConvertDMS(object sender, EventArgs e) + { + try + { + DMS.Flag ind; + double lon = DMS.Decode(m_longitudeDMSTextBox.Text, out ind); + m_LongitudeTextBox.Text = lon.ToString(); + double lat = DMS.Decode(m_latitudeDMSTextBox.Text, out ind); + m_latitudeTextBox.Text = lat.ToString(); + string tmp = ""; + Geohash.Forward(lat, lon, 12, out tmp); + m_geohashTextBox.Text = tmp; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnConvert(object sender, EventArgs e) + { + try + { + double lon = Double.Parse(m_LongitudeTextBox.Text); + double lat = Double.Parse(m_latitudeTextBox.Text); + m_longitudeDMSTextBox.Text = DMS.Encode(lon, 5, DMS.Flag.LONGITUDE, 0); + m_latitudeDMSTextBox.Text = DMS.Encode(lat, 5, DMS.Flag.LATITUDE, 0); + string tmp = ""; + Geohash.Forward(lat, lon, 12, out tmp); + m_geohashTextBox.Text = tmp; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnConvertGeohash(object sender, EventArgs e) + { + try + { + double lat, lon; + int len; + Geohash.Reverse(m_geohashTextBox.Text, out lat, out lon, out len, true); + m_LongitudeTextBox.Text = lon.ToString(); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeDMSTextBox.Text = DMS.Encode(lon, 5, DMS.Flag.LONGITUDE, 0); + m_latitudeDMSTextBox.Text = DMS.Encode(lat, 5, DMS.Flag.LATITUDE, 0); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + double lat, lon, d, m, s; + DMS.Flag ind; + int len; + string tmp; + DMS.Decode("34.245"); + DMS.Decode("34d22\'34.567\"", out ind); + DMS.Decode(-86.0, 32.0, 34.214); + DMS.DecodeAngle("-67.4532"); + DMS.DecodeAzimuth("85.3245W"); + DMS.DecodeLatLon("86d34\'24.5621\"", "21d56\'32.1234\"", out lat, out lon, false); + DMS.Encode(-86.453214, out d, out m); + DMS.Encode(-86.453214, out d, out m, out s); + DMS.Encode(-86.453214, DMS.Component.SECOND, 12, DMS.Flag.LONGITUDE, 0); + DMS.Encode(-86.453214, 12, DMS.Flag.LONGITUDE, 0); + Geohash.DecimalPrecision(12); + Geohash.Forward(31.23456, -86.43678, 12, out tmp); + Geohash.GeohashLength(0.001); + Geohash.GeohashLength(0.002, 0.003); + Geohash.LatitudeResolution(12); + Geohash.LongitudeResolution(12); + Geohash.Reverse("djds54mrfc0g", out lat, out lon, out len, true); + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.resx new file mode 100644 index 000000000..3ec30e045 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/MiscPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.Designer.cs new file mode 100644 index 000000000..e3b06d35d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.Designer.cs @@ -0,0 +1,349 @@ +namespace Projections +{ + partial class PolarStereoPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.m_setButton = new System.Windows.Forms.Button(); + this.m_flatteningTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.m_scaleTextBox = new System.Windows.Forms.TextBox(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.m_northPoleCheckBox = new System.Windows.Forms.CheckBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_xTextBox = new System.Windows.Forms.TextBox(); + this.m_yTextBox = new System.Windows.Forms.TextBox(); + this.m_gammaTextBox = new System.Windows.Forms.TextBox(); + this.m_kTextBox = new System.Windows.Forms.TextBox(); + this.label10 = new System.Windows.Forms.Label(); + this.m_functionComboBox = new System.Windows.Forms.ComboBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.m_scaleTextBox); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.m_setButton); + this.groupBox1.Controls.Add(this.m_flatteningTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.m_majorRadiusTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(146, 184); + this.groupBox1.TabIndex = 20; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Ellipsoid Parameters"; + // + // m_setButton + // + this.m_setButton.Location = new System.Drawing.Point(15, 153); + this.m_setButton.Name = "m_setButton"; + this.m_setButton.Size = new System.Drawing.Size(75, 23); + this.m_setButton.TabIndex = 4; + this.m_setButton.Text = "Set"; + this.m_toolTip.SetToolTip(this.m_setButton, "Sets parameters"); + this.m_setButton.UseVisualStyleBackColor = true; + this.m_setButton.Click += new System.EventHandler(this.OnSet); + // + // m_flatteningTextBox + // + this.m_flatteningTextBox.Location = new System.Drawing.Point(12, 83); + this.m_flatteningTextBox.Name = "m_flatteningTextBox"; + this.m_flatteningTextBox.Size = new System.Drawing.Size(125, 20); + this.m_flatteningTextBox.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(109, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Major Radius (meters)"; + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(12, 42); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(125, 20); + this.m_majorRadiusTextBox.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Flattening"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(12, 110); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(103, 13); + this.label3.TabIndex = 5; + this.label3.Text = "Central Scale Factor"; + // + // m_scaleTextBox + // + this.m_scaleTextBox.Location = new System.Drawing.Point(12, 127); + this.m_scaleTextBox.Name = "m_scaleTextBox"; + this.m_scaleTextBox.Size = new System.Drawing.Size(125, 20); + this.m_scaleTextBox.TabIndex = 6; + // + // m_northPoleCheckBox + // + this.m_northPoleCheckBox.AutoSize = true; + this.m_northPoleCheckBox.Checked = true; + this.m_northPoleCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.m_northPoleCheckBox.Location = new System.Drawing.Point(161, 4); + this.m_northPoleCheckBox.Name = "m_northPoleCheckBox"; + this.m_northPoleCheckBox.Size = new System.Drawing.Size(76, 17); + this.m_northPoleCheckBox.TabIndex = 21; + this.m_northPoleCheckBox.Text = "North Pole"; + this.m_toolTip.SetToolTip(this.m_northPoleCheckBox, "checked = Noth Pole, uncheck = South Pole"); + this.m_northPoleCheckBox.UseVisualStyleBackColor = true; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(161, 28); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(92, 13); + this.label4.TabIndex = 22; + this.label4.Text = "Latitude (degrees)"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(161, 55); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(101, 13); + this.label5.TabIndex = 23; + this.label5.Text = "Longitude (degrees)"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(161, 81); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(54, 13); + this.label6.TabIndex = 24; + this.label6.Text = "X (meters)"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(161, 107); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(54, 13); + this.label7.TabIndex = 25; + this.label7.Text = "Y (meters)"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(161, 133); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(90, 13); + this.label8.TabIndex = 26; + this.label8.Text = "Gamma (degrees)"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(161, 159); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(34, 13); + this.label9.TabIndex = 27; + this.label9.Text = "Scale"; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(274, 25); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(120, 20); + this.m_latitudeTextBox.TabIndex = 28; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(274, 51); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(120, 20); + this.m_longitudeTextBox.TabIndex = 29; + // + // m_xTextBox + // + this.m_xTextBox.Location = new System.Drawing.Point(274, 77); + this.m_xTextBox.Name = "m_xTextBox"; + this.m_xTextBox.Size = new System.Drawing.Size(120, 20); + this.m_xTextBox.TabIndex = 30; + // + // m_yTextBox + // + this.m_yTextBox.Location = new System.Drawing.Point(274, 103); + this.m_yTextBox.Name = "m_yTextBox"; + this.m_yTextBox.Size = new System.Drawing.Size(120, 20); + this.m_yTextBox.TabIndex = 31; + // + // m_gammaTextBox + // + this.m_gammaTextBox.Location = new System.Drawing.Point(274, 129); + this.m_gammaTextBox.Name = "m_gammaTextBox"; + this.m_gammaTextBox.ReadOnly = true; + this.m_gammaTextBox.Size = new System.Drawing.Size(120, 20); + this.m_gammaTextBox.TabIndex = 32; + // + // m_kTextBox + // + this.m_kTextBox.Location = new System.Drawing.Point(274, 155); + this.m_kTextBox.Name = "m_kTextBox"; + this.m_kTextBox.ReadOnly = true; + this.m_kTextBox.Size = new System.Drawing.Size(120, 20); + this.m_kTextBox.TabIndex = 33; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(411, 4); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(48, 13); + this.label10.TabIndex = 34; + this.label10.Text = "Function"; + // + // m_functionComboBox + // + this.m_functionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_functionComboBox.FormattingEnabled = true; + this.m_functionComboBox.Items.AddRange(new object[] { + "Forward", + "Reverse"}); + this.m_functionComboBox.Location = new System.Drawing.Point(414, 25); + this.m_functionComboBox.Name = "m_functionComboBox"; + this.m_functionComboBox.Size = new System.Drawing.Size(75, 21); + this.m_functionComboBox.TabIndex = 35; + this.m_functionComboBox.SelectedIndexChanged += new System.EventHandler(this.OnFunction); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(414, 53); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 36; + this.button1.Text = "Convert"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnConvert); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(414, 155); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 37; + this.button2.Text = "Validate"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnValidate); + // + // PolarStereoPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.m_functionComboBox); + this.Controls.Add(this.label10); + this.Controls.Add(this.m_kTextBox); + this.Controls.Add(this.m_gammaTextBox); + this.Controls.Add(this.m_yTextBox); + this.Controls.Add(this.m_xTextBox); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.m_northPoleCheckBox); + this.Controls.Add(this.groupBox1); + this.Name = "PolarStereoPanel"; + this.Size = new System.Drawing.Size(779, 299); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button m_setButton; + private System.Windows.Forms.TextBox m_flatteningTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox m_scaleTextBox; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.CheckBox m_northPoleCheckBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.TextBox m_xTextBox; + private System.Windows.Forms.TextBox m_yTextBox; + private System.Windows.Forms.TextBox m_gammaTextBox; + private System.Windows.Forms.TextBox m_kTextBox; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.ComboBox m_functionComboBox; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.cs new file mode 100644 index 000000000..655a04f51 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.cs @@ -0,0 +1,130 @@ +/** + * \file NETGeographicLib\PolarStereoPanel.cs + * \brief NETGeographicLib.PolarStereographic example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class PolarStereoPanel : UserControl + { + PolarStereographic m_polar = null; + + public PolarStereoPanel() + { + InitializeComponent(); + try + { + m_polar = new PolarStereographic(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + m_majorRadiusTextBox.Text = m_polar.MajorRadius.ToString(); + m_flatteningTextBox.Text = m_polar.Flattening.ToString(); + m_scaleTextBox.Text = m_polar.CentralScale.ToString(); + m_functionComboBox.SelectedIndex = 0; + } + + private void OnSet(object sender, EventArgs e) + { + try + { + double a = Double.Parse(m_majorRadiusTextBox.Text); + double f = Double.Parse(m_flatteningTextBox.Text); + double k = Double.Parse(m_scaleTextBox.Text); + m_polar = new PolarStereographic(a, f, k); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnFunction(object sender, EventArgs e) + { + switch (m_functionComboBox.SelectedIndex) + { + case 0: + m_latitudeTextBox.ReadOnly = m_longitudeTextBox.ReadOnly = false; + m_xTextBox.ReadOnly = m_yTextBox.ReadOnly = true; + break; + case 1: + m_latitudeTextBox.ReadOnly = m_longitudeTextBox.ReadOnly = true; + m_xTextBox.ReadOnly = m_yTextBox.ReadOnly = false; + break; + } + } + + private void OnConvert(object sender, EventArgs e) + { + try + { + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, gamma = 0.0, k = 0.0; + switch (m_functionComboBox.SelectedIndex) + { + case 0: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + m_polar.Forward(m_northPoleCheckBox.Checked, lat, lon, out x, out y, out gamma, out k); + m_xTextBox.Text = x.ToString(); + m_yTextBox.Text = y.ToString(); + break; + case 1: + x = Double.Parse(m_xTextBox.Text); + y = Double.Parse(m_yTextBox.Text); + m_polar.Reverse(m_northPoleCheckBox.Checked, x, y, out lat, out lon, out gamma, out k); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + break; + } + m_gammaTextBox.Text = gamma.ToString(); + m_kTextBox.Text = k.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + double lat, lon, x, y, x1, y1, gamma, k; + PolarStereographic p = new PolarStereographic(m_polar.MajorRadius, m_polar.Flattening, m_polar.CentralScale); + p.SetScale(60.0, 1.0); + p = new PolarStereographic(); + p.Forward(true, 32.0, -86.0, out x, out y, out gamma, out k); + p.Forward(true, 32.0, -86.0, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in Forward"); + p.Reverse(true, x, y, out lat, out lon, out gamma, out k); + p.Reverse(true, x, y, out x1, out y1); + if ( lat != x1 || lon != y1 ) + throw new Exception("Error in Reverse"); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + MessageBox.Show("No errors detected", "Error", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.resx new file mode 100644 index 000000000..338d70e34 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolarStereoPanel.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.Designer.cs new file mode 100644 index 000000000..3b2677ace --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.Designer.cs @@ -0,0 +1,389 @@ +namespace Projections +{ + partial class PolyPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.m_setButton = new System.Windows.Forms.Button(); + this.m_flatteningTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.m_azimuthTextBox = new System.Windows.Forms.TextBox(); + this.m_distanceTextBox = new System.Windows.Forms.TextBox(); + this.m_edgeButton = new System.Windows.Forms.Button(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_numPointsTextBox = new System.Windows.Forms.TextBox(); + this.m_currLatTextBox = new System.Windows.Forms.TextBox(); + this.m_currLonTextBox = new System.Windows.Forms.TextBox(); + this.m_lengthTextBox = new System.Windows.Forms.TextBox(); + this.m_areaTextBox = new System.Windows.Forms.TextBox(); + this.button2 = new System.Windows.Forms.Button(); + this.button3 = new System.Windows.Forms.Button(); + this.m_polylineCheckBox = new System.Windows.Forms.CheckBox(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.m_polylineCheckBox); + this.groupBox1.Controls.Add(this.m_setButton); + this.groupBox1.Controls.Add(this.m_flatteningTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.m_majorRadiusTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(146, 169); + this.groupBox1.TabIndex = 6; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Ellipsoid Parameters"; + // + // m_setButton + // + this.m_setButton.Location = new System.Drawing.Point(30, 135); + this.m_setButton.Name = "m_setButton"; + this.m_setButton.Size = new System.Drawing.Size(75, 23); + this.m_setButton.TabIndex = 4; + this.m_setButton.Text = "Set"; + this.m_setButton.UseVisualStyleBackColor = true; + this.m_setButton.Click += new System.EventHandler(this.OnSet); + // + // m_flatteningTextBox + // + this.m_flatteningTextBox.Location = new System.Drawing.Point(12, 83); + this.m_flatteningTextBox.Name = "m_flatteningTextBox"; + this.m_flatteningTextBox.Size = new System.Drawing.Size(125, 20); + this.m_flatteningTextBox.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(109, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Major Radius (meters)"; + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(12, 42); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(125, 20); + this.m_majorRadiusTextBox.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Flattening"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(154, 10); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(92, 13); + this.label3.TabIndex = 7; + this.label3.Text = "Latitude (degrees)"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(154, 36); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(101, 13); + this.label4.TabIndex = 8; + this.label4.Text = "Longitude (degrees)"; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(263, 6); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(127, 20); + this.m_latitudeTextBox.TabIndex = 9; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(263, 32); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(127, 20); + this.m_longitudeTextBox.TabIndex = 10; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(289, 60); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 11; + this.button1.Text = "Add Point"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnAddPoint); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(400, 8); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(91, 13); + this.label5.TabIndex = 12; + this.label5.Text = "Azimuth (degrees)"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(400, 34); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(89, 13); + this.label6.TabIndex = 13; + this.label6.Text = "Distance (meters)"; + // + // m_azimuthTextBox + // + this.m_azimuthTextBox.Location = new System.Drawing.Point(495, 4); + this.m_azimuthTextBox.Name = "m_azimuthTextBox"; + this.m_azimuthTextBox.Size = new System.Drawing.Size(127, 20); + this.m_azimuthTextBox.TabIndex = 14; + // + // m_distanceTextBox + // + this.m_distanceTextBox.Location = new System.Drawing.Point(495, 30); + this.m_distanceTextBox.Name = "m_distanceTextBox"; + this.m_distanceTextBox.Size = new System.Drawing.Size(127, 20); + this.m_distanceTextBox.TabIndex = 15; + // + // m_edgeButton + // + this.m_edgeButton.Enabled = false; + this.m_edgeButton.Location = new System.Drawing.Point(515, 58); + this.m_edgeButton.Name = "m_edgeButton"; + this.m_edgeButton.Size = new System.Drawing.Size(75, 23); + this.m_edgeButton.TabIndex = 16; + this.m_edgeButton.Text = "Add Edge"; + this.m_edgeButton.UseVisualStyleBackColor = true; + this.m_edgeButton.Click += new System.EventHandler(this.OnAddEdge); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(634, 8); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(87, 13); + this.label7.TabIndex = 17; + this.label7.Text = "Number of points"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(634, 34); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(82, 13); + this.label8.TabIndex = 18; + this.label8.Text = "Current Latitude"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(634, 61); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(91, 13); + this.label9.TabIndex = 19; + this.label9.Text = "Current Longitude"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(634, 89); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(40, 13); + this.label10.TabIndex = 20; + this.label10.Text = "Length"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(634, 116); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(29, 13); + this.label11.TabIndex = 21; + this.label11.Text = "Area"; + // + // m_numPointsTextBox + // + this.m_numPointsTextBox.Location = new System.Drawing.Point(729, 4); + this.m_numPointsTextBox.Name = "m_numPointsTextBox"; + this.m_numPointsTextBox.ReadOnly = true; + this.m_numPointsTextBox.Size = new System.Drawing.Size(127, 20); + this.m_numPointsTextBox.TabIndex = 22; + this.m_numPointsTextBox.Text = "0"; + // + // m_currLatTextBox + // + this.m_currLatTextBox.Location = new System.Drawing.Point(729, 30); + this.m_currLatTextBox.Name = "m_currLatTextBox"; + this.m_currLatTextBox.ReadOnly = true; + this.m_currLatTextBox.Size = new System.Drawing.Size(127, 20); + this.m_currLatTextBox.TabIndex = 23; + // + // m_currLonTextBox + // + this.m_currLonTextBox.Location = new System.Drawing.Point(729, 57); + this.m_currLonTextBox.Name = "m_currLonTextBox"; + this.m_currLonTextBox.ReadOnly = true; + this.m_currLonTextBox.Size = new System.Drawing.Size(127, 20); + this.m_currLonTextBox.TabIndex = 24; + // + // m_lengthTextBox + // + this.m_lengthTextBox.Location = new System.Drawing.Point(729, 85); + this.m_lengthTextBox.Name = "m_lengthTextBox"; + this.m_lengthTextBox.ReadOnly = true; + this.m_lengthTextBox.Size = new System.Drawing.Size(127, 20); + this.m_lengthTextBox.TabIndex = 25; + // + // m_areaTextBox + // + this.m_areaTextBox.Location = new System.Drawing.Point(729, 112); + this.m_areaTextBox.Name = "m_areaTextBox"; + this.m_areaTextBox.ReadOnly = true; + this.m_areaTextBox.Size = new System.Drawing.Size(127, 20); + this.m_areaTextBox.TabIndex = 26; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(405, 84); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 27; + this.button2.Text = "Clear"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnClear); + // + // button3 + // + this.button3.Location = new System.Drawing.Point(405, 109); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 28; + this.button3.Text = "Validate"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.OnValidate); + // + // m_polylineCheckBox + // + this.m_polylineCheckBox.AutoSize = true; + this.m_polylineCheckBox.Location = new System.Drawing.Point(15, 112); + this.m_polylineCheckBox.Name = "m_polylineCheckBox"; + this.m_polylineCheckBox.Size = new System.Drawing.Size(62, 17); + this.m_polylineCheckBox.TabIndex = 29; + this.m_polylineCheckBox.Text = "Polyline"; + this.m_polylineCheckBox.UseVisualStyleBackColor = true; + // + // PolyPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button3); + this.Controls.Add(this.button2); + this.Controls.Add(this.m_areaTextBox); + this.Controls.Add(this.m_lengthTextBox); + this.Controls.Add(this.m_currLonTextBox); + this.Controls.Add(this.m_currLatTextBox); + this.Controls.Add(this.m_numPointsTextBox); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.m_edgeButton); + this.Controls.Add(this.m_distanceTextBox); + this.Controls.Add(this.m_azimuthTextBox); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.button1); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.groupBox1); + this.Name = "PolyPanel"; + this.Size = new System.Drawing.Size(979, 359); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button m_setButton; + private System.Windows.Forms.TextBox m_flatteningTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox m_azimuthTextBox; + private System.Windows.Forms.TextBox m_distanceTextBox; + private System.Windows.Forms.Button m_edgeButton; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox m_numPointsTextBox; + private System.Windows.Forms.TextBox m_currLatTextBox; + private System.Windows.Forms.TextBox m_currLonTextBox; + private System.Windows.Forms.TextBox m_lengthTextBox; + private System.Windows.Forms.TextBox m_areaTextBox; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.CheckBox m_polylineCheckBox; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.cs new file mode 100644 index 000000000..e50673c0f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.cs @@ -0,0 +1,129 @@ +/** + * \file NETGeographicLib\PolyPanel.cs + * \brief NETGeographicLib.PolygonArea example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class PolyPanel : UserControl + { + PolygonArea m_poly = null; + public PolyPanel() + { + InitializeComponent(); + m_poly = new PolygonArea(false); + m_majorRadiusTextBox.Text = m_poly.MajorRadius.ToString(); + m_flatteningTextBox.Text = m_poly.Flattening.ToString(); + m_lengthTextBox.Text = m_areaTextBox.Text = m_numPointsTextBox.Text = "0"; + m_currLatTextBox.Text = m_currLonTextBox.Text = ""; + } + + private void OnSet(object sender, EventArgs e) + { + try + { + double a = Double.Parse(m_majorRadiusTextBox.Text); + double f = Double.Parse(m_flatteningTextBox.Text); + m_poly = new PolygonArea(new Geodesic(a, f), m_polylineCheckBox.Checked); + m_lengthTextBox.Text = m_areaTextBox.Text = m_numPointsTextBox.Text = "0"; + m_currLatTextBox.Text = m_currLonTextBox.Text = ""; + m_edgeButton.Enabled = false; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnAddPoint(object sender, EventArgs e) + { + try + { + double lat = Double.Parse(m_latitudeTextBox.Text); + double lon = Double.Parse(m_longitudeTextBox.Text); + double length, area; + + m_poly.AddPoint(lat, lon); + m_edgeButton.Enabled = true; + m_currLatTextBox.Text = m_latitudeTextBox.Text; + m_currLonTextBox.Text = m_longitudeTextBox.Text; + m_numPointsTextBox.Text = m_poly.Compute(false, false, out length, out area).ToString(); + m_lengthTextBox.Text = length.ToString(); + if ( !m_polylineCheckBox.Checked ) + m_areaTextBox.Text = area.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnAddEdge(object sender, EventArgs e) + { + try + { + double azi = Double.Parse(m_azimuthTextBox.Text); + double dist = Double.Parse(m_distanceTextBox.Text); + + m_poly.AddEdge(azi, dist); + double lat, lon, length, area; + m_poly.CurrentPoint(out lat, out lon); + m_currLatTextBox.Text = lat.ToString(); + m_currLonTextBox.Text = lon.ToString(); + m_numPointsTextBox.Text = m_poly.Compute(false, false, out length, out area).ToString(); + m_lengthTextBox.Text = length.ToString(); + if (!m_polylineCheckBox.Checked) + m_areaTextBox.Text = area.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnClear(object sender, EventArgs e) + { + m_poly.Clear(); + m_edgeButton.Enabled = false; + m_lengthTextBox.Text = m_areaTextBox.Text = m_numPointsTextBox.Text = "0"; + m_currLatTextBox.Text = m_currLonTextBox.Text = ""; + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + double lat, lon, perim, area; + PolygonArea pa = new PolygonArea(new Geodesic(50000.0, 0.001), true); + pa = new PolygonArea(false); + pa.AddPoint(32.0, -86.0); + pa.AddEdge(20.0, 10000.0); + pa.AddEdge(-45.0, 10000.0); + pa.CurrentPoint(out lat, out lon); + pa.Compute(false, false, out perim, out area); + pa.TestEdge(-70.0, 5000.0, false, false, out perim, out area); + pa.TestPoint(31.0, -86.5, false, false, out perim, out area); + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.resx new file mode 100644 index 000000000..ed0aef934 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/PolyPanel.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Program.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Program.cs new file mode 100644 index 000000000..87882dcf5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Program.cs @@ -0,0 +1,31 @@ +/** + * \file NETGeographicLib\Program.cs + * \brief NETGeographicLib application example + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace Projections +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Projections.csproj b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Projections.csproj new file mode 100644 index 000000000..9dfe2a101 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Projections.csproj @@ -0,0 +1,256 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {74B48389-E1D1-491F-B198-ADD4878C3F2B} + WinExe + Properties + Projections + Projections + v4.0 + Client + 512 + + + x86 + true + full + false + $(SolutionDir)$(Configuration)\ + DEBUG;TRACE + prompt + 4 + + + x64 + true + full + false + $(SolutionDir)$(Configuration)64\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + $(SolutionDir)$(Configuration)\ + TRACE + prompt + 4 + + + x64 + pdbonly + true + $(SolutionDir)$(Configuration)64\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + UserControl + + + AccumPanel.cs + + + UserControl + + + AlbersPanel.cs + + + UserControl + + + EllipsoidPanel.cs + + + UserControl + + + EllipticPanel.cs + + + Form + + + Form1.cs + + + UserControl + + + GeocentricPanel.cs + + + UserControl + + + GeodesicPanel.cs + + + UserControl + + + GeoidPanel.cs + + + UserControl + + + GravityPanel.cs + + + UserControl + + + LocalCartesianPanel.cs + + + UserControl + + + MagneticPanel.cs + + + UserControl + + + MiscPanel.cs + + + UserControl + + + PolarStereoPanel.cs + + + UserControl + + + PolyPanel.cs + + + + UserControl + + + ProjectionsPanel.cs + + + + UserControl + + + SphericalHarmonicsPanel.cs + + + UserControl + + + TypeIIIProjPanel.cs + + + AccumPanel.cs + + + AlbersPanel.cs + + + EllipsoidPanel.cs + + + EllipticPanel.cs + + + Form1.cs + + + GeocentricPanel.cs + + + GeodesicPanel.cs + + + GeoidPanel.cs + + + GravityPanel.cs + + + LocalCartesianPanel.cs + + + MagneticPanel.cs + + + MiscPanel.cs + + + PolarStereoPanel.cs + + + PolyPanel.cs + + + ProjectionsPanel.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SphericalHarmonicsPanel.cs + + + TypeIIIProjPanel.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {BC1ADBEC-537D-487E-AF21-8B7025AAF46D} + NETGeographic + + + + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.Designer.cs new file mode 100644 index 000000000..9b89dad86 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.Designer.cs @@ -0,0 +1,388 @@ +namespace Projections +{ + partial class ProjectionsPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.m_setButton = new System.Windows.Forms.Button(); + this.m_flatteningTextBox = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.m_majorRadiusTextBox = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.m_projectionComboBox = new System.Windows.Forms.ComboBox(); + this.label4 = new System.Windows.Forms.Label(); + this.m_lat0TextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.m_lon0TextBox = new System.Windows.Forms.TextBox(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_xTextBox = new System.Windows.Forms.TextBox(); + this.m_yTextBox = new System.Windows.Forms.TextBox(); + this.m_azimuthTextBox = new System.Windows.Forms.TextBox(); + this.m_scaleTextBox = new System.Windows.Forms.TextBox(); + this.m_functionComboBox = new System.Windows.Forms.ComboBox(); + this.label12 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.m_setButton); + this.groupBox1.Controls.Add(this.m_flatteningTextBox); + this.groupBox1.Controls.Add(this.label1); + this.groupBox1.Controls.Add(this.m_majorRadiusTextBox); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(146, 140); + this.groupBox1.TabIndex = 6; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Ellipsoid Parameters"; + // + // m_setButton + // + this.m_setButton.Location = new System.Drawing.Point(12, 107); + this.m_setButton.Name = "m_setButton"; + this.m_setButton.Size = new System.Drawing.Size(75, 23); + this.m_setButton.TabIndex = 4; + this.m_setButton.Text = "Set"; + this.m_toolTip.SetToolTip(this.m_setButton, "Sets ellipsoid parameters"); + this.m_setButton.UseVisualStyleBackColor = true; + this.m_setButton.Click += new System.EventHandler(this.OnSet); + // + // m_flatteningTextBox + // + this.m_flatteningTextBox.Location = new System.Drawing.Point(12, 83); + this.m_flatteningTextBox.Name = "m_flatteningTextBox"; + this.m_flatteningTextBox.Size = new System.Drawing.Size(125, 20); + this.m_flatteningTextBox.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 25); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(109, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Major Radius (meters)"; + // + // m_majorRadiusTextBox + // + this.m_majorRadiusTextBox.Location = new System.Drawing.Point(12, 42); + this.m_majorRadiusTextBox.Name = "m_majorRadiusTextBox"; + this.m_majorRadiusTextBox.Size = new System.Drawing.Size(125, 20); + this.m_majorRadiusTextBox.TabIndex = 2; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(12, 66); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(53, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Flattening"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(14, 146); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(54, 13); + this.label3.TabIndex = 7; + this.label3.Text = "Projection"; + // + // m_projectionComboBox + // + this.m_projectionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_projectionComboBox.FormattingEnabled = true; + this.m_projectionComboBox.Items.AddRange(new object[] { + "Azimuthal Equidistant", + "Cassini Soldner", + "Gnomonic"}); + this.m_projectionComboBox.Location = new System.Drawing.Point(14, 163); + this.m_projectionComboBox.Name = "m_projectionComboBox"; + this.m_projectionComboBox.Size = new System.Drawing.Size(135, 21); + this.m_projectionComboBox.TabIndex = 8; + this.m_toolTip.SetToolTip(this.m_projectionComboBox, "Select projection type"); + this.m_projectionComboBox.SelectedIndexChanged += new System.EventHandler(this.OnProjectectionType); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(156, 12); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(122, 13); + this.label4.TabIndex = 9; + this.label4.Text = "Origin Latitude (degrees)"; + // + // m_lat0TextBox + // + this.m_lat0TextBox.Location = new System.Drawing.Point(156, 28); + this.m_lat0TextBox.Name = "m_lat0TextBox"; + this.m_lat0TextBox.Size = new System.Drawing.Size(128, 20); + this.m_lat0TextBox.TabIndex = 10; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(156, 52); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(131, 13); + this.label5.TabIndex = 11; + this.label5.Text = "Origin Longitude (degrees)"; + // + // m_lon0TextBox + // + this.m_lon0TextBox.Location = new System.Drawing.Point(156, 69); + this.m_lon0TextBox.Name = "m_lon0TextBox"; + this.m_lon0TextBox.Size = new System.Drawing.Size(128, 20); + this.m_lon0TextBox.TabIndex = 12; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(299, 12); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(92, 13); + this.label6.TabIndex = 13; + this.label6.Text = "Latitude (degrees)"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(299, 38); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(101, 13); + this.label7.TabIndex = 14; + this.label7.Text = "Longitude (degrees)"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(299, 64); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(54, 13); + this.label8.TabIndex = 15; + this.label8.Text = "X (meters)"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(299, 90); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(54, 13); + this.label9.TabIndex = 16; + this.label9.Text = "Y (meters)"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(299, 116); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(91, 13); + this.label10.TabIndex = 17; + this.label10.Text = "Azimuth (degrees)"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(299, 142); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(100, 13); + this.label11.TabIndex = 18; + this.label11.Text = "Reciprocal of Scale"; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(407, 8); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_latitudeTextBox.TabIndex = 19; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(407, 34); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_longitudeTextBox.TabIndex = 20; + // + // m_xTextBox + // + this.m_xTextBox.Location = new System.Drawing.Point(407, 60); + this.m_xTextBox.Name = "m_xTextBox"; + this.m_xTextBox.Size = new System.Drawing.Size(100, 20); + this.m_xTextBox.TabIndex = 21; + // + // m_yTextBox + // + this.m_yTextBox.Location = new System.Drawing.Point(407, 86); + this.m_yTextBox.Name = "m_yTextBox"; + this.m_yTextBox.Size = new System.Drawing.Size(100, 20); + this.m_yTextBox.TabIndex = 22; + // + // m_azimuthTextBox + // + this.m_azimuthTextBox.Location = new System.Drawing.Point(407, 112); + this.m_azimuthTextBox.Name = "m_azimuthTextBox"; + this.m_azimuthTextBox.ReadOnly = true; + this.m_azimuthTextBox.Size = new System.Drawing.Size(100, 20); + this.m_azimuthTextBox.TabIndex = 23; + // + // m_scaleTextBox + // + this.m_scaleTextBox.Location = new System.Drawing.Point(407, 138); + this.m_scaleTextBox.Name = "m_scaleTextBox"; + this.m_scaleTextBox.ReadOnly = true; + this.m_scaleTextBox.Size = new System.Drawing.Size(100, 20); + this.m_scaleTextBox.TabIndex = 24; + // + // m_functionComboBox + // + this.m_functionComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_functionComboBox.FormattingEnabled = true; + this.m_functionComboBox.Items.AddRange(new object[] { + "Forward", + "Reverse"}); + this.m_functionComboBox.Location = new System.Drawing.Point(513, 34); + this.m_functionComboBox.Name = "m_functionComboBox"; + this.m_functionComboBox.Size = new System.Drawing.Size(75, 21); + this.m_functionComboBox.TabIndex = 25; + this.m_toolTip.SetToolTip(this.m_functionComboBox, "Select Function"); + this.m_functionComboBox.SelectedIndexChanged += new System.EventHandler(this.OnFunction); + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(513, 12); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(48, 13); + this.label12.TabIndex = 26; + this.label12.Text = "Function"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(513, 59); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 27; + this.button1.Text = "Convert"; + this.m_toolTip.SetToolTip(this.button1, "Execute the selected Function using the selected Projection"); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnConvert); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(516, 137); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 28; + this.button2.Text = "Validate"; + this.m_toolTip.SetToolTip(this.button2, "Verified interfaces"); + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnValidate); + // + // ProjectionsPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.label12); + this.Controls.Add(this.m_functionComboBox); + this.Controls.Add(this.m_scaleTextBox); + this.Controls.Add(this.m_azimuthTextBox); + this.Controls.Add(this.m_yTextBox); + this.Controls.Add(this.m_xTextBox); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.m_lon0TextBox); + this.Controls.Add(this.label5); + this.Controls.Add(this.m_lat0TextBox); + this.Controls.Add(this.label4); + this.Controls.Add(this.m_projectionComboBox); + this.Controls.Add(this.label3); + this.Controls.Add(this.groupBox1); + this.Name = "ProjectionsPanel"; + this.Size = new System.Drawing.Size(790, 289); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button m_setButton; + private System.Windows.Forms.TextBox m_flatteningTextBox; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox m_majorRadiusTextBox; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox m_projectionComboBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox m_lat0TextBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox m_lon0TextBox; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.TextBox m_xTextBox; + private System.Windows.Forms.TextBox m_yTextBox; + private System.Windows.Forms.TextBox m_azimuthTextBox; + private System.Windows.Forms.TextBox m_scaleTextBox; + private System.Windows.Forms.ComboBox m_functionComboBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.cs new file mode 100644 index 000000000..6fd73a6a4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.cs @@ -0,0 +1,250 @@ +/** + * \file NETGeographicLib\ProjectionsPanel.cs + * \brief NETGeographicLib projection example + * + * NETGeographicLib.AzimuthalEquidistant, + * NETGeographicLib.CassiniSoldner, and + * NETGeographicLib.Gnomonic example. + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class ProjectionsPanel : UserControl + { + enum ProjectionTypes + { + AzimuthalEquidistant = 0, + CassiniSoldner = 1, + Gnomonic = 2 + } + ProjectionTypes m_type; + AzimuthalEquidistant m_azimuthal = null; + CassiniSoldner m_cassini = null; + Gnomonic m_gnomonic = null; + Geodesic m_geodesic = null; + + public ProjectionsPanel() + { + InitializeComponent(); + try + { + m_geodesic = new Geodesic(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + m_majorRadiusTextBox.Text = m_geodesic.MajorRadius.ToString(); + m_flatteningTextBox.Text = m_geodesic.Flattening.ToString(); + m_lat0TextBox.Text = m_lon0TextBox.Text = "0"; + m_projectionComboBox.SelectedIndex = 0; + m_functionComboBox.SelectedIndex = 0; + } + + private void OnProjectectionType(object sender, EventArgs e) + { + m_type = (ProjectionTypes)m_projectionComboBox.SelectedIndex; + switch (m_type) + { + case ProjectionTypes.AzimuthalEquidistant: + m_azimuthal = new AzimuthalEquidistant(m_geodesic); + break; + case ProjectionTypes.CassiniSoldner: + double lat0 = Double.Parse( m_lat0TextBox.Text ); + double lon0 = Double.Parse( m_lon0TextBox.Text ); + m_cassini = new CassiniSoldner(lat0, lon0, m_geodesic); + break; + case ProjectionTypes.Gnomonic: + m_gnomonic = new Gnomonic(m_geodesic); + break; + } + } + + private void OnSet(object sender, EventArgs e) + { + try + { + double a = Double.Parse(m_majorRadiusTextBox.Text); + double f = Double.Parse(m_flatteningTextBox.Text); + m_geodesic = new Geodesic(a, f); + } + catch ( Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnFunction(object sender, EventArgs e) + { + switch (m_functionComboBox.SelectedIndex) + { + case 0: + m_latitudeTextBox.ReadOnly = m_longitudeTextBox.ReadOnly = false; + m_xTextBox.ReadOnly = m_yTextBox.ReadOnly = true; + break; + case 1: + m_latitudeTextBox.ReadOnly = m_longitudeTextBox.ReadOnly = true; + m_xTextBox.ReadOnly = m_yTextBox.ReadOnly = false; + break; + } + } + + private void OnConvert(object sender, EventArgs e) + { + try + { + switch (m_type) + { + case ProjectionTypes.AzimuthalEquidistant: + ConvertAzimuthalEquidistant(); + break; + case ProjectionTypes.CassiniSoldner: + ConvertCassiniSoldner(); + break; + case ProjectionTypes.Gnomonic: + ConvertGnomonic(); + break; + } + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void ConvertAzimuthalEquidistant() + { + double lat0 = Double.Parse(m_lat0TextBox.Text); + double lon0 = Double.Parse(m_lon0TextBox.Text); + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, azi = 0.0, rk = 0.0; + switch (m_functionComboBox.SelectedIndex) + { + case 0: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + m_azimuthal.Forward(lat0, lon0, lat, lon, out x, out y, out azi, out rk); + m_xTextBox.Text = x.ToString(); + m_yTextBox.Text = y.ToString(); + break; + case 1: + x = Double.Parse(m_xTextBox.Text); + y = Double.Parse(m_yTextBox.Text); + m_azimuthal.Reverse(lat0, lon0, x, y, out lat, out lon, out azi, out rk); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + break; + } + m_azimuthTextBox.Text = azi.ToString(); + m_scaleTextBox.Text = rk.ToString(); + } + + private void ConvertCassiniSoldner() + { + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, azi = 0.0, rk = 0.0; + switch (m_functionComboBox.SelectedIndex) + { + case 0: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + m_cassini.Forward(lat, lon, out x, out y, out azi, out rk); + m_xTextBox.Text = x.ToString(); + m_yTextBox.Text = y.ToString(); + break; + case 1: + x = Double.Parse(m_xTextBox.Text); + y = Double.Parse(m_yTextBox.Text); + m_cassini.Reverse(x, y, out lat, out lon, out azi, out rk); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + break; + } + m_azimuthTextBox.Text = azi.ToString(); + m_scaleTextBox.Text = rk.ToString(); + } + + private void ConvertGnomonic() + { + double lat0 = Double.Parse(m_lat0TextBox.Text); + double lon0 = Double.Parse(m_lon0TextBox.Text); + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, azi = 0.0, rk = 0.0; + switch (m_functionComboBox.SelectedIndex) + { + case 0: + lat = Double.Parse(m_latitudeTextBox.Text); + lon = Double.Parse(m_longitudeTextBox.Text); + m_gnomonic.Forward(lat0, lon0, lat, lon, out x, out y, out azi, out rk); + m_xTextBox.Text = x.ToString(); + m_yTextBox.Text = y.ToString(); + break; + case 1: + x = Double.Parse(m_xTextBox.Text); + y = Double.Parse(m_yTextBox.Text); + m_gnomonic.Reverse(lat0, lon0, x, y, out lat, out lon, out azi, out rk); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + break; + } + m_azimuthTextBox.Text = azi.ToString(); + m_scaleTextBox.Text = rk.ToString(); + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + double lat = 0.0, lon = 0.0, x = 0.0, y = 0.0, x1 = 0.0, y1 = 0.0, azi = 0.0, rk = 0.0; + AzimuthalEquidistant azimuthal = new AzimuthalEquidistant(m_geodesic); + azimuthal = new AzimuthalEquidistant(); + azimuthal.Forward(32.0, -86.0, 33.0, -87.0, out x, out y, out azi, out rk); + azimuthal.Forward(32.0, -86.0, 33.0, -87.0, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in AzimuthalEquidistant.Forward"); + azimuthal.Reverse(32.0, -86.0, x, y, out lat, out lon, out azi, out rk); + azimuthal.Reverse(32.0, -86.0, x, y, out x1, out y1); + if ( x1 != lat || y1 != lon ) + throw new Exception("Error in AzimuthalEquidistant.Reverse"); + CassiniSoldner cassini = new CassiniSoldner(32.0, -86.0, m_geodesic); + cassini = new CassiniSoldner(32.0, -86.0); + cassini.Reset(31.0, -87.0); + cassini.Forward(32.0, -86.0, out x, out y, out azi, out rk); + cassini.Forward(32.0, -86.0, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in CassiniSoldner.Forward"); + cassini.Reverse(x, y, out lat, out lon, out azi, out rk); + cassini.Reverse(x, y, out x1, out y1); + if (x1 != lat || y1 != lon) + throw new Exception("Error in CassiniSoldner.Reverse"); + Gnomonic gnomonic = new Gnomonic(m_geodesic); + gnomonic = new Gnomonic(); + gnomonic.Forward(32.0, -86.0, 31.0, -87.0, out x, out y, out azi, out rk); + gnomonic.Forward(32.0, -86.0, 31.0, -87.0, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in Gnomonic.Forward"); + gnomonic.Reverse(32.0, -86.0, x, y, out lat, out lon, out azi, out rk); + gnomonic.Reverse(32.0, -86.0, x, y, out x1, out y1); + if (x1 != lat || y1 != lon) + throw new Exception("Error in Gnomonic.Reverse"); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.resx new file mode 100644 index 000000000..3ec30e045 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/ProjectionsPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/AssemblyInfo.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..92f8bc066 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Projections")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Projections")] +[assembly: AssemblyCopyright("Copyright (c) 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9ac75a52-f578-43e8-9994-5f993a535d0d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Resources.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Resources.Designer.cs new file mode 100644 index 000000000..7e2638c21 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.239 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Projections.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Projections.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Resources.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Resources.resx new file mode 100644 index 000000000..117d382fa --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Settings.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Settings.Designer.cs new file mode 100644 index 000000000..d07485ea2 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.239 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Projections.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Settings.settings b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Settings.settings new file mode 100644 index 000000000..4ed82c03d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.Designer.cs new file mode 100644 index 000000000..dbcc8f54d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.Designer.cs @@ -0,0 +1,390 @@ +namespace Projections +{ + partial class SphericalHarmonicsPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.m_toolTip = new System.Windows.Forms.ToolTip(this.components); + this.m_classComboBox = new System.Windows.Forms.ComboBox(); + this.button1 = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.m_tau1Label = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.m_xTextBox = new System.Windows.Forms.TextBox(); + this.m_yTextBox = new System.Windows.Forms.TextBox(); + this.m_zTextBox = new System.Windows.Forms.TextBox(); + this.m_tau1TextBox = new System.Windows.Forms.TextBox(); + this.m_tau2TextBox = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.m_sumTextBox = new System.Windows.Forms.TextBox(); + this.m_gradXTextBox = new System.Windows.Forms.TextBox(); + this.m_gradYTextBox = new System.Windows.Forms.TextBox(); + this.m_gradZTextBox = new System.Windows.Forms.TextBox(); + this.button2 = new System.Windows.Forms.Button(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.m_circleRadiusTextBox = new System.Windows.Forms.TextBox(); + this.m_circleHeightTextBox = new System.Windows.Forms.TextBox(); + this.label12 = new System.Windows.Forms.Label(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // m_classComboBox + // + this.m_classComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_classComboBox.FormattingEnabled = true; + this.m_classComboBox.Items.AddRange(new object[] { + "Spherical Harmonic", + "Spherical Harmonic 1", + "Spherical Harmonic 2"}); + this.m_classComboBox.Location = new System.Drawing.Point(4, 155); + this.m_classComboBox.Name = "m_classComboBox"; + this.m_classComboBox.Size = new System.Drawing.Size(139, 21); + this.m_classComboBox.TabIndex = 10; + this.m_toolTip.SetToolTip(this.m_classComboBox, "Select Class"); + this.m_classComboBox.SelectedIndexChanged += new System.EventHandler(this.OnClass); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(203, 112); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 12; + this.button1.Text = "Compute"; + this.m_toolTip.SetToolTip(this.button1, "Compute harmonic sum and gradient"); + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnCompute); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(4, 8); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(14, 13); + this.label2.TabIndex = 0; + this.label2.Text = "X"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(4, 34); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(14, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Y"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(4, 60); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(14, 13); + this.label3.TabIndex = 2; + this.label3.Text = "Z"; + // + // m_tau1Label + // + this.m_tau1Label.AutoSize = true; + this.m_tau1Label.Location = new System.Drawing.Point(4, 86); + this.m_tau1Label.Name = "m_tau1Label"; + this.m_tau1Label.Size = new System.Drawing.Size(31, 13); + this.m_tau1Label.TabIndex = 3; + this.m_tau1Label.Text = "tau 1"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(4, 112); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(31, 13); + this.label4.TabIndex = 4; + this.label4.Text = "tau 2"; + // + // m_xTextBox + // + this.m_xTextBox.Location = new System.Drawing.Point(43, 4); + this.m_xTextBox.Name = "m_xTextBox"; + this.m_xTextBox.Size = new System.Drawing.Size(100, 20); + this.m_xTextBox.TabIndex = 5; + // + // m_yTextBox + // + this.m_yTextBox.Location = new System.Drawing.Point(43, 30); + this.m_yTextBox.Name = "m_yTextBox"; + this.m_yTextBox.Size = new System.Drawing.Size(100, 20); + this.m_yTextBox.TabIndex = 6; + // + // m_zTextBox + // + this.m_zTextBox.Location = new System.Drawing.Point(43, 56); + this.m_zTextBox.Name = "m_zTextBox"; + this.m_zTextBox.Size = new System.Drawing.Size(100, 20); + this.m_zTextBox.TabIndex = 7; + // + // m_tau1TextBox + // + this.m_tau1TextBox.Location = new System.Drawing.Point(43, 82); + this.m_tau1TextBox.Name = "m_tau1TextBox"; + this.m_tau1TextBox.Size = new System.Drawing.Size(100, 20); + this.m_tau1TextBox.TabIndex = 8; + // + // m_tau2TextBox + // + this.m_tau2TextBox.Location = new System.Drawing.Point(43, 108); + this.m_tau2TextBox.Name = "m_tau2TextBox"; + this.m_tau2TextBox.Size = new System.Drawing.Size(100, 20); + this.m_tau2TextBox.TabIndex = 9; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(4, 136); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(32, 13); + this.label5.TabIndex = 11; + this.label5.Text = "Class"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(158, 8); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(76, 13); + this.label6.TabIndex = 13; + this.label6.Text = "Harmonic Sum"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(158, 33); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(57, 13); + this.label7.TabIndex = 14; + this.label7.Text = "X Gradient"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(158, 60); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(57, 13); + this.label8.TabIndex = 15; + this.label8.Text = "Y Gradient"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(158, 86); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(57, 13); + this.label9.TabIndex = 16; + this.label9.Text = "X Gradient"; + // + // m_sumTextBox + // + this.m_sumTextBox.Location = new System.Drawing.Point(241, 4); + this.m_sumTextBox.Name = "m_sumTextBox"; + this.m_sumTextBox.ReadOnly = true; + this.m_sumTextBox.Size = new System.Drawing.Size(100, 20); + this.m_sumTextBox.TabIndex = 17; + // + // m_gradXTextBox + // + this.m_gradXTextBox.Location = new System.Drawing.Point(241, 29); + this.m_gradXTextBox.Name = "m_gradXTextBox"; + this.m_gradXTextBox.ReadOnly = true; + this.m_gradXTextBox.Size = new System.Drawing.Size(100, 20); + this.m_gradXTextBox.TabIndex = 18; + // + // m_gradYTextBox + // + this.m_gradYTextBox.Location = new System.Drawing.Point(241, 56); + this.m_gradYTextBox.Name = "m_gradYTextBox"; + this.m_gradYTextBox.ReadOnly = true; + this.m_gradYTextBox.Size = new System.Drawing.Size(100, 20); + this.m_gradYTextBox.TabIndex = 19; + // + // m_gradZTextBox + // + this.m_gradZTextBox.Location = new System.Drawing.Point(241, 82); + this.m_gradZTextBox.Name = "m_gradZTextBox"; + this.m_gradZTextBox.ReadOnly = true; + this.m_gradZTextBox.Size = new System.Drawing.Size(100, 20); + this.m_gradZTextBox.TabIndex = 20; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(406, 86); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(100, 23); + this.button2.TabIndex = 21; + this.button2.Text = "Circular Engine"; + this.m_toolTip.SetToolTip(this.button2, "Calculates the sum for the given radius, height, and longitude using a Circular E" + + "ngine"); + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnCircularEngine); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(348, 8); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(69, 13); + this.label10.TabIndex = 22; + this.label10.Text = "Circle Radius"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(348, 33); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(67, 13); + this.label11.TabIndex = 23; + this.label11.Text = "Circle Height"; + // + // m_circleRadiusTextBox + // + this.m_circleRadiusTextBox.Location = new System.Drawing.Point(458, 4); + this.m_circleRadiusTextBox.Name = "m_circleRadiusTextBox"; + this.m_circleRadiusTextBox.Size = new System.Drawing.Size(100, 20); + this.m_circleRadiusTextBox.TabIndex = 24; + // + // m_circleHeightTextBox + // + this.m_circleHeightTextBox.Location = new System.Drawing.Point(458, 29); + this.m_circleHeightTextBox.Name = "m_circleHeightTextBox"; + this.m_circleHeightTextBox.Size = new System.Drawing.Size(100, 20); + this.m_circleHeightTextBox.TabIndex = 25; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(348, 60); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(101, 13); + this.label12.TabIndex = 26; + this.label12.Text = "Longitude (degrees)"; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(458, 56); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(100, 20); + this.m_longitudeTextBox.TabIndex = 27; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(203, 155); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 28; + this.button3.Text = "Validate"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.OnValidate); + // + // SphericalHarmonicsPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.button3); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.label12); + this.Controls.Add(this.m_circleHeightTextBox); + this.Controls.Add(this.m_circleRadiusTextBox); + this.Controls.Add(this.label11); + this.Controls.Add(this.label10); + this.Controls.Add(this.button2); + this.Controls.Add(this.m_gradZTextBox); + this.Controls.Add(this.m_gradYTextBox); + this.Controls.Add(this.m_gradXTextBox); + this.Controls.Add(this.m_sumTextBox); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.label6); + this.Controls.Add(this.button1); + this.Controls.Add(this.label5); + this.Controls.Add(this.m_classComboBox); + this.Controls.Add(this.m_tau2TextBox); + this.Controls.Add(this.m_tau1TextBox); + this.Controls.Add(this.m_zTextBox); + this.Controls.Add(this.m_yTextBox); + this.Controls.Add(this.m_xTextBox); + this.Controls.Add(this.label4); + this.Controls.Add(this.m_tau1Label); + this.Controls.Add(this.label3); + this.Controls.Add(this.label1); + this.Controls.Add(this.label2); + this.Name = "SphericalHarmonicsPanel"; + this.Size = new System.Drawing.Size(785, 293); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ToolTip m_toolTip; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label m_tau1Label; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox m_xTextBox; + private System.Windows.Forms.TextBox m_yTextBox; + private System.Windows.Forms.TextBox m_zTextBox; + private System.Windows.Forms.TextBox m_tau1TextBox; + private System.Windows.Forms.TextBox m_tau2TextBox; + private System.Windows.Forms.ComboBox m_classComboBox; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.TextBox m_sumTextBox; + private System.Windows.Forms.TextBox m_gradXTextBox; + private System.Windows.Forms.TextBox m_gradYTextBox; + private System.Windows.Forms.TextBox m_gradZTextBox; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.TextBox m_circleRadiusTextBox; + private System.Windows.Forms.TextBox m_circleHeightTextBox; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.Button button3; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.cs new file mode 100644 index 000000000..7b04fb3e4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.cs @@ -0,0 +1,199 @@ +/** + * \file NETGeographicLib\SphericalHarmonicsPanel.cs + * \brief NETGeographicLib Spherical Harmonics example + * + * NETGeographicLib.CircularEngine, + * NETGeographicLib.SphericalHarmonic, + * NETGeographicLib.SphericalHarmonic1, and + * NETGeographicLib.SphericalHarmonic2 example. + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class SphericalHarmonicsPanel : UserControl + { + int N = 3, N1 = 2, N2 = 1; // The maxium degrees + double[] C = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + double[] S = {6, 5, 4, 3, 2, 1}; // sine coefficients + double[] C1 = {1, 2, 3, 4, 5, 6}; + double[] S1 = {3, 2, 1}; + double[] C2 = {1, 2, 3}; + double[] S2 = {1}; + double a = 1; + + SphericalHarmonic m_sh0 = null; + SphericalHarmonic1 m_sh1 = null; + SphericalHarmonic2 m_sh2 = null; + + public SphericalHarmonicsPanel() + { + InitializeComponent(); + try + { + m_sh0 = new SphericalHarmonic(C, S, N, a, SphericalHarmonic.Normalization.SCHMIDT); + m_sh1 = new SphericalHarmonic1(C, S, N, C1, S1, N1, a, SphericalHarmonic1.Normalization.FULL); + m_sh2 = new SphericalHarmonic2(C, S, N, C1, S1, N1, C2, S2, N2, a, SphericalHarmonic2.Normalization.FULL); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + m_classComboBox.SelectedIndex = 0; + } + + private void OnClass(object sender, EventArgs e) + { + switch (m_classComboBox.SelectedIndex) + { + case 0: + m_tau1TextBox.ReadOnly = m_tau2TextBox.ReadOnly = true; + break; + case 1: + m_tau1TextBox.ReadOnly = false; + m_tau2TextBox.ReadOnly = true; + break; + case 2: + m_tau1TextBox.ReadOnly = m_tau2TextBox.ReadOnly = false; + break; + } + } + + private void OnCompute(object sender, EventArgs e) + { + try + { + double sum = 0.0, gradx = 0.0, grady = 0.0, gradz = 0.0; + double x = Double.Parse(m_xTextBox.Text); + double y = Double.Parse(m_yTextBox.Text); + double z = Double.Parse(m_zTextBox.Text); + switch (m_classComboBox.SelectedIndex) + { + case 0: + sum = m_sh0.HarmonicSum(x, y, z, out gradx, out grady, out gradz); + break; + case 1: + double tau1 = Double.Parse(m_tau1TextBox.Text); + sum = m_sh1.HarmonicSum(tau1, x, y, z, out gradx, out grady, out gradz); + break; + case 2: + tau1 = Double.Parse(m_tau1TextBox.Text); + double tau2 = Double.Parse(m_tau2TextBox.Text); + sum = m_sh2.HarmonicSum(tau1, tau2, x, y, z, out gradx, out grady, out gradz); + break; + } + m_sumTextBox.Text = sum.ToString(); + m_gradXTextBox.Text = gradx.ToString(); + m_gradYTextBox.Text = grady.ToString(); + m_gradZTextBox.Text = gradz.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnCircularEngine(object sender, EventArgs e) + { + try + { + CircularEngine ce = null; + double p = Double.Parse(m_circleRadiusTextBox.Text); + double z = Double.Parse(m_circleHeightTextBox.Text); + double longitude = Double.Parse(m_longitudeTextBox.Text); + + switch (m_classComboBox.SelectedIndex) + { + case 0: + ce = m_sh0.Circle(p, z, true); + break; + case 1: + double tau1 = Double.Parse(m_tau1TextBox.Text); + ce = m_sh1.Circle(tau1, p, z, true); + break; + case 2: + tau1 = Double.Parse(m_tau1TextBox.Text); + double tau2 = Double.Parse(m_tau2TextBox.Text); + ce = m_sh2.Circle(tau1, tau2, p, z, true); + break; + } + double gradx, grady, gradz; + m_sumTextBox.Text = ce.LongitudeSum(longitude, out gradx, out grady, out gradz).ToString(); + m_gradXTextBox.Text = gradx.ToString(); + m_gradYTextBox.Text = grady.ToString(); + m_gradZTextBox.Text = gradz.ToString(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + const double DEG_TO_RAD = 3.1415926535897932384626433832795 / 180.0; + double gradx, grady, gradz; + SphericalHarmonic s0 = new SphericalHarmonic(C, S, N, N - 1, 0, a, SphericalHarmonic.Normalization.SCHMIDT); + s0 = new SphericalHarmonic(C, S, N, a, SphericalHarmonic.Normalization.SCHMIDT); + double sum = s0.HarmonicSum(1.0, 2.0, 3.0); + double test = s0.HarmonicSum(1.0, 2.0, 3.0, out gradx, out grady, out grady); + if (sum != test) + throw new Exception("Error in SphericalHarmonic.HarmonicSum"); + SphericalCoefficients sc = s0.Coefficients(); + CircularEngine ce = s0.Circle(1.0, 0.5, true); + sum = ce.LongitudeSum(60.0); + test = ce.LongitudeSum(Math.Cos(60.0 * DEG_TO_RAD), Math.Sin(60.0 * DEG_TO_RAD)); + if ( sum != test ) + throw new Exception("Error in CircularEngine.LongitudeSum 1"); + test = ce.LongitudeSum(60.0, out gradx, out grady, out gradz); + if ( sum != test ) + throw new Exception("Error in CircularEngine.LongitudeSum 2"); + ce.LongitudeSum(Math.Cos(60.0 * DEG_TO_RAD), Math.Sin(60.0 * DEG_TO_RAD), out gradx, out grady, out gradz); + if (sum != test) + throw new Exception("Error in CircularEngine.LongitudeSum 3"); + SphericalHarmonic1 s1 = new SphericalHarmonic1(C, S, N, N - 1, 1, C1, S1, N1, N1 - 1, 0, a, SphericalHarmonic1.Normalization.SCHMIDT); + s1 = new SphericalHarmonic1(C, S, N, C1, S1, N1, a, SphericalHarmonic1.Normalization.SCHMIDT); + sum = s1.HarmonicSum(0.95, 1.0, 2.0, 3.0); + test = s1.HarmonicSum(0.95, 1.0, 2.0, 3.0, out gradx, out grady, out gradz); + if (sum != test) + throw new Exception("Error in SphericalHarmonic1.HarmonicSum 3"); + ce = s1.Circle(0.95, 1.0, 0.5, true); + sc = s1.Coefficients(); + sc = s1.Coefficients1(); + SphericalHarmonic2 s2 = new SphericalHarmonic2(C, S, N, N - 1, 2, C1, S1, N1, N1 - 1, 1, + C2, S2, N2, N2 - 1, 0, a, SphericalHarmonic2.Normalization.SCHMIDT); + s2 = new SphericalHarmonic2(C, S, N, C1, S1, N1, C2, S2, N2, a, SphericalHarmonic2.Normalization.SCHMIDT); + sum = s2.HarmonicSum(0.95, 0.8, 1.0, 2.0, 3.0); + test = s2.HarmonicSum(0.95, 0.8, 1.0, 2.0, 3.0, out gradx, out grady, out gradz); + if (sum != test) + throw new Exception("Error in SphericalHarmonic2.HarmonicSum 3"); + ce = s2.Circle(0.95, 0.8, 1.0, 0.5, true); + sc = s2.Coefficients(); + sc = s2.Coefficients1(); + sc = s2.Coefficients2(); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + MessageBox.Show("No errors found", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.resx new file mode 100644 index 000000000..3ec30e045 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/SphericalHarmonicsPanel.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.Designer.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.Designer.cs new file mode 100644 index 000000000..c9ac3d9ef --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.Designer.cs @@ -0,0 +1,336 @@ +namespace Projections +{ + partial class TypeIIIProjPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.m_latitudeTextBox = new System.Windows.Forms.TextBox(); + this.m_longitudeTextBox = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.m_utmPoleCheckBox = new System.Windows.Forms.CheckBox(); + this.m_utmXTextBox = new System.Windows.Forms.TextBox(); + this.m_utmYTextBox = new System.Windows.Forms.TextBox(); + this.m_utmZoneTextBox = new System.Windows.Forms.TextBox(); + this.button1 = new System.Windows.Forms.Button(); + this.button2 = new System.Windows.Forms.Button(); + this.label7 = new System.Windows.Forms.Label(); + this.m_mgrsTextBox = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.label8 = new System.Windows.Forms.Label(); + this.m_osgbYTextBox = new System.Windows.Forms.TextBox(); + this.m_osgbXTextBox = new System.Windows.Forms.TextBox(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.button4 = new System.Windows.Forms.Button(); + this.button5 = new System.Windows.Forms.Button(); + this.m_osgbTextBox = new System.Windows.Forms.TextBox(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(167, 38); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(45, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Latitude"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(167, 67); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(54, 13); + this.label2.TabIndex = 1; + this.label2.Text = "Longitude"; + // + // m_latitudeTextBox + // + this.m_latitudeTextBox.Location = new System.Drawing.Point(227, 34); + this.m_latitudeTextBox.Name = "m_latitudeTextBox"; + this.m_latitudeTextBox.Size = new System.Drawing.Size(126, 20); + this.m_latitudeTextBox.TabIndex = 2; + // + // m_longitudeTextBox + // + this.m_longitudeTextBox.Location = new System.Drawing.Point(227, 63); + this.m_longitudeTextBox.Name = "m_longitudeTextBox"; + this.m_longitudeTextBox.Size = new System.Drawing.Size(126, 20); + this.m_longitudeTextBox.TabIndex = 3; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(445, 10); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(53, 13); + this.label3.TabIndex = 4; + this.label3.Text = "UTMUPS"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(364, 38); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(14, 13); + this.label4.TabIndex = 5; + this.label4.Text = "X"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(364, 67); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(14, 13); + this.label5.TabIndex = 6; + this.label5.Text = "Y"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(364, 98); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(32, 13); + this.label6.TabIndex = 7; + this.label6.Text = "Zone"; + // + // m_utmPoleCheckBox + // + this.m_utmPoleCheckBox.AutoSize = true; + this.m_utmPoleCheckBox.Location = new System.Drawing.Point(364, 124); + this.m_utmPoleCheckBox.Name = "m_utmPoleCheckBox"; + this.m_utmPoleCheckBox.Size = new System.Drawing.Size(76, 17); + this.m_utmPoleCheckBox.TabIndex = 8; + this.m_utmPoleCheckBox.Text = "North Pole"; + this.m_utmPoleCheckBox.UseVisualStyleBackColor = true; + // + // m_utmXTextBox + // + this.m_utmXTextBox.Location = new System.Drawing.Point(456, 34); + this.m_utmXTextBox.Name = "m_utmXTextBox"; + this.m_utmXTextBox.Size = new System.Drawing.Size(126, 20); + this.m_utmXTextBox.TabIndex = 9; + // + // m_utmYTextBox + // + this.m_utmYTextBox.Location = new System.Drawing.Point(456, 63); + this.m_utmYTextBox.Name = "m_utmYTextBox"; + this.m_utmYTextBox.Size = new System.Drawing.Size(126, 20); + this.m_utmYTextBox.TabIndex = 10; + // + // m_utmZoneTextBox + // + this.m_utmZoneTextBox.Location = new System.Drawing.Point(456, 94); + this.m_utmZoneTextBox.Name = "m_utmZoneTextBox"; + this.m_utmZoneTextBox.Size = new System.Drawing.Size(126, 20); + this.m_utmZoneTextBox.TabIndex = 11; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(228, 148); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(85, 23); + this.button1.TabIndex = 12; + this.button1.Text = "<- Convert ->"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnConvertLatLon); + // + // button2 + // + this.button2.Location = new System.Drawing.Point(431, 148); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(81, 23); + this.button2.TabIndex = 13; + this.button2.Text = "<- Convert ->"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnConvertUTMUPS); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(663, 10); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(39, 13); + this.label7.TabIndex = 14; + this.label7.Text = "MGRS"; + // + // m_mgrsTextBox + // + this.m_mgrsTextBox.Location = new System.Drawing.Point(606, 34); + this.m_mgrsTextBox.Name = "m_mgrsTextBox"; + this.m_mgrsTextBox.Size = new System.Drawing.Size(152, 20); + this.m_mgrsTextBox.TabIndex = 15; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(642, 148); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(81, 23); + this.button3.TabIndex = 16; + this.button3.Text = "<- Convert "; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.OnConvertMGRS); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(69, 10); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(37, 13); + this.label8.TabIndex = 17; + this.label8.Text = "OSGB"; + // + // m_osgbYTextBox + // + this.m_osgbYTextBox.Location = new System.Drawing.Point(24, 63); + this.m_osgbYTextBox.Name = "m_osgbYTextBox"; + this.m_osgbYTextBox.Size = new System.Drawing.Size(126, 20); + this.m_osgbYTextBox.TabIndex = 21; + // + // m_osgbXTextBox + // + this.m_osgbXTextBox.Location = new System.Drawing.Point(24, 38); + this.m_osgbXTextBox.Name = "m_osgbXTextBox"; + this.m_osgbXTextBox.Size = new System.Drawing.Size(126, 20); + this.m_osgbXTextBox.TabIndex = 20; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(4, 68); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(14, 13); + this.label9.TabIndex = 19; + this.label9.Text = "Y"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(4, 39); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(14, 13); + this.label10.TabIndex = 18; + this.label10.Text = "X"; + // + // button4 + // + this.button4.Location = new System.Drawing.Point(50, 147); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(75, 23); + this.button4.TabIndex = 22; + this.button4.Text = "Convert ->"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.OnConvertOSGB); + // + // button5 + // + this.button5.Location = new System.Drawing.Point(367, 189); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(75, 23); + this.button5.TabIndex = 23; + this.button5.Text = "Validate"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.OnValidate); + // + // m_osgbTextBox + // + this.m_osgbTextBox.Location = new System.Drawing.Point(7, 93); + this.m_osgbTextBox.Name = "m_osgbTextBox"; + this.m_osgbTextBox.ReadOnly = true; + this.m_osgbTextBox.Size = new System.Drawing.Size(143, 20); + this.m_osgbTextBox.TabIndex = 24; + // + // TypeIIIProjPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.m_osgbTextBox); + this.Controls.Add(this.button5); + this.Controls.Add(this.button4); + this.Controls.Add(this.m_osgbYTextBox); + this.Controls.Add(this.m_osgbXTextBox); + this.Controls.Add(this.label9); + this.Controls.Add(this.label10); + this.Controls.Add(this.label8); + this.Controls.Add(this.button3); + this.Controls.Add(this.m_mgrsTextBox); + this.Controls.Add(this.label7); + this.Controls.Add(this.button2); + this.Controls.Add(this.button1); + this.Controls.Add(this.m_utmZoneTextBox); + this.Controls.Add(this.m_utmYTextBox); + this.Controls.Add(this.m_utmXTextBox); + this.Controls.Add(this.m_utmPoleCheckBox); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.m_longitudeTextBox); + this.Controls.Add(this.m_latitudeTextBox); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Name = "TypeIIIProjPanel"; + this.Size = new System.Drawing.Size(1001, 358); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox m_latitudeTextBox; + private System.Windows.Forms.TextBox m_longitudeTextBox; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.CheckBox m_utmPoleCheckBox; + private System.Windows.Forms.TextBox m_utmXTextBox; + private System.Windows.Forms.TextBox m_utmYTextBox; + private System.Windows.Forms.TextBox m_utmZoneTextBox; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox m_mgrsTextBox; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.TextBox m_osgbYTextBox; + private System.Windows.Forms.TextBox m_osgbXTextBox; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.TextBox m_osgbTextBox; + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.cs b/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.cs new file mode 100644 index 000000000..675d766fb --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.cs @@ -0,0 +1,157 @@ +/** + * \file NETGeographicLib\TypeIIIProjPanel.cs + * \brief NETGeographicLib.projections example + * + * NETGeographicLib.UTMUPS, + * NETGeographicLib.MGRS, and + * NETGeographicLib.OSGB example. + * + * NETGeographicLib is copyright (c) Scott Heiman (2013) + * GeographicLib is Copyright (c) Charles Karney (2010-2012) + * and licensed under the MIT/X11 License. + * For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using NETGeographicLib; + +namespace Projections +{ + public partial class TypeIIIProjPanel : UserControl + { + public TypeIIIProjPanel() + { + InitializeComponent(); + } + + private void OnConvertLatLon(object sender, EventArgs e) + { + try + { + int zone; + bool northp; + double x, y; + string str; + double lat = Double.Parse(m_latitudeTextBox.Text); + double lon = Double.Parse(m_longitudeTextBox.Text); + UTMUPS.Forward(lat, lon, out zone, out northp, out x, out y, (int)UTMUPS.ZoneSpec.STANDARD, true); + m_utmPoleCheckBox.Checked = northp; + m_utmXTextBox.Text = x.ToString(); + m_utmYTextBox.Text = y.ToString(); + m_utmZoneTextBox.Text = zone.ToString(); + MGRS.Forward(zone,northp,x,y,8,out str ); + m_mgrsTextBox.Text = str; + OSGB.Forward(lat, lon, out x, out y); + m_osgbXTextBox.Text = x.ToString(); + m_osgbYTextBox.Text = y.ToString(); + OSGB.GridReference(x, y, 8, out str); + m_osgbTextBox.Text = str; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnConvertUTMUPS(object sender, EventArgs e) + { + try + { + double lat, lon; + string str; + double x = Double.Parse(m_utmXTextBox.Text); + double y = Double.Parse(m_utmYTextBox.Text); + int zone = Int32.Parse(m_utmZoneTextBox.Text); + UTMUPS.Reverse(zone, m_utmPoleCheckBox.Checked, x, y, out lat, out lon, true); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + MGRS.Forward(zone, m_utmPoleCheckBox.Checked, x, y, 8, out str); + m_mgrsTextBox.Text = str; + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + + private void OnConvertMGRS(object sender, EventArgs e) + { + int zone, prec; + bool northp; + double x, y, lat, lon; + MGRS.Reverse(m_mgrsTextBox.Text, out zone, out northp, out x, out y, out prec, true); + m_utmPoleCheckBox.Checked = northp; + m_utmXTextBox.Text = x.ToString(); + m_utmYTextBox.Text = y.ToString(); + m_utmZoneTextBox.Text = zone.ToString(); + UTMUPS.Reverse(zone, northp, x, y, out lat, out lon, true); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + } + + private void OnConvertOSGB(object sender, EventArgs e) + { + // the latitude and longitude returned by OSGB is not WGS84 and should not + // be used with UTMUPS or MGRS. + double x = Double.Parse(m_osgbXTextBox.Text); + double y = Double.Parse(m_osgbYTextBox.Text); + double lat, lon; + OSGB.Reverse(x, y, out lat, out lon); + m_latitudeTextBox.Text = lat.ToString(); + m_longitudeTextBox.Text = lon.ToString(); + } + + private void OnValidate(object sender, EventArgs e) + { + try + { + string str; + int prec, zone, zout; + bool northp; + double x, y, x1, y1, gamma, k, lat, lon; + OSGB.Forward(52.0,-2.0, out x, out y, out gamma, out k); + OSGB.Forward(52.0, -2.0, out x1, out y1); + if (x != x1 || y != y1) + throw new Exception("Error in OSGB.Forward"); + OSGB.Reverse(x, y, out lat, out lon, out gamma, out k); + OSGB.Reverse(x, y, out x1, out y1); + if ( lat != x1 || lon != y1 ) + throw new Exception("Error in OSGB.Reverse"); + OSGB.GridReference(x,y,8,out str); + OSGB.GridReference(str, out x1, out y1, out prec, true); + UTMUPS.StandardZone(32.0, -80.0, (int)UTMUPS.ZoneSpec.STANDARD); + UTMUPS.UTMShift(); + UTMUPS.StandardZone(32.0, -86.0, (int)UTMUPS.ZoneSpec.STANDARD); + UTMUPS.Forward(32.0, -86.0, out zone, out northp, out x, out y, out gamma, out k, (int)UTMUPS.ZoneSpec.STANDARD, true); + UTMUPS.Forward(32.0, -86.0, out zone, out northp, out x1, out y1, (int)UTMUPS.ZoneSpec.STANDARD, true); + if (x != x1 || y != y1) + throw new Exception("Error in UTMUPS.Forward"); + UTMUPS.Reverse(zone, northp, x, y, out lat, out lon, out gamma, out k, true); + UTMUPS.Reverse(zone, northp, x, y, out x1, out y1, true); + if (lat != x1 || lon != y1) + throw new Exception("Error in UTMUPS.Reverse"); + UTMUPS.Transfer(zone, northp, x, y, zone + 1, true, out x1, out y1, out zout); + str = UTMUPS.EncodeZone(zone, northp); + prec = UTMUPS.EncodeEPSG(zone, northp); + UTMUPS.DecodeZone(str, out zone, out northp); + UTMUPS.DecodeEPSG(prec, out zone, out northp); + MGRS.Forward(zone, northp, x, y, 8, out str); + MGRS.Forward(zone, northp, x, y, 32.0, 8, out str); + MGRS.Reverse(str, out zone, out northp, out x, out y, out prec, true); + + MessageBox.Show("No errors detected", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } + catch (Exception xcpt) + { + MessageBox.Show(xcpt.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.resx b/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.resx new file mode 100644 index 000000000..ed0aef934 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/Projections/TypeIIIProjPanel.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Accumulator.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Accumulator.cs new file mode 100644 index 000000000..091a32d70 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Accumulator.cs @@ -0,0 +1,25 @@ +using System; +using NETGeographicLib; + +namespace example_Accumulator +{ + class Program + { + static void Main(string[] args) + { + try { + // Compare using Accumulator and ordinary summation for a sum of large and + // small terms. + double sum = 0; + Accumulator acc = new Accumulator(); + acc.Assign( 0.0 ); + sum += 1e20; sum += 1; sum += 2; sum += 100; sum += 5000; sum += -1e20; + acc.Sum( 1e20 ); acc.Sum( 1 ); acc.Sum( 2 ); acc.Sum( 100 ); acc.Sum( 5000 ); acc.Sum( -1e20 ); + Console.WriteLine(String.Format("{0} {1}", sum, acc.Result())); + } + catch (GeographicErr e) { + Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-AlbersEqualArea.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-AlbersEqualArea.cs new file mode 100644 index 000000000..bf063d372 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-AlbersEqualArea.cs @@ -0,0 +1,39 @@ +using System; +using NETGeographicLib; + +namespace example_AlbersEqualArea +{ + class Program + { + static void Main(string[] args) + { + try { + const double + lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels + k1 = 1, // scale + lon0 = -77 - 45/60.0; // Central meridan + // Set up basic projection + AlbersEqualArea albers = new AlbersEqualArea( Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening, + lat1, lat2, k1); + { + // Sample conversion from geodetic to Albers Equal Area + double lat = 39.95, lon = -75.17; // Philadelphia + double x, y; + albers.Forward(lon0, lat, lon, out x, out y); + Console.WriteLine( String.Format("X: {0} Y: {1}", x, y ) ); + } + { + // Sample conversion from Albers Equal Area grid to geodetic + double x = 220e3, y = -53e3; + double lat, lon; + albers.Reverse(lon0, x, y, out lat, out lon); + Console.WriteLine( String.Format("Latitude: {0} Longitude: {1}", lat, lon ) ); + } + } + catch (GeographicErr e) { + Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-AzimuthalEquidistant.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-AzimuthalEquidistant.cs new file mode 100644 index 000000000..94ce60948 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-AzimuthalEquidistant.cs @@ -0,0 +1,34 @@ +using System; +using NETGeographicLib; + +namespace example_AzimuthalEquidistant +{ + class Program + { + static void Main(string[] args) + { + try { + Geodesic geod = new Geodesic(); // WGS84 + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + AzimuthalEquidistant proj = new AzimuthalEquidistant(geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj.Forward(lat0, lon0, lat, lon, out x, out y); + Console.WriteLine( String.Format("X: {0} Y: {1}", x, y ) ); + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj.Reverse(lat0, lon0, x, y, out lat, out lon); + Console.WriteLine( String.Format("Latitude: {0} Longitude: {1}", lat, lon ) ); + } + } + catch (GeographicErr e) { + Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-CassiniSoldner.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-CassiniSoldner.cs new file mode 100644 index 000000000..ac655896c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-CassiniSoldner.cs @@ -0,0 +1,34 @@ +using System; +using NETGeographicLib; + +namespace example_CassiniSoldner +{ + class Program + { + static void Main(string[] args) + { + try { + Geodesic geod = new Geodesic(); // WGS84 + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + CassiniSoldner proj = new CassiniSoldner(lat0, lon0, geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj.Forward(lat, lon, out x, out y); + Console.WriteLine(String.Format("X: {0} Y: {1}", x, y)); + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj.Reverse(x, y, out lat, out lon); + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon)); + } + } + catch (GeographicErr e) { + Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-CircularEngine.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-CircularEngine.cs new file mode 100644 index 000000000..12e32f5e3 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-CircularEngine.cs @@ -0,0 +1,30 @@ +using System; +using NETGeographicLib; + +namespace example_CircularEngine +{ + class Program + { + static void Main(string[] args) + { + // This computes the same value as example-SphericalHarmonic.cpp using a + // CircularEngine (which will be faster if many values on a circle of + // latitude are to be found). + try { + int N = 3; // The maxium degree + double[] ca = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + double[] sa = {6, 5, 4, 3, 2, 1}; // sine coefficients + double a = 1; + SphericalHarmonic h = new SphericalHarmonic(ca, sa, N, a, SphericalHarmonic.Normalization.SCHMIDT); + double x = 2, y = 3, z = 1, p = Math.Sqrt(x*x+y*y); + CircularEngine circ = h.Circle(p, z, true); + double v, vx, vy, vz; + v = circ.LongitudeSum(x/p, y/p, out vx, out vy, out vz); + Console.WriteLine(String.Format("{0} {1} {2} {3}", v, vx, vy, vz)); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-DMS.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-DMS.cs new file mode 100644 index 000000000..0f070b0de --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-DMS.cs @@ -0,0 +1,28 @@ +using System; +using NETGeographicLib; + +namespace example_DMS +{ + class Program + { + static void Main(string[] args) + { + try { + { + string dms = "30d14'45.6\"S"; + DMS.Flag type; + double ang = DMS.Decode(dms, out type); + Console.WriteLine(String.Format("Type: {0} String: {1}", type, ang)); + } + { + double ang = -30.245715; + string dms = DMS.Encode(ang, 6, DMS.Flag.LATITUDE, 0); + Console.WriteLine(String.Format("Latitude: {0}", dms)); + } + } + catch (GeographicErr e) { + Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Ellipsoid.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Ellipsoid.cs new file mode 100644 index 000000000..8f61b99dc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Ellipsoid.cs @@ -0,0 +1,29 @@ +using System; +using NETGeographicLib; + +namespace example_Ellipsoid +{ + class Program + { + static void Main(string[] args) + { + try { + Ellipsoid wgs84 = new Ellipsoid( Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening); + // Alternatively: Ellipsoid wgs84 = new Ellipsoid(); + Console.WriteLine( String.Format( + "The latitude half way between the equator and the pole is {0}", + wgs84.InverseRectifyingLatitude(45)) ); + Console.WriteLine( String.Format( + "Half the area of the ellipsoid lies between latitudes +/- {0}", + wgs84.InverseAuthalicLatitude(30))); ; + Console.WriteLine( String.Format( + "The northernmost edge of a square Mercator map is at latitude {0}", + wgs84.InverseIsometricLatitude(180))); + } + catch (GeographicErr e) { + Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-EllipticFunction.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-EllipticFunction.cs new file mode 100644 index 000000000..17d4b9d2a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-EllipticFunction.cs @@ -0,0 +1,39 @@ +using System; +using NETGeographicLib; + +namespace example_EllipticFunction +{ + class Program + { + static void Main(string[] args) + { + try { + EllipticFunction ell = new EllipticFunction(0.1, 1.0); // parameter m = 0.1 + // See Abramowitz and Stegun, table 17.1 + Console.WriteLine( String.Format( "{0} {1}", ell.K(), ell.E())); + double phi = 20 * Math.Acos(-1.0) / 180.0;; + // See Abramowitz and Stegun, table 17.6 with + // alpha = asin(sqrt(m)) = 18.43 deg and phi = 20 deg + Console.WriteLine( String.Format("{0} {1}", ell.E(phi), + ell.E(Math.Sin(phi), Math.Cos(phi), + Math.Sqrt(1 - ell.k2 * Math.Sin(phi) * Math.Sin(phi))) ) ); + // See Carlson 1995, Sec 3. + Console.WriteLine(String.Format("RF(1,2,0) = {0}", EllipticFunction.RF(1,2))); + Console.WriteLine(String.Format("RF(2,3,4) = {0}", EllipticFunction.RF(2,3,4))); + Console.WriteLine(String.Format("RC(0,1/4) = {0}", EllipticFunction.RC(0,0.25))); + Console.WriteLine(String.Format("RC(9/4,2) = {0}", EllipticFunction.RC(2.25,2))); + Console.WriteLine(String.Format("RC(1/4,-2) = {0}", EllipticFunction.RC(0.25,-2))); + Console.WriteLine(String.Format("RJ(0,1,2,3) = {0}", EllipticFunction.RJ(0,1,2,3))); + Console.WriteLine(String.Format("RJ(2,3,4,5) = {0}", EllipticFunction.RJ(2,3,4,5))); + Console.WriteLine(String.Format("RD(0,2,1) = {0}", EllipticFunction.RD(0,2,1))); + Console.WriteLine(String.Format("RD(2,3,4) = {0}", EllipticFunction.RD(2,3,4))); + Console.WriteLine(String.Format("RG(0,16,16) = {0}", EllipticFunction.RG(16,16))); + Console.WriteLine(String.Format("RG(2,3,4) = {0}", EllipticFunction.RG(2,3,4))); + Console.WriteLine(String.Format("RG(0,0.0796,4) = {0}", EllipticFunction.RG(0.0796, 4))); + } + catch (GeographicErr e) { + Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeoCoords.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeoCoords.cs new file mode 100644 index 000000000..a62b1aaf7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeoCoords.cs @@ -0,0 +1,26 @@ +using System; +using NETGeographicLib; + +namespace example_GeoCoords +{ + class Program + { + static void Main(string[] args) + { + try { + // Miscellaneous conversions + double lat = 33.3, lon = 44.4; + GeoCoords c = new GeoCoords(lat, lon, -1); + Console.WriteLine(c.MGRSRepresentation(-3)); + c.Reset("18TWN0050", true, false); + Console.WriteLine(c.DMSRepresentation(0, false, 0)); + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", c.Latitude, c.Longitude)); + c.Reset("1d38'W 55d30'N", true, false); + Console.WriteLine(c.GeoRepresentation(0, false)); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geocentric.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geocentric.cs new file mode 100644 index 000000000..7fb837bd7 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geocentric.cs @@ -0,0 +1,37 @@ +using System; +using NETGeographicLib; + +namespace example_Geocentric +{ + class Program + { + static void Main(string[] args) + { + try { + Geocentric earth = new Geocentric( Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening); + // Alternatively: Geocentric earth = new Geocentric(); + { + // Sample forward calculation + double lat = 27.99, lon = 86.93, h = 8820; // Mt Everest + double X, Y, Z; + earth.Forward(lat, lon, h, out X, out Y, out Z); + Console.WriteLine( String.Format( "{0} {1} {2}", + Math.Floor(X / 1000 + 0.5), + Math.Floor(Y / 1000 + 0.5), + Math.Floor(Z / 1000 + 0.5) ) ); + } + { + // Sample reverse calculation + double X = 302e3, Y = 5636e3, Z = 2980e3; + double lat, lon, h; + earth.Reverse(X, Y, Z, out lat, out lon, out h); + Console.WriteLine(String.Format("{0} {1} {2}", lat, lon, h)); + } + } + catch (GeographicErr e) { + Console.WriteLine( String.Format( "Caught exception: {0}", e.Message ) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geodesic.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geodesic.cs new file mode 100644 index 000000000..6cab6c5c9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geodesic.cs @@ -0,0 +1,36 @@ +using System; +using NETGeographicLib; + +namespace example_Geodesic +{ + class Program + { + static void Main(string[] args) + { + try { + Geodesic geod = new Geodesic( Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening ); + // Alternatively: Geodesic geod = new Geodesic(); + { + // Sample direct calculation, travelling about NE from JFK + double lat1 = 40.6, lon1 = -73.8, s12 = 5.5e6, azi1 = 51; + double lat2, lon2; + geod.Direct(lat1, lon1, azi1, s12, out lat2, out lon2); + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat2, lon2)); + } + { + // Sample inverse calculation, JFK to LHR + double + lat1 = 40.6, lon1 = -73.8, // JFK Airport + lat2 = 51.6, lon2 = -0.5; // LHR Airport + double s12; + geod.Inverse(lat1, lon1, lat2, lon2, out s12); + Console.WriteLine( s12 ); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicExact.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicExact.cs new file mode 100644 index 000000000..027d8671f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicExact.cs @@ -0,0 +1,36 @@ +using System; +using NETGeographicLib; + +namespace example_GeodesicExact +{ + class Program + { + static void Main(string[] args) + { + try { + GeodesicExact geod = new GeodesicExact( Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening ); + // Alternatively: GeodesicExact geod = new GeodesicExact(); + { + // Sample direct calculation, travelling about NE from JFK + double lat1 = 40.6, lon1 = -73.8, s12 = 5.5e6, azi1 = 51; + double lat2, lon2; + geod.Direct(lat1, lon1, azi1, s12, out lat2, out lon2); + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat2, lon2)); + } + { + // Sample inverse calculation, JFK to LHR + double + lat1 = 40.6, lon1 = -73.8, // JFK Airport + lat2 = 51.6, lon2 = -0.5; // LHR Airport + double s12; + geod.Inverse(lat1, lon1, lat2, lon2, out s12); + Console.WriteLine(s12); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicLine.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicLine.cs new file mode 100644 index 000000000..a760caada --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicLine.cs @@ -0,0 +1,50 @@ +using System; +using NETGeographicLib; + +namespace example_GeodesicLine +{ + class Program + { + static void Main(string[] args) + { + try + { + // Print waypoints between JFK and SIN + Geodesic geod = new Geodesic(); // WGS84 + double + lat1 = 40.640, lon1 = -73.779, // JFK + lat2 = 1.359, lon2 = 103.989; // SIN + double s12, azi1, azi2, + a12 = geod.Inverse(lat1, lon1, lat2, lon2, out s12, out azi1, out azi2); + GeodesicLine line = new GeodesicLine(geod, lat1, lon1, azi1, Mask.ALL); + // Alternatively GeodesicLine line = geod.Line(lat1, lon1, azi1, Mask.ALL); + double ds = 500e3; // Nominal distance between points = 500 km + int num = (int)(Math.Ceiling(s12 / ds)); // The number of intervals + { + // Use intervals of equal length + ds = s12 / num; + for (int i = 0; i <= num; ++i) + { + double lat, lon; + line.Position(i * ds, out lat, out lon); + Console.WriteLine(String.Format("i: {0} Latitude: {1} Longitude: {2}", i, lat, lon)); + } + } + { + // Slightly faster, use intervals of equal arc length + double da = a12 / num; + for (int i = 0; i <= num; ++i) + { + double lat, lon; + line.ArcPosition(i * da, out lat, out lon); + Console.WriteLine(String.Format("i: {0} Latitude: {1} Longitude: {2}", i, lat, lon)); + } + } + } + catch (GeographicErr e) + { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicLineExact.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicLineExact.cs new file mode 100644 index 000000000..2ca3716a4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GeodesicLineExact.cs @@ -0,0 +1,46 @@ +using System; +using NETGeographicLib; + +namespace example_GeodesicLineExact +{ + class Program + { + static void Main(string[] args) + { + try { + // Print waypoints between JFK and SIN + GeodesicExact geod = new GeodesicExact(); // WGS84 + double + lat1 = 40.640, lon1 = -73.779, // JFK + lat2 = 1.359, lon2 = 103.989; // SIN + double s12, azi1, azi2, + a12 = geod.Inverse(lat1, lon1, lat2, lon2, out s12, out azi1, out azi2); + GeodesicLineExact line = new GeodesicLineExact(geod, lat1, lon1, azi1, Mask.ALL); + // Alternatively GeodesicLine line = geod.Line(lat1, lon1, azi1, Mask.ALL); + double ds = 500e3; // Nominal distance between points = 500 km + int num = (int)(Math.Ceiling(s12 / ds)); // The number of intervals + { + // Use intervals of equal length + ds = s12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line.Position(i * ds, out lat, out lon); + Console.WriteLine( String.Format( "i: {0} Latitude: {1} Longitude: {2}", i, lat, lon )); + } + } + { + // Slightly faster, use intervals of equal arc length + double da = a12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line.ArcPosition(i * da, out lat, out lon); + Console.WriteLine( String.Format( "i: {0} Latitude: {1} Longitude: {2}", i, lat, lon )); + } + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geohash.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geohash.cs new file mode 100644 index 000000000..7d31e63b6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geohash.cs @@ -0,0 +1,37 @@ +using System; +using NETGeographicLib; + +namespace example_Geohash +{ + class Program + { + static void Main(string[] args) + { + try { + { + // Sample forward calculation + double lat = 57.64911, lon = 10.40744; // Jutland (the wikipedia example) + string geohash; + int maxlen = Geohash.GeohashLength(1.0e-5); + for (int len = 0; len <= maxlen; ++len) { + Geohash.Forward(lat, lon, len, out geohash); + Console.WriteLine( geohash ); + } + } + { + // Sample reverse calculation + string geohash = "u4pruydqqvj"; + double lat, lon; + for (int i = 0; i <= geohash.Length; ++i) { + int len; + Geohash.Reverse(geohash.Substring(0, i), out lat, out lon, out len, true); + Console.WriteLine(String.Format("Length: {0} Latitude: {1} Longitude: {2}", len, lat, lon ) ); + } + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geoid.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geoid.cs new file mode 100644 index 000000000..974c641c3 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Geoid.cs @@ -0,0 +1,25 @@ +using System; +using NETGeographicLib; + +namespace example_Geoid +{ + class Program + { + static void Main(string[] args) + { + try { + Geoid egm96 = new Geoid("egm96-5", "", true, false); + // Convert height above egm96 to height above the ellipsoid + double lat = 42, lon = -75, height_above_geoid = 20; + double + geoid_height = egm96.Height(lat, lon), + height_above_ellipsoid = (height_above_geoid + + (double)Geoid.ConvertFlag.GEOIDTOELLIPSOID * geoid_height); + Console.WriteLine(height_above_ellipsoid); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Gnomonic.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Gnomonic.cs new file mode 100644 index 000000000..132e60754 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-Gnomonic.cs @@ -0,0 +1,34 @@ +using System; +using NETGeographicLib; + +namespace example_Gnomonic +{ + class Program + { + static void Main(string[] args) + { + try { + Geodesic geod = new Geodesic(); // WGS84 + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + Gnomonic proj = new Gnomonic(geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj.Forward(lat0, lon0, lat, lon, out x, out y); + Console.WriteLine(String.Format("X: {0} Y: {1}", x, y)); + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj.Reverse(lat0, lon0, x, y, out lat, out lon); + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon)); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GravityCircle.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GravityCircle.cs new file mode 100644 index 000000000..5de81cc72 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GravityCircle.cs @@ -0,0 +1,40 @@ +using System; +using NETGeographicLib; + +namespace example_GravityCircle +{ + class Program + { + static void Main(string[] args) + { + try { + GravityModel grav = new GravityModel("egm96", ""); + double lat = 27.99, lon0 = 86.93, h = 8820; // Mt Everest + { + // Slow method of evaluating the values at several points on a circle of + // latitude. + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double gx, gy, gz; + grav.Gravity(lat, lon, h, out gx, out gy, out gz); + Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, gx, gy, gz)); + } + } + { + // Fast method of evaluating the values at several points on a circle of + // latitude using GravityCircle. + GravityCircle circ = grav.Circle(lat, h, GravityModel.Mask.ALL); + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double gx, gy, gz; + circ.Gravity(lon, out gx, out gy, out gz); + Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, gx, gy, gz)); + } + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GravityModel.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GravityModel.cs new file mode 100644 index 000000000..e43b82e94 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-GravityModel.cs @@ -0,0 +1,22 @@ +using System; +using NETGeographicLib; + +namespace example_GravityModel +{ + class Program + { + static void Main(string[] args) + { + try { + GravityModel grav = new GravityModel("egm96",""); + double lat = 27.99, lon = 86.93, h = 8820; // Mt Everest + double gx, gy, gz; + grav.Gravity(lat, lon, h, out gx, out gy, out gz); + Console.WriteLine(String.Format("{0} {1} {2}", gx, gy, gz)); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-LambertConformalConic.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-LambertConformalConic.cs new file mode 100644 index 000000000..4efa813f3 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-LambertConformalConic.cs @@ -0,0 +1,48 @@ +using System; +using NETGeographicLib; + +namespace example_LambertConformalConic +{ + class Program + { + static void Main(string[] args) + { + try { + // Define the Pennsylvania South state coordinate system EPSG:3364 + // http://www.spatialreference.org/ref/epsg/3364/ + const double + lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels + k1 = 1, // scale + lat0 = 39 + 20/60.0, lon0 =-77 - 45/60.0, // origin + fe = 600000, fn = 0; // false easting and northing + // Set up basic projection + LambertConformalConic PASouth = new LambertConformalConic( Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening, + lat1, lat2, k1); + double x0, y0; + // Transform origin point + PASouth.Forward(lon0, lat0, lon0, out x0, out y0); + x0 -= fe; y0 -= fn; + { + // Sample conversion from geodetic to PASouth grid + double lat = 39.95, lon = -75.17; // Philadelphia + double x, y; + PASouth.Forward(lon0, lat, lon, out x, out y); + x -= x0; y -= y0; + Console.WriteLine( String.Format("{0} {1}", x, y) ); + } + { + // Sample conversion from PASouth grid to geodetic + double x = 820e3, y = 72e3; + double lat, lon; + x += x0; y += y0; + PASouth.Reverse(lon0, x, y, out lat, out lon); + Console.WriteLine( String.Format("{0} {1}", lat, lon) ); + } + } + catch (GeographicErr e) { + Console.WriteLine( String.Format("Caught exception: {0}", e.Message) ); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-LocalCartesian.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-LocalCartesian.cs new file mode 100644 index 000000000..b47987d39 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-LocalCartesian.cs @@ -0,0 +1,34 @@ +using System; +using NETGeographicLib; + +namespace example_LocalCartesian +{ + class Program + { + static void Main(string[] args) + { + try { + Geocentric earth = new Geocentric(); + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + LocalCartesian proj = new LocalCartesian(lat0, lon0, 0, earth); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8, h = 0; // Calais + double x, y, z; + proj.Forward(lat, lon, h, out x, out y, out z); + Console.WriteLine(String.Format("{0} {1} {2}", x, y, z)); + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3, z = -4e3; + double lat, lon, h; + proj.Reverse(x, y, z, out lat, out lon, out h); + Console.WriteLine(String.Format("{0} {1} {2}", lat, lon, h)); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MGRS.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MGRS.cs new file mode 100644 index 000000000..62dc20366 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MGRS.cs @@ -0,0 +1,40 @@ +using System; +using NETGeographicLib; + +namespace example_MGRS +{ + class Program + { + static void Main(string[] args) + { + try { + // See also example-GeoCoords.cpp + { + // Sample forward calculation + double lat = 33.3, lon = 44.4; // Baghdad + int zone; + bool northp; + double x, y; + UTMUPS.Forward(lat, lon, out zone, out northp, out x, out y, -1, true); + string mgrs; + MGRS.Forward(zone, northp, x, y, lat, 5, out mgrs); + Console.WriteLine(mgrs); + } + { + // Sample reverse calculation + string mgrs = "38SMB4488"; + int zone, prec; + bool northp; + double x, y; + MGRS.Reverse(mgrs, out zone, out northp, out x, out y, out prec, true); + double lat, lon; + UTMUPS.Reverse(zone, northp, x, y, out lat, out lon, true); + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon)); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MagneticCircle.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MagneticCircle.cs new file mode 100644 index 000000000..1c92f6f27 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MagneticCircle.cs @@ -0,0 +1,40 @@ +using System; +using NETGeographicLib; + +namespace example_MagneticCircle +{ + class Program + { + static void Main(string[] args) + { + try { + MagneticModel mag = new MagneticModel("wmm2010",""); + double lat = 27.99, lon0 = 86.93, h = 8820, t = 2012; // Mt Everest + { + // Slow method of evaluating the values at several points on a circle of + // latitude. + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double Bx, By, Bz; + mag.Field(t, lat, lon, h, out Bx, out By, out Bz); + Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, Bx, By, Bz)); + } + } + { + // Fast method of evaluating the values at several points on a circle of + // latitude using MagneticCircle. + MagneticCircle circ = mag.Circle(t, lat, h); + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double Bx, By, Bz; + circ.Field(lon, out Bx, out By, out Bz); + Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, Bx, By, Bz)); + } + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MagneticModel.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MagneticModel.cs new file mode 100644 index 000000000..9823707b0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-MagneticModel.cs @@ -0,0 +1,24 @@ +using System; +using NETGeographicLib; + +namespace example_MagneticModel +{ + class Program + { + static void Main(string[] args) + { + try { + MagneticModel mag = new MagneticModel("wmm2010",""); + double lat = 27.99, lon = 86.93, h = 8820, t = 2012; // Mt Everest + double Bx, By, Bz; + mag.Field(t, lat,lon, h, out Bx, out By, out Bz); + double H, F, D, I; + MagneticModel.FieldComponents(Bx, By, Bz, out H, out F, out D, out I); + Console.WriteLine(String.Format("{0} {1} {2} {3}", H, F, D, I)); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-NormalGravity.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-NormalGravity.cs new file mode 100644 index 000000000..73d9af3db --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-NormalGravity.cs @@ -0,0 +1,22 @@ +using System; +using NETGeographicLib; + +namespace example_NormalGravity +{ + class Program + { + static void Main(string[] args) + { + try { + NormalGravity grav = new NormalGravity(NormalGravity.StandardModels.WGS84); + double lat = 27.99, h = 8820; // Mt Everest + double gammay, gammaz; + grav.Gravity(lat, h, out gammay, out gammaz); + Console.WriteLine(String.Format("{0} {1}", gammay, gammaz)); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-OSGB.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-OSGB.cs new file mode 100644 index 000000000..f5d70c2d0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-OSGB.cs @@ -0,0 +1,39 @@ +using System; +using NETGeographicLib; + +namespace example_OSGB +{ + class Program + { + static void Main(string[] args) + { + try { + { + // Sample forward calculation from + // A guide to coordinate systems in Great Britain + double + lat = DMS.Decode(52,39,27.2531), + lon = DMS.Decode( 1,43, 4.5177); + double x, y; + OSGB.Forward(lat, lon, out x, out y); + string gridref; + OSGB.GridReference(x, y, 2, out gridref); + Console.WriteLine(String.Format("{0} {1} {2}", x, y, gridref)); + } + { + // Sample reverse calculation + string gridref = "TG5113"; + double x, y; + int prec; + OSGB.GridReference(gridref, out x, out y, out prec, true); + double lat, lon; + OSGB.Reverse(x, y, out lat, out lon); + Console.WriteLine(String.Format("{0} {1} {2}", prec, lat, lon)); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-PolarStereographic.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-PolarStereographic.cs new file mode 100644 index 000000000..08a242946 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-PolarStereographic.cs @@ -0,0 +1,33 @@ +using System; +using NETGeographicLib; + +namespace example_PolarStereographic +{ + class Program + { + static void Main(string[] args) + { + try { + PolarStereographic proj = new PolarStereographic(); // WGS84 + bool northp = true; + { + // Sample forward calculation + double lat = 61.2, lon = -149.9; // Anchorage + double x, y; + proj.Forward(northp, lat, lon, out x, out y); + Console.WriteLine(String.Format("{0} {1}", x, y)); + } + { + // Sample reverse calculation + double x = -1637e3, y = 2824e3; + double lat, lon; + proj.Reverse(northp, x, y, out lat, out lon); + Console.WriteLine(String.Format("{0} {1}", lat, lon)); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-PolygonArea.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-PolygonArea.cs new file mode 100644 index 000000000..12dedaeee --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-PolygonArea.cs @@ -0,0 +1,26 @@ +using System; +using NETGeographicLib; + +namespace example_PolygonArea +{ + class Program + { + static void Main(string[] args) + { + try { + Geodesic geod = new Geodesic(); // WGS84 + PolygonArea poly = new PolygonArea(geod, true); + poly.AddPoint( 52, 0); // London + poly.AddPoint( 41,-74); // New York + poly.AddPoint(-23,-43); // Rio de Janeiro + poly.AddPoint(-26, 28); // Johannesburg + double perimeter, area; + uint n = poly.Compute(false, true, out perimeter, out area); + Console.WriteLine(String.Format("{0} {1} {2}", n, perimeter, area)); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic.cs new file mode 100644 index 000000000..ca541d7b5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic.cs @@ -0,0 +1,26 @@ +using System; +using NETGeographicLib; + +namespace example_SphericalHarmonic +{ + class Program + { + static void Main(string[] args) + { + try { + int N = 3; // The maximum degree + double[] ca = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + double[] sa = {6, 5, 4, 3, 2, 1}; // sine coefficients + double a = 1; + SphericalHarmonic h = new SphericalHarmonic(ca, sa, N, a, SphericalHarmonic.Normalization.SCHMIDT); + double x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h.HarmonicSum(x, y, z, out vx, out vy, out vz); + Console.WriteLine(String.Format("{0} {1} {2} {3}", v, vx, vy, vz)); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic1.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic1.cs new file mode 100644 index 000000000..f295f786f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic1.cs @@ -0,0 +1,28 @@ +using System; +using NETGeographicLib; + +namespace example_SphericalHarmonic1 +{ + class Program + { + static void Main(string[] args) + { + try { + int N = 3, N1 = 2; // The maximum degrees + double[] ca = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + double[] sa = {6, 5, 4, 3, 2, 1}; // sine coefficients + double[] cb = {1, 2, 3, 4, 5, 6}; + double[] sb = {3, 2, 1}; + double a = 1; + SphericalHarmonic1 h = new SphericalHarmonic1(ca, sa, N, cb, sb, N1, a, SphericalHarmonic1.Normalization.SCHMIDT); + double tau = 0.1, x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h.HarmonicSum(tau, x, y, z, out vx, out vy, out vz); + Console.WriteLine(String.Format("{0} {1} {2} {3}", v, vx, vy, vz)); + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic2.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic2.cs new file mode 100644 index 000000000..5fc5b914d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-SphericalHarmonic2.cs @@ -0,0 +1,35 @@ +using System; +using NETGeographicLib; + +namespace example_SphericalHarmonic2 +{ + class Program + { + static void Main(string[] args) + { + try + { + int N = 3, N1 = 2, N2 = 1; // The maximum degrees + double[] ca = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; // cosine coefficients + double[] sa = { 6, 5, 4, 3, 2, 1 }; // sine coefficients + double[] cb = { 1, 2, 3, 4, 5, 6 }; + double[] sb = { 3, 2, 1 }; + double[] cc = { 2, 1 }; + double[] S2 = { 0 }; + double a = 1; + SphericalHarmonic2 h = new SphericalHarmonic2( + ca, sa, N, N, N, cb, sb, N1, N1, N1, + cc, S2, N2, N2, 0, a, + SphericalHarmonic2.Normalization.SCHMIDT); + double tau1 = 0.1, tau2 = 0.05, x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h.HarmonicSum(tau1, tau2, x, y, z, out vx, out vy, out vz); + Console.WriteLine(String.Format("{0} {1} {2} {3}", v, vx, vy, vz)); + } + catch (GeographicErr e) + { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-TransverseMercator.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-TransverseMercator.cs new file mode 100644 index 000000000..c15611a73 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-TransverseMercator.cs @@ -0,0 +1,33 @@ +using System; +using NETGeographicLib; + +namespace example_TransverseMercator +{ + class Program + { + static void Main(string[] args) + { + try { + TransverseMercator proj = new TransverseMercator(); // WGS84 + double lon0 = -75; // Central meridian for UTM zone 18 + { + // Sample forward calculation + double lat = 40.3, lon = -74.7; // Princeton, NJ + double x, y; + proj.Forward(lon0, lat, lon, out x, out y); + Console.WriteLine(String.Format("{0} {1}", x, y)); + } + { + // Sample reverse calculation + double x = 25e3, y = 4461e3; + double lat, lon; + proj.Reverse(lon0, x, y, out lat, out lon); + Console.WriteLine(String.Format("{0} {1}", lat, lon)); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-TransverseMercatorExact.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-TransverseMercatorExact.cs new file mode 100644 index 000000000..548e6dae9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-TransverseMercatorExact.cs @@ -0,0 +1,33 @@ +using System; +using NETGeographicLib; + +namespace example_TransverseMercatorExact +{ + class Program + { + static void Main(string[] args) + { + try { + TransverseMercatorExact proj = new TransverseMercatorExact(); // WGS84 + double lon0 = -75; // Central meridian for UTM zone 18 + { + // Sample forward calculation + double lat = 40.3, lon = -74.7; // Princeton, NJ + double x, y; + proj.Forward(lon0, lat, lon, out x, out y); + Console.WriteLine(String.Format("{0} {1}", x, y)); + } + { + // Sample reverse calculation + double x = 25e3, y = 4461e3; + double lat, lon; + proj.Reverse(lon0, x, y, out lat, out lon); + Console.WriteLine(String.Format("{0} {1}", lat, lon)); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-UTMUPS.cs b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-UTMUPS.cs new file mode 100644 index 000000000..2e8594d0e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/CS/example-UTMUPS.cs @@ -0,0 +1,39 @@ +using System; +using NETGeographicLib; + +namespace example_UTMUPS +{ + class Program + { + static void Main(string[] args) + { + try { + // See also example-GeoCoords.cpp + { + // Sample forward calculation + double lat = 33.3, lon = 44.4; // Baghdad + int zone; + bool northp; + double x, y; + UTMUPS.Forward(lat, lon, out zone, out northp, out x, out y, -1, true); + string zonestr = UTMUPS.EncodeZone(zone, northp); + Console.WriteLine(String.Format("{0} {1} {2}", zonestr, x, y)); + } + { + // Sample reverse calculation + string zonestr = "38N"; + int zone; + bool northp; + UTMUPS.DecodeZone(zonestr, out zone, out northp); + double x = 444e3, y = 3688e3; + double lat, lon; + UTMUPS.Reverse(zone, northp, x, y, out lat, out lon, true); + Console.WriteLine(String.Format("{0} {1}", lat,lon)); + } + } + catch (GeographicErr e) { + Console.WriteLine(String.Format("Caught exception: {0}", e.Message)); + } + } + } +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/CMakeLists.txt new file mode 100644 index 000000000..ceee57c16 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/CMakeLists.txt @@ -0,0 +1,39 @@ +# Compile (but don't install) a bunch of tiny example programs for +# NETGeographic. These are mainly for including as examples within the +# doxygen documentation; however, compiling them catches most obvious +# blunders. + +file (GLOB EXAMPLE_SOURCES example-*.cpp) +set (EXAMPLES) + +foreach (EXAMPLE_SOURCE ${EXAMPLE_SOURCES}) + get_filename_component (EXAMPLE ${EXAMPLE_SOURCE} NAME_WE) + set (EXAMPLE "net${EXAMPLE}") + set (EXAMPLES ${EXAMPLES} ${EXAMPLE}) + add_executable (${EXAMPLE} EXCLUDE_FROM_ALL ${EXAMPLE_SOURCE}) + add_dependencies (${EXAMPLE} ${NETGEOGRAPHICLIB_LIBRARIES}) + set_target_properties (${EXAMPLE} PROPERTIES COMPILE_FLAGS "/clr") + # This is set up for Release builds only. Change + # Release/NETGeographic.dll to Debug/NETGeographic_d.dll for Debug + # builds. + set_target_properties (${EXAMPLE} PROPERTIES VS_DOTNET_REFERENCES + "${CMAKE_CURRENT_BINARY_DIR}/../../NETGeographicLib/Release/NETGeographic.dll") +endforeach () + +string (REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") +string (REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + +add_custom_target (netexamples DEPENDS ${EXAMPLES}) + +get_target_property (_LIBTYPE ${PROJECT_LIBRARIES} TYPE) +if (_LIBTYPE STREQUAL "SHARED_LIBRARY") + # Copy the shared library on Windows systems to this directory + # (examples) so that the tests can be run. + add_custom_command (TARGET netexamples POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + copy $ ${CMAKE_CFG_INTDIR} + COMMENT "Copying shared library to examples directory") +endif () + +# Put all the examples into a folder in the IDE +set_property (TARGET netexamples ${EXAMPLES} PROPERTY FOLDER .NET-examples) diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Accumulator.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Accumulator.cpp new file mode 100644 index 000000000..a375806c9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Accumulator.cpp @@ -0,0 +1,21 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + // Compare using Accumulator and ordinary summation for a sum of large and + // small terms. + double sum = 0; + Accumulator^ acc = gcnew Accumulator(); + acc->Assign( 0.0 ); + sum += 1e20; sum += 1; sum += 2; sum += 100; sum += 5000; sum += -1e20; + acc->Sum( 1e20 ); acc->Sum( 1 ); acc->Sum( 2 ); acc->Sum( 100 ); acc->Sum( 5000 ); acc->Sum( -1e20 ); + Console::WriteLine(String::Format("{0} {1}", sum, acc->Result())); + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-AlbersEqualArea.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-AlbersEqualArea.cpp new file mode 100644 index 000000000..0f3fa7af8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-AlbersEqualArea.cpp @@ -0,0 +1,35 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + const double + lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels + k1 = 1, // scale + lon0 = -77 - 45/60.0; // Central meridan + // Set up basic projection + AlbersEqualArea^ albers = gcnew AlbersEqualArea( Constants::WGS84::MajorRadius, + Constants::WGS84::Flattening, + lat1, lat2, k1); + { + // Sample conversion from geodetic to Albers Equal Area + double lat = 39.95, lon = -75.17; // Philadelphia + double x, y; + albers->Forward(lon0, lat, lon, x, y); + Console::WriteLine( String::Format("X: {0} Y: {1}", x, y ) ); + } + { + // Sample conversion from Albers Equal Area grid to geodetic + double x = 220e3, y = -53e3; + double lat, lon; + albers->Reverse(lon0, x, y, lat, lon); + Console::WriteLine( String::Format("Latitude: {0} Longitude: {1}", lat, lon ) ); + } + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-AzimuthalEquidistant.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-AzimuthalEquidistant.cpp new file mode 100644 index 000000000..b0a3733ec --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-AzimuthalEquidistant.cpp @@ -0,0 +1,30 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Geodesic^ geod = gcnew Geodesic(); // WGS84 + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + AzimuthalEquidistant^ proj = gcnew AzimuthalEquidistant(geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj->Forward(lat0, lon0, lat, lon, x, y); + Console::WriteLine( String::Format("X: {0} Y: {1}", x, y ) ); + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj->Reverse(lat0, lon0, x, y, lat, lon); + Console::WriteLine( String::Format("Latitude: {0} Longitude: {1}", lat, lon ) ); + } + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-CassiniSoldner.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-CassiniSoldner.cpp new file mode 100644 index 000000000..a03fbeeb5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-CassiniSoldner.cpp @@ -0,0 +1,30 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Geodesic^ geod = gcnew Geodesic(); // WGS84 + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + CassiniSoldner^ proj = gcnew CassiniSoldner(lat0, lon0, geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj->Forward(lat, lon, x, y); + Console::WriteLine(String::Format("X: {0} Y: {1}", x, y)); + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj->Reverse(x, y, lat, lon); + Console::WriteLine(String::Format("Latitude: {0} Longitude: {1}", lat, lon)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-CircularEngine.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-CircularEngine.cpp new file mode 100644 index 000000000..63d582c7c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-CircularEngine.cpp @@ -0,0 +1,26 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + // This computes the same value as example-SphericalHarmonic.cpp using a + // CircularEngine (which will be faster if many values on a circle of + // latitude are to be found). + try { + int N = 3; // The maxium degree + array^ ca = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + array^ sa = {6, 5, 4, 3, 2, 1}; // sine coefficients + double a = 1; + SphericalHarmonic^ h = gcnew SphericalHarmonic(ca, sa, N, a, SphericalHarmonic::Normalization::SCHMIDT); + double x = 2, y = 3, z = 1, p = Math::Sqrt(x*x+y*y); + CircularEngine^ circ = h->Circle(p, z, true); + double v, vx, vy, vz; + v = circ->LongitudeSum(x/p, y/p, vx, vy, vz); + Console::WriteLine(String::Format("{0} {1} {2} {3}", v, vx, vy, vz)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-DMS.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-DMS.cpp new file mode 100644 index 000000000..dd707bca4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-DMS.cpp @@ -0,0 +1,24 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + { + System::String^ dms = "30d14'45.6\"S"; + DMS::Flag type; + double ang = DMS::Decode(dms, type); + Console::WriteLine(String::Format("Type: {0} String: {1}", type, ang)); + } + { + double ang = -30.245715; + System::String^ dms = DMS::Encode(ang, 6, DMS::Flag::LATITUDE, 0); + Console::WriteLine(String::Format("Latitude: {0}", dms)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Ellipsoid.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Ellipsoid.cpp new file mode 100644 index 000000000..be5bd6e78 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Ellipsoid.cpp @@ -0,0 +1,25 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Ellipsoid^ wgs84 = gcnew Ellipsoid( Constants::WGS84::MajorRadius, + Constants::WGS84::Flattening ); + // Alternatively: Ellipsoid^ wgs84 = gcnew Ellipsoid(); + Console::WriteLine( String::Format( + "The latitude half way between the equator and the pole is {0}", + wgs84->InverseRectifyingLatitude(45)) ); + Console::WriteLine( String::Format( + "Half the area of the ellipsoid lies between latitudes +/- {0}", + wgs84->InverseAuthalicLatitude(30))); ; + Console::WriteLine( String::Format( + "The northernmost edge of a square Mercator map is at latitude {0}", + wgs84->InverseIsometricLatitude(180))); + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-EllipticFunction.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-EllipticFunction.cpp new file mode 100644 index 000000000..e5ba10d43 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-EllipticFunction.cpp @@ -0,0 +1,35 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + EllipticFunction^ ell = gcnew EllipticFunction(0.1, 1.0); // parameter m = 0.1 + // See Abramowitz and Stegun, table 17.1 + Console::WriteLine( String::Format( "{0} {1}", ell->K(), ell->E())); + double phi = 20 * Math::Acos(-1.0) / 180.0;; + // See Abramowitz and Stegun, table 17.6 with + // alpha = asin(sqrt(m)) = 18.43 deg and phi = 20 deg + Console::WriteLine( String::Format("{0} {1}", ell->E(phi), + ell->E(Math::Sin(phi), Math::Cos(phi), + Math::Sqrt(1 - ell->k2 * Math::Sin(phi) * Math::Sin(phi))) ) ); + // See Carlson 1995, Sec 3. + Console::WriteLine(String::Format("RF(1,2,0) = {0}", EllipticFunction::RF(1,2))); + Console::WriteLine(String::Format("RF(2,3,4) = {0}", EllipticFunction::RF(2,3,4))); + Console::WriteLine(String::Format("RC(0,1/4) = {0}", EllipticFunction::RC(0,0.25))); + Console::WriteLine(String::Format("RC(9/4,2) = {0}", EllipticFunction::RC(2.25,2))); + Console::WriteLine(String::Format("RC(1/4,-2) = {0}", EllipticFunction::RC(0.25,-2))); + Console::WriteLine(String::Format("RJ(0,1,2,3) = {0}", EllipticFunction::RJ(0,1,2,3))); + Console::WriteLine(String::Format("RJ(2,3,4,5) = {0}", EllipticFunction::RJ(2,3,4,5))); + Console::WriteLine(String::Format("RD(0,2,1) = {0}", EllipticFunction::RD(0,2,1))); + Console::WriteLine(String::Format("RD(2,3,4) = {0}", EllipticFunction::RD(2,3,4))); + Console::WriteLine(String::Format("RG(0,16,16) = {0}", EllipticFunction::RG(16,16))); + Console::WriteLine(String::Format("RG(2,3,4) = {0}", EllipticFunction::RG(2,3,4))); + Console::WriteLine(String::Format("RG(0,0.0796,4) = {0}", EllipticFunction::RG(0.0796, 4))); + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeoCoords.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeoCoords.cpp new file mode 100644 index 000000000..8c9753ec6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeoCoords.cpp @@ -0,0 +1,22 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + // Miscellaneous conversions + double lat = 33.3, lon = 44.4; + GeoCoords^ c = gcnew GeoCoords(lat, lon, -1); + Console::WriteLine(c->MGRSRepresentation(-3)); + c->Reset("18TWN0050", true, false); + Console::WriteLine(c->DMSRepresentation(0, false, 0)); + Console::WriteLine(String::Format("Latitude: {0} Longitude: {1}", c->Latitude, c->Longitude)); + c->Reset("1d38'W 55d30'N", true, false); + Console::WriteLine(c->GeoRepresentation(0, false)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geocentric.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geocentric.cpp new file mode 100644 index 000000000..2996038e1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geocentric.cpp @@ -0,0 +1,33 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Geocentric^ earth = gcnew Geocentric( Constants::WGS84::MajorRadius, + Constants::WGS84::Flattening); + // Alternatively: Geocentric earth = new Geocentric(); + { + // Sample forward calculation + double lat = 27.99, lon = 86.93, h = 8820; // Mt Everest + double X, Y, Z; + earth->Forward(lat, lon, h, X, Y, Z); + Console::WriteLine( String::Format( "{0} {1} {2}", + Math::Floor(X / 1000 + 0.5), + Math::Floor(Y / 1000 + 0.5), + Math::Floor(Z / 1000 + 0.5) ) ); + } + { + // Sample reverse calculation + double X = 302e3, Y = 5636e3, Z = 2980e3; + double lat, lon, h; + earth->Reverse(X, Y, Z, lat, lon, h); + Console::WriteLine(String::Format("{0} {1} {2}", lat, lon, h)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format( "Caught exception: {0}", e->Message ) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geodesic-small.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geodesic-small.cpp new file mode 100644 index 000000000..6c249bfdc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geodesic-small.cpp @@ -0,0 +1,14 @@ +using namespace System; +using namespace NETGeographicLib; + +int main() { + Geodesic^ geod = gcnew Geodesic(); + // Distance from JFK to LHR + double + lat1 = 40.6, lon1 = -73.8, // JFK Airport + lat2 = 51.6, lon2 = -0.5; // LHR Airport + double s12; + geod->Inverse(lat1, lon1, lat2, lon2, s12); + Console::WriteLine( s12 / 1000 + " km" ); + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geodesic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geodesic.cpp new file mode 100644 index 000000000..b461291bf --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geodesic.cpp @@ -0,0 +1,32 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Geodesic^ geod = gcnew Geodesic( Constants::WGS84::MajorRadius, + Constants::WGS84::Flattening ); + // Alternatively: Geodesic^ geod = gcnew Geodesic(); + { + // Sample direct calculation, travelling about NE from JFK + double lat1 = 40.6, lon1 = -73.8, s12 = 5.5e6, azi1 = 51; + double lat2, lon2; + geod->Direct(lat1, lon1, azi1, s12, lat2, lon2); + Console::WriteLine(String::Format("Latitude: {0} Longitude: {1}", lat2, lon2)); + } + { + // Sample inverse calculation, JFK to LHR + double + lat1 = 40.6, lon1 = -73.8, // JFK Airport + lat2 = 51.6, lon2 = -0.5; // LHR Airport + double s12; + geod->Inverse(lat1, lon1, lat2, lon2, s12); + Console::WriteLine( s12 ); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicExact.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicExact.cpp new file mode 100644 index 000000000..91b32bdfb --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicExact.cpp @@ -0,0 +1,32 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + GeodesicExact^ geod = gcnew GeodesicExact( Constants::WGS84::MajorRadius, + Constants::WGS84::Flattening ); + // Alternatively: GeodesicExact^ geod = gcnew GeodesicExact(); + { + // Sample direct calculation, travelling about NE from JFK + double lat1 = 40.6, lon1 = -73.8, s12 = 5.5e6, azi1 = 51; + double lat2, lon2; + geod->Direct(lat1, lon1, azi1, s12, lat2, lon2); + Console::WriteLine(String::Format("Latitude: {0} Longitude: {1}", lat2, lon2)); + } + { + // Sample inverse calculation, JFK to LHR + double + lat1 = 40.6, lon1 = -73.8, // JFK Airport + lat2 = 51.6, lon2 = -0.5; // LHR Airport + double s12; + geod->Inverse(lat1, lon1, lat2, lon2, s12); + Console::WriteLine(s12); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicLine.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicLine.cpp new file mode 100644 index 000000000..a57b903b8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicLine.cpp @@ -0,0 +1,43 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + // Print waypoints between JFK and SIN + Geodesic^ geod = gcnew Geodesic(); // WGS84 + double + lat1 = 40.640, lon1 = -73.779, // JFK + lat2 = 1.359, lon2 = 103.989; // SIN + double s12, azi1, azi2, + a12 = geod->Inverse(lat1, lon1, lat2, lon2, s12, azi1, azi2); + GeodesicLine^ line = gcnew GeodesicLine(geod, lat1, lon1, azi1, Mask::ALL); + // Alternatively + // const GeographicLib::GeodesicLine line = geod.Line(lat1, lon1, azi1); + double ds = 500e3; // Nominal distance between points = 500 km + int num = int(Math::Ceiling(s12 / ds)); // The number of intervals + { + // Use intervals of equal length + double ds = s12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line->Position(i * ds, lat, lon); + Console::WriteLine( String::Format( "i: {0} Latitude: {1} Longitude: {2}", i, lat, lon )); + } + } + { + // Slightly faster, use intervals of equal arc length + double da = a12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line->ArcPosition(i * da, lat, lon); + Console::WriteLine( String::Format( "i: {0} Latitude: {1} Longitude: {2}", i, lat, lon )); + } + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicLineExact.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicLineExact.cpp new file mode 100644 index 000000000..54a8fc767 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GeodesicLineExact.cpp @@ -0,0 +1,43 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + // Print waypoints between JFK and SIN + GeodesicExact^ geod = gcnew GeodesicExact(); // WGS84 + double + lat1 = 40.640, lon1 = -73.779, // JFK + lat2 = 1.359, lon2 = 103.989; // SIN + double s12, azi1, azi2, + a12 = geod->Inverse(lat1, lon1, lat2, lon2, s12, azi1, azi2); + GeodesicLineExact^ line = gcnew GeodesicLineExact(geod, lat1, lon1, azi1, Mask::ALL); + // Alternatively + // const GeographicLib::GeodesicLine line = geod.Line(lat1, lon1, azi1); + double ds = 500e3; // Nominal distance between points = 500 km + int num = int(Math::Ceiling(s12 / ds)); // The number of intervals + { + // Use intervals of equal length + double ds = s12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line->Position(i * ds, lat, lon); + Console::WriteLine( String::Format( "i: {0} Latitude: {1} Longitude: {2}", i, lat, lon )); + } + } + { + // Slightly faster, use intervals of equal arc length + double da = a12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line->ArcPosition(i * da, lat, lon); + Console::WriteLine( String::Format( "i: {0} Latitude: {1} Longitude: {2}", i, lat, lon )); + } + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geohash.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geohash.cpp new file mode 100644 index 000000000..537edc9e1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geohash.cpp @@ -0,0 +1,33 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + { + // Sample forward calculation + double lat = 57.64911, lon = 10.40744; // Jutland (the wikipedia example) + String^ geohash; + int maxlen = Geohash::GeohashLength(1.0e-5); + for (int len = 0; len <= maxlen; ++len) { + Geohash::Forward(lat, lon, len, geohash); + Console::WriteLine( geohash ); + } + } + { + // Sample reverse calculation + String^ geohash = "u4pruydqqvj"; + double lat, lon; + for (int i = 0; i <= geohash->Length; ++i) { + int len; + Geohash::Reverse(geohash->Substring(0, i), lat, lon, len, true); + Console::WriteLine(String::Format("Length: {0} Latitude: {1} Longitude: {2}", len, lat, lon ) ); + } + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geoid.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geoid.cpp new file mode 100644 index 000000000..31d54de74 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Geoid.cpp @@ -0,0 +1,21 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Geoid^ egm96 = gcnew Geoid("egm96-5", "", true, false); + // Convert height above egm96 to height above the ellipsoid + double lat = 42, lon = -75, height_above_geoid = 20; + double + geoid_height = egm96->Height(lat, lon), + height_above_ellipsoid = (height_above_geoid + + (double)Geoid::ConvertFlag::GEOIDTOELLIPSOID * geoid_height); + Console::WriteLine(height_above_ellipsoid); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Gnomonic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Gnomonic.cpp new file mode 100644 index 000000000..f4ae112dc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-Gnomonic.cpp @@ -0,0 +1,30 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Geodesic^ geod = gcnew Geodesic(); // WGS84 + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + Gnomonic^ proj = gcnew Gnomonic(geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj->Forward(lat0, lon0, lat, lon, x, y); + Console::WriteLine(String::Format("X: {0} Y: {1}", x, y)); + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj->Reverse(lat0, lon0, x, y, lat, lon); + Console::WriteLine(String::Format("Latitude: {0} Longitude: {1}", lat, lon)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GravityCircle.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GravityCircle.cpp new file mode 100644 index 000000000..419aecc3a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GravityCircle.cpp @@ -0,0 +1,36 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + GravityModel^ grav = gcnew GravityModel("egm96", ""); + double lat = 27.99, lon0 = 86.93, h = 8820; // Mt Everest + { + // Slow method of evaluating the values at several points on a circle of + // latitude. + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double gx, gy, gz; + grav->Gravity(lat, lon, h, gx, gy, gz); + Console::WriteLine(String::Format("{0} {1} {2} {3}", lon, gx, gy, gz)); + } + } + { + // Fast method of evaluating the values at several points on a circle of + // latitude using GravityCircle. + GravityCircle^ circ = grav->Circle(lat, h, GravityModel::Mask::ALL); + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double gx, gy, gz; + circ->Gravity(lon, gx, gy, gz); + Console::WriteLine(String::Format("{0} {1} {2} {3}", lon, gx, gy, gz)); + } + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GravityModel.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GravityModel.cpp new file mode 100644 index 000000000..f18cd3834 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-GravityModel.cpp @@ -0,0 +1,18 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + GravityModel^ grav = gcnew GravityModel("egm96",""); + double lat = 27.99, lon = 86.93, h = 8820; // Mt Everest + double gx, gy, gz; + grav->Gravity(lat, lon, h, gx, gy, gz); + Console::WriteLine(String::Format("{0} {1} {2}", gx, gy, gz)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-LambertConformalConic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-LambertConformalConic.cpp new file mode 100644 index 000000000..e214b973c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-LambertConformalConic.cpp @@ -0,0 +1,44 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + // Define the Pennsylvania South state coordinate system EPSG:3364 + // http://www.spatialreference.org/ref/epsg/3364/ + const double + lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels + k1 = 1, // scale + lat0 = 39 + 20/60.0, lon0 =-77 - 45/60.0, // origin + fe = 600000, fn = 0; // false easting and northing + // Set up basic projection + LambertConformalConic^ PASouth = gcnew LambertConformalConic( Constants::WGS84::MajorRadius, + Constants::WGS84::Flattening, + lat1, lat2, k1); + double x0, y0; + // Transform origin point + PASouth->Forward(lon0, lat0, lon0, x0, y0); + x0 -= fe; y0 -= fn; + { + // Sample conversion from geodetic to PASouth grid + double lat = 39.95, lon = -75.17; // Philadelphia + double x, y; + PASouth->Forward(lon0, lat, lon, x, y); + x -= x0; y -= y0; + Console::WriteLine( String::Format("{0} {1}", x, y) ); + } + { + // Sample conversion from PASouth grid to geodetic + double x = 820e3, y = 72e3; + double lat, lon; + x += x0; y += y0; + PASouth->Reverse(lon0, x, y, lat, lon); + Console::WriteLine( String::Format("{0} {1}", lat, lon) ); + } + } + catch (GeographicErr^ e) { + Console::WriteLine( String::Format("Caught exception: {0}", e->Message) ); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-LocalCartesian.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-LocalCartesian.cpp new file mode 100644 index 000000000..1de3042ab --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-LocalCartesian.cpp @@ -0,0 +1,30 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Geocentric^ earth = gcnew Geocentric(); + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + LocalCartesian^ proj = gcnew LocalCartesian(lat0, lon0, 0, earth); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8, h = 0; // Calais + double x, y, z; + proj->Forward(lat, lon, h, x, y, z); + Console::WriteLine(String::Format("{0} {1} {2}", x, y, z)); + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3, z = -4e3; + double lat, lon, h; + proj->Reverse(x, y, z, lat, lon, h); + Console::WriteLine(String::Format("{0} {1} {2}", lat, lon, h)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MGRS.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MGRS.cpp new file mode 100644 index 000000000..69fc47d22 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MGRS.cpp @@ -0,0 +1,36 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + // See also example-GeoCoords.cpp + { + // Sample forward calculation + double lat = 33.3, lon = 44.4; // Baghdad + int zone; + bool northp; + double x, y; + UTMUPS::Forward(lat, lon, zone, northp, x, y, -1, true); + String^ mgrs; + MGRS::Forward(zone, northp, x, y, lat, 5, mgrs); + Console::WriteLine(mgrs); + } + { + // Sample reverse calculation + String^ mgrs = "38SMB4488"; + int zone, prec; + bool northp; + double x, y; + MGRS::Reverse(mgrs, zone, northp, x, y, prec, true); + double lat, lon; + UTMUPS::Reverse(zone, northp, x, y, lat, lon, true); + Console::WriteLine(String::Format("Latitude: {0} Longitude: {1}", lat, lon)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MagneticCircle.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MagneticCircle.cpp new file mode 100644 index 000000000..d7fd87856 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MagneticCircle.cpp @@ -0,0 +1,36 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + MagneticModel^ mag = gcnew MagneticModel("wmm2010",""); + double lat = 27.99, lon0 = 86.93, h = 8820, t = 2012; // Mt Everest + { + // Slow method of evaluating the values at several points on a circle of + // latitude. + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double Bx, By, Bz; + mag->Field(t, lat, lon, h, Bx, By, Bz); + Console::WriteLine(String::Format("{0} {1} {2} {3}", lon, Bx, By, Bz)); + } + } + { + // Fast method of evaluating the values at several points on a circle of + // latitude using MagneticCircle. + MagneticCircle^ circ = mag->Circle(t, lat, h); + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double Bx, By, Bz; + circ->Field(lon, Bx, By, Bz); + Console::WriteLine(String::Format("{0} {1} {2} {3}", lon, Bx, By, Bz)); + } + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MagneticModel.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MagneticModel.cpp new file mode 100644 index 000000000..5748d71e4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-MagneticModel.cpp @@ -0,0 +1,20 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + MagneticModel^ mag = gcnew MagneticModel("wmm2010",""); + double lat = 27.99, lon = 86.93, h = 8820, t = 2012; // Mt Everest + double Bx, By, Bz; + mag->Field(t, lat,lon, h, Bx, By, Bz); + double H, F, D, I; + MagneticModel::FieldComponents(Bx, By, Bz, H, F, D, I); + Console::WriteLine(String::Format("{0} {1} {2} {3}", H, F, D, I)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-NormalGravity.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-NormalGravity.cpp new file mode 100644 index 000000000..483e57fda --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-NormalGravity.cpp @@ -0,0 +1,18 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + NormalGravity^ grav = gcnew NormalGravity(NormalGravity::StandardModels::WGS84); + double lat = 27.99, h = 8820; // Mt Everest + double gammay, gammaz; + grav->Gravity(lat, h, gammay, gammaz); + Console::WriteLine(String::Format("{0} {1}", gammay, gammaz)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-OSGB.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-OSGB.cpp new file mode 100644 index 000000000..f1be049f8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-OSGB.cpp @@ -0,0 +1,35 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + { + // Sample forward calculation from + // A guide to coordinate systems in Great Britain + double + lat = DMS::Decode(52,39,27.2531), + lon = DMS::Decode( 1,43, 4.5177); + double x, y; + OSGB::Forward(lat, lon, x, y); + String^ gridref; + OSGB::GridReference(x, y, 2, gridref); + Console::WriteLine(String::Format("{0} {1} {2}", x, y, gridref)); + } + { + // Sample reverse calculation + String^ gridref = "TG5113"; + double x, y; + int prec; + OSGB::GridReference(gridref, x, y, prec, true); + double lat, lon; + OSGB::Reverse(x, y, lat, lon); + Console::WriteLine(String::Format("{0} {1} {2}", prec, lat, lon)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return 0; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-PolarStereographic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-PolarStereographic.cpp new file mode 100644 index 000000000..f4f226fc8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-PolarStereographic.cpp @@ -0,0 +1,29 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + PolarStereographic^ proj = gcnew PolarStereographic(); // WGS84 + bool northp = true; + { + // Sample forward calculation + double lat = 61.2, lon = -149.9; // Anchorage + double x, y; + proj->Forward(northp, lat, lon, x, y); + Console::WriteLine(String::Format("{0} {1}", x, y)); + } + { + // Sample reverse calculation + double x = -1637e3, y = 2824e3; + double lat, lon; + proj->Reverse(northp, x, y, lat, lon); + Console::WriteLine(String::Format("{0} {1}", lat, lon)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-PolygonArea.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-PolygonArea.cpp new file mode 100644 index 000000000..3f6716c3a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-PolygonArea.cpp @@ -0,0 +1,22 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + Geodesic^ geod = gcnew Geodesic(); // WGS84 + PolygonArea^ poly = gcnew PolygonArea(geod, true); + poly->AddPoint( 52, 0); // London + poly->AddPoint( 41,-74); // New York + poly->AddPoint(-23,-43); // Rio de Janeiro + poly->AddPoint(-26, 28); // Johannesburg + double perimeter, area; + unsigned int n = poly->Compute(false, true, perimeter, area); + Console::WriteLine(String::Format("{0} {1} {2}", n, perimeter, area)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic.cpp new file mode 100644 index 000000000..7a5100349 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic.cpp @@ -0,0 +1,22 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + int N = 3; // The maximum degree + array^ ca = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + array^ sa = {6, 5, 4, 3, 2, 1}; // sine coefficients + double a = 1; + SphericalHarmonic^ h = gcnew SphericalHarmonic(ca, sa, N, a, SphericalHarmonic::Normalization::SCHMIDT); + double x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h->HarmonicSum(x, y, z, vx, vy, vz); + Console::WriteLine(String::Format("{0} {1} {2} {3}", v, vx, vy, vz)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic1.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic1.cpp new file mode 100644 index 000000000..520e45ab5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic1.cpp @@ -0,0 +1,24 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + int N = 3, N1 = 2; // The maximum degrees + array^ ca = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + array^ sa = {6, 5, 4, 3, 2, 1}; // sine coefficients + array^ cb = {1, 2, 3, 4, 5, 6}; + array^ sb = {3, 2, 1}; + double a = 1; + SphericalHarmonic1^ h = gcnew SphericalHarmonic1(ca, sa, N, cb, sb, N1, a, SphericalHarmonic1::Normalization::SCHMIDT); + double tau = 0.1, x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h->HarmonicSum(tau, x, y, z, vx, vy, vz); + Console::WriteLine(String::Format("{0} {1} {2} {3}", v, vx, vy, vz)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic2.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic2.cpp new file mode 100644 index 000000000..8340da15c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-SphericalHarmonic2.cpp @@ -0,0 +1,30 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try + { + int N = 3, N1 = 2, N2 = 1; // The maximum degrees + array^ ca = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 }; // cosine coefficients + array^ sa = { 6, 5, 4, 3, 2, 1 }; // sine coefficients + array^ cb = { 1, 2, 3, 4, 5, 6 }; + array^ sb = { 3, 2, 1 }; + array^ cc = { 2, 1 }; + array^ S2 = { 0 }; + double a = 1; + SphericalHarmonic2^ h = gcnew SphericalHarmonic2( + ca, sa, N, N, N, cb, sb, N1, N1, N1, + cc, S2, N2, N2, 0, a, + SphericalHarmonic2::Normalization::SCHMIDT); + double tau1 = 0.1, tau2 = 0.05, x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h->HarmonicSum(tau1, tau2, x, y, z, vx, vy, vz); + Console::WriteLine(String::Format("{0} {1} {2} {3}", v, vx, vy, vz)); + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-TransverseMercator.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-TransverseMercator.cpp new file mode 100644 index 000000000..94c7163a4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-TransverseMercator.cpp @@ -0,0 +1,29 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + TransverseMercator^ proj = gcnew TransverseMercator(); // WGS84 + double lon0 = -75; // Central meridian for UTM zone 18 + { + // Sample forward calculation + double lat = 40.3, lon = -74.7; // Princeton, NJ + double x, y; + proj->Forward(lon0, lat, lon, x, y); + Console::WriteLine(String::Format("{0} {1}", x, y)); + } + { + // Sample reverse calculation + double x = 25e3, y = 4461e3; + double lat, lon; + proj->Reverse(lon0, x, y, lat, lon); + Console::WriteLine(String::Format("{0} {1}", lat, lon)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-TransverseMercatorExact.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-TransverseMercatorExact.cpp new file mode 100644 index 000000000..2f41fa616 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-TransverseMercatorExact.cpp @@ -0,0 +1,29 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + TransverseMercatorExact^ proj = gcnew TransverseMercatorExact(); // WGS84 + double lon0 = -75; // Central meridian for UTM zone 18 + { + // Sample forward calculation + double lat = 40.3, lon = -74.7; // Princeton, NJ + double x, y; + proj->Forward(lon0, lat, lon, x, y); + Console::WriteLine(String::Format("{0} {1}", x, y)); + } + { + // Sample reverse calculation + double x = 25e3, y = 4461e3; + double lat, lon; + proj->Reverse(lon0, x, y, lat, lon); + Console::WriteLine(String::Format("{0} {1}", lat, lon)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-UTMUPS.cpp b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-UTMUPS.cpp new file mode 100644 index 000000000..c90ebe0ba --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/ManagedCPP/example-UTMUPS.cpp @@ -0,0 +1,35 @@ +using namespace System; +using namespace NETGeographicLib; + +int main(array ^/*args*/) +{ + try { + // See also example-GeoCoords.cpp + { + // Sample forward calculation + double lat = 33.3, lon = 44.4; // Baghdad + int zone; + bool northp; + double x, y; + UTMUPS::Forward(lat, lon, zone, northp, x, y, -1, true); + String^ zonestr = UTMUPS::EncodeZone(zone, northp); + Console::WriteLine(String::Format("{0} {1} {2}", zonestr, x, y)); + } + { + // Sample reverse calculation + String^ zonestr = "38N"; + int zone; + bool northp; + UTMUPS::DecodeZone(zonestr, zone, northp); + double x = 444e3, y = 3688e3; + double lat, lon; + UTMUPS::Reverse(zone, northp, x, y, lat, lon, true); + Console::WriteLine(String::Format("{0} {1}", lat,lon)); + } + } + catch (GeographicErr^ e) { + Console::WriteLine(String::Format("Caught exception: {0}", e->Message)); + return -1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Accumulator.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Accumulator.vb new file mode 100644 index 000000000..3abc3aa86 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Accumulator.vb @@ -0,0 +1,18 @@ +Imports NETGeographicLib + +Module example_Accumulator + Public Sub Main() + Try + ' Compare using Accumulator and ordinary summation for a sum of large and + ' small terms. + Dim sum As Double = 0.0 + Dim acc As Accumulator = New Accumulator() + acc.Assign(0.0) + sum += 1.0E+20 : sum += 1 : sum += 2 : sum += 100 : sum += 5000 + sum += -1.0E+20 : acc.Sum(1.0E+20) : acc.Sum(1) : acc.Sum(2) : acc.Sum(100) : acc.Sum(5000) : acc.Sum(-1.0E+20) + Console.WriteLine(String.Format("{0} {1}", sum, acc.Result())) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-AlbersEqualArea.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-AlbersEqualArea.vb new file mode 100644 index 000000000..221eebb16 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-AlbersEqualArea.vb @@ -0,0 +1,26 @@ +Imports NETGeographicLib + +Module example_AlbersEqualArea + Sub Main() + Try + Dim lat1 As Double = 40 + 58 / 60.0 : Dim lat2 As Double = 39 + 56 / 60.0 ' standard parallels + Dim k1 As Double = 1 ' scale + Dim lon0 As Double = -77 - 45 / 60.0 ' Central meridan + ' Set up basic projection + Dim albers As AlbersEqualArea = New AlbersEqualArea(Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening, + lat1, lat2, k1) + ' Sample conversion from geodetic to Albers Equal Area + Dim lat As Double = 39.95 : Dim lon As Double = -75.17 ' Philadelphia + Dim x, y As Double + albers.Forward(lon0, lat, lon, x, y) + Console.WriteLine(String.Format("X: {0} Y: {1}", x, y)) + ' Sample conversion from Albers Equal Area grid to geodetic + x = 220000.0 : y = -53000.0 + albers.Reverse(lon0, x, y, lat, lon) + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-AzimuthalEquidistant.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-AzimuthalEquidistant.vb new file mode 100644 index 000000000..7f818abcc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-AzimuthalEquidistant.vb @@ -0,0 +1,22 @@ +Imports NETGeographicLib + +Module example_AzimuthalEquidistant + Sub Main() + Try + Dim geod As Geodesic = New Geodesic() ' WGS84 + Dim lat0 As Double = 48 + 50 / 60.0, lon0 = 2 + 20 / 60.0 ' Paris + Dim proj As AzimuthalEquidistant = New AzimuthalEquidistant(geod) + ' Sample forward calculation + Dim lat As Double = 50.9, lon = 1.8 ' Calais + Dim x, y As Double + proj.Forward(lat0, lon0, lat, lon, x, y) + Console.WriteLine(String.Format("X: {0} Y: {1}", x, y)) + ' Sample reverse calculation + x = -38000.0 : y = 230000.0 + proj.Reverse(lat0, lon0, x, y, lat, lon) + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-CassiniSoldner.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-CassiniSoldner.vb new file mode 100644 index 000000000..e5bb9a76f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-CassiniSoldner.vb @@ -0,0 +1,22 @@ +Imports NETGeographicLib + +Module example_CassiniSoldner + Sub Main() + Try + Dim geod As Geodesic = New Geodesic() ' WGS84 + Dim lat0 As Double = 48 + 50 / 60.0, lon0 = 2 + 20 / 60.0 ' Paris + Dim proj As CassiniSoldner = New CassiniSoldner(lat0, lon0, geod) + ' Sample forward calculation + Dim lat As Double = 50.9, lon = 1.8 ' Calais + Dim x, y As Double + proj.Forward(lat, lon, x, y) + Console.WriteLine(String.Format("X: {0} Y: {1}", x, y)) + ' Sample reverse calculation + x = -38000.0 : y = 230000.0 + proj.Reverse(x, y, lat, lon) + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-CircularEngine.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-CircularEngine.vb new file mode 100644 index 000000000..abe56087f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-CircularEngine.vb @@ -0,0 +1,23 @@ +Imports NETGeographicLib + +Module example_CircularEngine + Sub Main() + ' This computes the same value as example-SphericalHarmonic.cpp using a + ' CircularEngine (which will be faster if many values on a circle of + ' latitude are to be found). + Try + Dim N As Integer = 3 ' The maxium degree + Dim ca As Double() = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1} ' cosine coefficients + Dim sa As Double() = {6, 5, 4, 3, 2, 1} ' sine coefficients + Dim a As Double = 1 + Dim h As SphericalHarmonic = New SphericalHarmonic(ca, sa, N, a, SphericalHarmonic.Normalization.SCHMIDT) + Dim x As Double = 2, y = 3, z = 1, p = Math.Sqrt(x * x + y * y) + Dim circ As CircularEngine = h.Circle(p, z, True) + Dim v, vx, vy, vz As Double + v = circ.LongitudeSum(x / p, y / p, vx, vy, vz) + Console.WriteLine(String.Format("{0} {1} {2} {3}", v, vx, vy, vz)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-DMS.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-DMS.vb new file mode 100644 index 000000000..0647e2ef9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-DMS.vb @@ -0,0 +1,18 @@ +Imports NETGeographicLib + +Module example_DMS + Sub Main() + Try + Dim desc As String = "30d14'45.6""S" + Dim type As DMS.Flag + Dim ang As Double = DMS.Decode(desc, type) + Console.WriteLine(String.Format("Type: {0} String: {1}", type, ang)) + ang = -30.245715 + Dim prec As UInteger = 6 + desc = DMS.Encode(ang, prec, DMS.Flag.LATITUDE, 0) + Console.WriteLine(String.Format("Latitude: {0}", desc)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Ellipsoid.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Ellipsoid.vb new file mode 100644 index 000000000..00cd4339f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Ellipsoid.vb @@ -0,0 +1,22 @@ +Imports NETGeographicLib + +Module example_Ellipsoid + Sub Main() + Try + Dim wgs84 As Ellipsoid = New Ellipsoid(Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening) + ' Alternatively: Dim wgs84 As Ellipsoid = new Ellipsoid() + Console.WriteLine(String.Format( + "The latitude half way between the equator and the pole is {0}", + wgs84.InverseRectifyingLatitude(45))) + Console.WriteLine(String.Format( + "Half the area of the ellipsoid lies between latitudes +/- {0}", + wgs84.InverseAuthalicLatitude(30))) + Console.WriteLine(String.Format( + "The northernmost edge of a square Mercator map is at latitude {0}", + wgs84.InverseIsometricLatitude(180))) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-EllipticFunction.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-EllipticFunction.vb new file mode 100644 index 000000000..cb3d4e6d9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-EllipticFunction.vb @@ -0,0 +1,32 @@ +Imports NETGeographicLib + +Module example_EllipticFunction + Sub Main() + Try + Dim ell As EllipticFunction = New EllipticFunction(0.1, 1.0) + ' See Abramowitz and Stegun, table 17.1 + Console.WriteLine(String.Format("{0} {1}", ell.K(), ell.E())) + Dim phi As Double = 20 * Math.Acos(-1.0) / 180.0 + ' See Abramowitz and Stegun, table 17.6 with + ' alpha = asin(sqrt(m)) = 18.43 deg and phi = 20 deg + Console.WriteLine(String.Format("{0} {1}", ell.E(phi), + ell.E(Math.Sin(phi), Math.Cos(phi), + Math.Sqrt(1 - ell.k2 * Math.Sin(phi) * Math.Sin(phi))))) + ' See Carlson 1995, Sec 3. + Console.WriteLine(String.Format("RF(1,2,0) = {0}", EllipticFunction.RF(1, 2))) + Console.WriteLine(String.Format("RF(2,3,4) = {0}", EllipticFunction.RF(2, 3, 4))) + Console.WriteLine(String.Format("RC(0,1/4) = {0}", EllipticFunction.RC(0, 0.25))) + Console.WriteLine(String.Format("RC(9/4,2) = {0}", EllipticFunction.RC(2.25, 2))) + Console.WriteLine(String.Format("RC(1/4,-2) = {0}", EllipticFunction.RC(0.25, -2))) + Console.WriteLine(String.Format("RJ(0,1,2,3) = {0}", EllipticFunction.RJ(0, 1, 2, 3))) + Console.WriteLine(String.Format("RJ(2,3,4,5) = {0}", EllipticFunction.RJ(2, 3, 4, 5))) + Console.WriteLine(String.Format("RD(0,2,1) = {0}", EllipticFunction.RD(0, 2, 1))) + Console.WriteLine(String.Format("RD(2,3,4) = {0}", EllipticFunction.RD(2, 3, 4))) + Console.WriteLine(String.Format("RG(0,16,16) = {0}", EllipticFunction.RG(16, 16))) + Console.WriteLine(String.Format("RG(2,3,4) = {0}", EllipticFunction.RG(2, 3, 4))) + Console.WriteLine(String.Format("RG(0,0.0796,4) = {0}", EllipticFunction.RG(0.0796, 4))) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeoCoords.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeoCoords.vb new file mode 100644 index 000000000..c2496d62c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeoCoords.vb @@ -0,0 +1,19 @@ +Imports NETGeographicLib + +Module example_GeoCoords + Sub Main() + Try + ' Miscellaneous conversions + Dim lat As Double = 33.3, lon = 44.4 + Dim c As GeoCoords = New GeoCoords(lat, lon, -1) + Console.WriteLine(c.MGRSRepresentation(-3)) + c.Reset("18TWN0050", True, False) + Console.WriteLine(c.DMSRepresentation(0, False, 0)) + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", c.Latitude, c.Longitude)) + c.Reset("1d38'W 55d30'N", True, False) + Console.WriteLine(c.GeoRepresentation(0, False)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geocentric.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geocentric.vb new file mode 100644 index 000000000..79a184886 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geocentric.vb @@ -0,0 +1,25 @@ +Imports NETGeographicLib + +Module example_Geocentric + Sub Main() + Try + Dim earth As Geocentric = New Geocentric(Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening) + ' Alternatively: Geocentric earth = new Geocentric(); + ' Sample forward calculation + Dim lat As Double = 27.99, lon = 86.93, h = 8820 ' Mt Everest + Dim X, Y, Z As Double + earth.Forward(lat, lon, h, X, Y, Z) + Console.WriteLine(String.Format("{0} {1} {2}", + Math.Floor(X / 1000 + 0.5), + Math.Floor(Y / 1000 + 0.5), + Math.Floor(Z / 1000 + 0.5))) + ' Sample reverse calculation + X = 302000.0 : Y = 5636000.0 : Z = 2980000.0 + earth.Reverse(X, Y, Z, lat, lon, h) + Console.WriteLine(String.Format("{0} {1} {2}", lat, lon, h)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geodesic.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geodesic.vb new file mode 100644 index 000000000..ff7e94fc8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geodesic.vb @@ -0,0 +1,23 @@ +Imports NETGeographicLib + +Module example_Geodesic + Sub Main() + Try + Dim geod As Geodesic = New Geodesic(Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening) + ' Alternatively: Dim geod As Geodesic = new Geodesic() + ' Sample direct calculation, travelling about NE from JFK + Dim lat1 As Double = 40.6, lon1 = -73.8, s12 = 5500000.0, azi1 = 51 + Dim lat2, lon2 As Double + geod.Direct(lat1, lon1, azi1, s12, lat2, lon2) + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat2, lon2)) + ' Sample inverse calculation, JFK to LHR + lat1 = 40.6 : lon1 = -73.8 ' JFK Airport + lat2 = 51.6 : lon2 = -0.5 ' LHR Airport + geod.Inverse(lat1, lon1, lat2, lon2, s12) + Console.WriteLine(s12) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicExact.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicExact.vb new file mode 100644 index 000000000..ebf6b2f8d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicExact.vb @@ -0,0 +1,23 @@ +Imports NETGeographicLib + +Module example_GeodesicExact + Sub Main() + Try + Dim geod As GeodesicExact = New GeodesicExact(Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening) + ' Alternatively: Dim geod As GeodesicExact = new GeodesicExact() + ' Sample direct calculation, travelling about NE from JFK + Dim lat1 As Double = 40.6, lon1 = -73.8, s12 = 5500000.0, azi1 = 51 + Dim lat2, lon2 As Double + geod.Direct(lat1, lon1, azi1, s12, lat2, lon2) + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat2, lon2)) + ' Sample inverse calculation, JFK to LHR + lat1 = 40.6 : lon1 = -73.8 ' JFK Airport + lat2 = 51.6 : lon2 = -0.5 ' LHR Airport + geod.Inverse(lat1, lon1, lat2, lon2, s12) + Console.WriteLine(s12) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicLine.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicLine.vb new file mode 100644 index 000000000..7c1751670 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicLine.vb @@ -0,0 +1,34 @@ +Imports NETGeographicLib + +Module example_GeodesicLine + Sub Main() + Try + ' Print waypoints between JFK and SIN + Dim geod As Geodesic = New Geodesic() ' WGS84 + Dim lat1 As Double = 40.64, lon1 = -73.779 ' JFK + Dim lat2 As Double = 1.359, lon2 = 103.989 ' SIN + Dim s12, azi1, azi2 As Double + Dim a12 As Double = geod.Inverse(lat1, lon1, lat2, lon2, s12, azi1, azi2) + Dim line As GeodesicLine = New GeodesicLine(geod, lat1, lon1, azi1, Mask.ALL) + ' Alternatively Dim line As GeodesicLineExact = geod.Line(lat1, lon1, azi1, Mask.ALL) + Dim ds As Double = 500000.0 ' Nominal distance between points = 500 km + Dim num As Integer = CInt(Math.Ceiling(s12 / ds)) ' The number of intervals + ' Use intervals of equal length + ds = s12 / num + For i As Integer = 0 To num + Dim lat, lon As Double + line.Position(i * ds, lat, lon) + Console.WriteLine(String.Format("i: {0} Latitude: {1} Longitude: {2}", i, lat, lon)) + Next + ' Slightly faster, use intervals of equal arc length + Dim da As Double = a12 / num + For i As Integer = 0 To num + Dim lat, lon As Double + line.ArcPosition(i * da, lat, lon) + Console.WriteLine(String.Format("i: {0} Latitude: {1} Longitude: {2}", i, lat, lon)) + Next + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicLineExact.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicLineExact.vb new file mode 100644 index 000000000..629dca675 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GeodesicLineExact.vb @@ -0,0 +1,34 @@ +Imports NETGeographicLib + +Module example_GeodesicLineExact + Sub Main() + Try + ' Print waypoints between JFK and SIN + Dim geod As GeodesicExact = New GeodesicExact() ' WGS84 + Dim lat1 As Double = 40.64, lon1 = -73.779 ' JFK + Dim lat2 As Double = 1.359, lon2 = 103.989 ' SIN + Dim s12, azi1, azi2 As Double + Dim a12 As Double = geod.Inverse(lat1, lon1, lat2, lon2, s12, azi1, azi2) + Dim line As GeodesicLineExact = New GeodesicLineExact(geod, lat1, lon1, azi1, Mask.ALL) + ' Alternatively Dim line As GeodesicLineExact = geod.Line(lat1, lon1, azi1, Mask.ALL) + Dim ds As Double = 500000.0 ' Nominal distance between points = 500 km + Dim num As Integer = CInt(Math.Ceiling(s12 / ds)) ' The number of intervals + ' Use intervals of equal length + ds = s12 / num + For i As Integer = 0 To num + Dim lat, lon As Double + line.Position(i * ds, lat, lon) + Console.WriteLine(String.Format("i: {0} Latitude: {1} Longitude: {2}", i, lat, lon)) + Next + ' Slightly faster, use intervals of equal arc length + Dim da As Double = a12 / num + For i As Integer = 0 To num + Dim lat, lon As Double + line.ArcPosition(i * da, lat, lon) + Console.WriteLine(String.Format("i: {0} Latitude: {1} Longitude: {2}", i, lat, lon)) + Next + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geohash.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geohash.vb new file mode 100644 index 000000000..edb2d1576 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geohash.vb @@ -0,0 +1,25 @@ +Imports NETGeographicLib + +Module example_Geohash + Sub Main() + Try + ' Sample forward calculation + Dim lat As Double = 57.64911, lon = 10.40744 ' Jutland (the wikipedia example) + Dim ghash As String + Dim maxlen As Integer = Geohash.GeohashLength(0.00001) + For len As Integer = 0 To maxlen + Geohash.Forward(lat, lon, len, ghash) + Console.WriteLine(ghash) + Next + ' Sample reverse calculation + ghash = "u4pruydqqvj" + For i As Integer = 0 To ghash.Length - 1 + Dim len As Integer + Geohash.Reverse(ghash.Substring(0, i), lat, lon, len, True) + Console.WriteLine(String.Format("Length: {0} Latitude: {1} Longitude: {2}", len, lat, lon)) + Next + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geoid.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geoid.vb new file mode 100644 index 000000000..fd6045044 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Geoid.vb @@ -0,0 +1,17 @@ +Imports NETGeographicLib + +Module example_Geoid + Sub Main() + Try + Dim egm96 As Geoid = New Geoid("egm96-5", "", True, False) + ' Convert height above egm96 to height above the ellipsoid + Dim lat As Double = 42, lon = -75, height_above_geoid = 20 + Dim geoid_height As Double = egm96.Height(lat, lon) + Dim height_above_ellipsoid As Double = (height_above_geoid + + CDbl(Geoid.ConvertFlag.GEOIDTOELLIPSOID) * geoid_height) + Console.WriteLine(height_above_ellipsoid) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Gnomonic.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Gnomonic.vb new file mode 100644 index 000000000..91ea5aacc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-Gnomonic.vb @@ -0,0 +1,22 @@ +Imports NETGeographicLib + +Module example_Gnomonic + Sub Main() + Try + Dim geod As Geodesic = New Geodesic() ' WGS84 + Dim lat0 As Double = 48 + 50 / 60.0, lon0 = 2 + 20 / 60.0 ' Paris + Dim proj As Gnomonic = New Gnomonic(geod) + ' Sample forward calculation + Dim lat As Double = 50.9, lon = 1.8 ' Calais + Dim x, y As Double + proj.Forward(lat0, lon0, lat, lon, x, y) + Console.WriteLine(String.Format("X: {0} Y: {1}", x, y)) + ' Sample reverse calculation + x = -38000.0 : y = 230000.0 + proj.Reverse(lat0, lon0, x, y, lat, lon) + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GravityCircle.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GravityCircle.vb new file mode 100644 index 000000000..ed80b8c07 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GravityCircle.vb @@ -0,0 +1,29 @@ +Imports NETGeographicLib + +Module example_GravityCircle + Sub Main() + Try + Dim grav As GravityModel = New GravityModel("egm96", "") + Dim lat As Double = 27.99, lon0 = 86.93, h = 8820 ' Mt Everest + ' Slow method of evaluating the values at several points on a circle of + ' latitude. + For i As Integer = -5 To 5 + Dim lon As Double = lon0 + i * 0.2 + Dim gx, gy, gz As Double + grav.Gravity(lat, lon, h, gx, gy, gz) + Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, gx, gy, gz)) + Next + ' Fast method of evaluating the values at several points on a circle of + ' latitude using GravityCircle. + Dim circ As GravityCircle = grav.Circle(lat, h, GravityModel.Mask.ALL) + For i As Integer = -5 To 5 + Dim lon As Double = lon0 + i * 0.2 + Dim gx, gy, gz As Double + circ.Gravity(lon, gx, gy, gz) + Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, gx, gy, gz)) + Next + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GravityModel.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GravityModel.vb new file mode 100644 index 000000000..ce0aa5afc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-GravityModel.vb @@ -0,0 +1,15 @@ +Imports NETGeographicLib + +Module example_GravityModel + Sub Main() + Try + Dim grav As GravityModel = New GravityModel("egm96", "") + Dim lat As Double = 27.99, lon = 86.93, h = 8820 ' Mt Everest + Dim gx, gy, gz As Double + grav.Gravity(lat, lon, h, gx, gy, gz) + Console.WriteLine(String.Format("{0} {1} {2}", gx, gy, gz)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-LambertConformalConic.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-LambertConformalConic.vb new file mode 100644 index 000000000..7219736f9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-LambertConformalConic.vb @@ -0,0 +1,35 @@ +Imports NETGeographicLib + +Module example_LambertConformalConic + Sub Main() + Try + ' Define the Pennsylvania South state coordinate system EPSG:3364 + ' http://www.spatialreference.org/ref/epsg/3364/ + Dim lat1 As Double = 40 + 58 / 60.0, lat2 = 39 + 56 / 60.0 ' standard parallels + Dim k1 As Double = 1 ' scale + Dim lat0 As Double = 39 + 20 / 60.0, lon0 = -77 - 45 / 60.0 ' origin + Dim fe As Double = 600000, fn = 0 ' false easting and northing + ' Set up basic projection + Dim PASouth As LambertConformalConic = New LambertConformalConic(Constants.WGS84.MajorRadius, + Constants.WGS84.Flattening, + lat1, lat2, k1) + Dim x0, y0 As Double + ' Transform origin point + PASouth.Forward(lon0, lat0, lon0, x0, y0) + x0 -= fe : y0 -= fn + ' Sample conversion from geodetic to PASouth grid + Dim lat As Double = 39.95, lon = -75.17 ' Philadelphia + Dim x, y As Double + PASouth.Forward(lon0, lat, lon, x, y) + x -= x0 : y -= y0 + Console.WriteLine(String.Format("{0} {1}", x, y)) + ' Sample conversion from PASouth grid to geodetic + x = 820000.0 : y = 72000.0 + x += x0 : y += y0 + PASouth.Reverse(lon0, x, y, lat, lon) + Console.WriteLine(String.Format("{0} {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-LocalCartesian.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-LocalCartesian.vb new file mode 100644 index 000000000..c926789c4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-LocalCartesian.vb @@ -0,0 +1,22 @@ +Imports NETGeographicLib + +Module example_LocalCartesian + Sub Main() + Try + Dim earth As Geocentric = New Geocentric() + Dim lat0 As Double = 48 + 50 / 60.0, lon0 = 2 + 20 / 60.0 ' Paris + Dim proj As LocalCartesian = New LocalCartesian(lat0, lon0, 0, earth) + ' Sample forward calculation + Dim lat As Double = 50.9, lon = 1.8, h = 0 ' Calais + Dim x, y, z As Double + proj.Forward(lat, lon, h, x, y, z) + Console.WriteLine(String.Format("{0} {1} {2}", x, y, z)) + ' Sample reverse calculation + x = -38000.0 : y = 230000.0 : z = -4000.0 + proj.Reverse(x, y, z, lat, lon, h) + Console.WriteLine(String.Format("{0} {1} {2}", lat, lon, h)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MGRS.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MGRS.vb new file mode 100644 index 000000000..3edde0c5f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MGRS.vb @@ -0,0 +1,26 @@ +Imports NETGeographicLib + +Module example_MGRS + Sub Main() + Try + ' See also example-GeoCoords.cpp + ' Sample forward calculation + Dim lat As Double = 33.3, lon = 44.4 ' Baghdad + Dim zone As Integer + Dim northp As Boolean + Dim x, y As Double + UTMUPS.Forward(lat, lon, zone, northp, x, y, -1, True) + Dim mgrsStr As String + MGRS.Forward(zone, northp, x, y, lat, 5, mgrsStr) + Console.WriteLine(mgrsStr) + ' Sample reverse calculation + mgrsStr = "38SMB4488" + Dim prec As Integer + MGRS.Reverse(mgrsStr, zone, northp, x, y, prec, True) + UTMUPS.Reverse(zone, northp, x, y, lat, lon, True) + Console.WriteLine(String.Format("Latitude: {0} Longitude: {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MagneticCircle.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MagneticCircle.vb new file mode 100644 index 000000000..f1da61376 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MagneticCircle.vb @@ -0,0 +1,29 @@ +Imports NETGeographicLib + +Module example_MagneticCircle + Sub Main() + Try + Dim mag As MagneticModel = New MagneticModel("wmm2010", "") + Dim lat As Double = 27.99, lon0 = 86.93, h = 8820, t = 2012 ' Mt Everest + ' Slow method of evaluating the values at several points on a circle of + ' latitude. + For i As Integer = -5 To 5 + Dim lon As Double = lon0 + i * 0.2 + Dim Bx, By, Bz As Double + mag.Field(t, lat, lon, h, Bx, By, Bz) + Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, Bx, By, Bz)) + Next + ' Fast method of evaluating the values at several points on a circle of + ' latitude using MagneticCircle. + Dim circ As MagneticCircle = mag.Circle(t, lat, h) + For i As Integer = -5 To 5 + Dim lon As Double = lon0 + i * 0.2 + Dim Bx, By, Bz As Double + circ.Field(lon, Bx, By, Bz) + Console.WriteLine(String.Format("{0} {1} {2} {3}", lon, Bx, By, Bz)) + Next + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MagneticModel.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MagneticModel.vb new file mode 100644 index 000000000..942076419 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-MagneticModel.vb @@ -0,0 +1,17 @@ +Imports NETGeographicLib + +Module example_MagneticModel + Sub Main() + Try + Dim mag As MagneticModel = New MagneticModel("wmm2010", "") + Dim lat As Double = 27.99, lon = 86.93, h = 8820, t = 2012 ' Mt Everest + Dim Bx, By, Bz As Double + mag.Field(t, lat, lon, H, Bx, By, Bz) + Dim bigH, F, D, I As Double + MagneticModel.FieldComponents(Bx, By, Bz, bigH, F, D, I) + Console.WriteLine(String.Format("{0} {1} {2} {3}", bigH, F, D, I)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-NormalGravity.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-NormalGravity.vb new file mode 100644 index 000000000..c2fdf4b94 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-NormalGravity.vb @@ -0,0 +1,15 @@ +Imports NETGeographicLib + +Module example_NormalGravity + Sub Main() + Try + Dim grav As NormalGravity = New NormalGravity(NormalGravity.StandardModels.WGS84) + Dim lat As Double = 27.99, h = 8820 ' Mt Everest + Dim gammay, gammaz As Double + grav.Gravity(lat, h, gammay, gammaz) + Console.WriteLine(String.Format("{0} {1}", gammay, gammaz)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-OSGB.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-OSGB.vb new file mode 100644 index 000000000..58810f408 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-OSGB.vb @@ -0,0 +1,25 @@ +Imports NETGeographicLib + +Module example_OSGB + Sub Main() + Try + ' Sample forward calculation from + ' A guide to coordinate systems in Great Britain + Dim lat As Double = DMS.Decode(52, 39, 27.2531) + Dim lon As Double = DMS.Decode(1, 43, 4.5177) + Dim x, y As Double + OSGB.Forward(lat, lon, x, y) + Dim gridref As String = "" + OSGB.GridReference(x, y, 2, gridref) + Console.WriteLine(String.Format("{0} {1} {2}", x, y, gridref)) + ' Sample reverse calculation + gridref = "TG5113" + Dim prec As Integer + OSGB.GridReference(gridref, x, y, prec, True) + OSGB.Reverse(x, y, lat, lon) + Console.WriteLine(String.Format("{0} {1} {2}", prec, lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-PolarStereographic.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-PolarStereographic.vb new file mode 100644 index 000000000..65ad7cc37 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-PolarStereographic.vb @@ -0,0 +1,21 @@ +Imports NETGeographicLib + +Module example_PolarStereographic + Sub Main() + Try + Dim proj As PolarStereographic = New PolarStereographic() ' WGS84 + Dim northp As Boolean = True + ' Sample forward calculation + Dim lat As Double = 61.2, lon = -149.9 ' Anchorage + Dim x, y As Double + proj.Forward(northp, lat, lon, x, y) + Console.WriteLine(String.Format("{0} {1}", x, y)) + ' Sample reverse calculation + x = -1637000.0 : y = 2824000.0 + proj.Reverse(northp, x, y, lat, lon) + Console.WriteLine(String.Format("{0} {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-PolygonArea.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-PolygonArea.vb new file mode 100644 index 000000000..91131e237 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-PolygonArea.vb @@ -0,0 +1,19 @@ +Imports NETGeographicLib + +Module example_PolygonArea + Sub Main() + Try + Dim geod As Geodesic = New Geodesic() ' WGS84 + Dim poly As PolygonArea = New PolygonArea(geod, True) + poly.AddPoint(52, 0) ' London + poly.AddPoint(41, -74) ' New York + poly.AddPoint(-23, -43) ' Rio de Janeiro + poly.AddPoint(-26, 28) ' Johannesburg + Dim perimeter, area As Double + Dim n As UInteger = poly.Compute(False, True, perimeter, area) + Console.WriteLine(String.Format("{0} {1} {2}", n, perimeter, area)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic.vb new file mode 100644 index 000000000..9490544d2 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic.vb @@ -0,0 +1,19 @@ +Imports NETGeographicLib + +Module example_SphericalHarmonic + Sub Main() + Try + Dim N As Integer = 3 ' The maximum degree + Dim ca As Double() = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1} ' cosine coefficients + Dim sa As Double() = {6, 5, 4, 3, 2, 1} ' sine coefficients + Dim a As Double = 1 + Dim h As SphericalHarmonic = New SphericalHarmonic(ca, sa, N, a, SphericalHarmonic.Normalization.SCHMIDT) + Dim x As Double = 2, y = 3, z = 1 + Dim vx, vy, vz As Double + Dim v As Double = h.HarmonicSum(x, y, z, vx, vy, vz) + Console.WriteLine(String.Format("{0} {1} {2} {3}", v, vx, vy, vz)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic1.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic1.vb new file mode 100644 index 000000000..efe1211dc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic1.vb @@ -0,0 +1,21 @@ +Imports NETGeographicLib + +Module example_SphericalHarmonic1 + Sub Main() + Try + Dim N As Integer = 3, N1 = 2 ' The maximum degrees + Dim ca As Double() = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1} ' cosine coefficients + Dim sa As Double() = {6, 5, 4, 3, 2, 1} ' sine coefficients + Dim cb As Double() = {1, 2, 3, 4, 5, 6} + Dim sb As Double() = {3, 2, 1} + Dim a As Double = 1 + Dim h As SphericalHarmonic1 = New SphericalHarmonic1(ca, sa, N, cb, sb, N1, a, SphericalHarmonic1.Normalization.SCHMIDT) + Dim tau As Double = 0.1, x = 2, y = 3, z = 1 + Dim vx, vy, vz As Double + Dim v As Double = h.HarmonicSum(tau, x, y, z, vx, vy, vz) + Console.WriteLine(String.Format("{0} {1} {2} {3}", v, vx, vy, vz)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic2.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic2.vb new file mode 100644 index 000000000..274a59fc5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-SphericalHarmonic2.vb @@ -0,0 +1,26 @@ +Imports NETGeographicLib + +Module example_SphericalHarmonic2 + Sub Main() + Try + Dim N As Integer = 3, N1 = 2, N2 = 1 ' The maximum degrees + Dim ca As Double() = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1} ' cosine coefficients + Dim sa As Double() = {6, 5, 4, 3, 2, 1} ' sine coefficients + Dim cb As Double() = {1, 2, 3, 4, 5, 6} + Dim sb As Double() = {3, 2, 1} + Dim cc As Double() = {2, 1} + Dim S2 As Double() = {0} + Dim a As Double = 1 + Dim h As SphericalHarmonic2 = New SphericalHarmonic2( + ca, sa, N, N, N, cb, sb, N1, N1, N1, + cc, S2, N2, N2, 0, a, + SphericalHarmonic2.Normalization.SCHMIDT) + Dim tau1 As Double = 0.1, tau2 = 0.05, x = 2, y = 3, z = 1 + Dim vx, vy, vz As Double + Dim v As Double = h.HarmonicSum(tau1, tau2, x, y, z, vx, vy, vz) + Console.WriteLine(String.Format("{0} {1} {2} {3}", v, vx, vy, vz)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-TransverseMercator.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-TransverseMercator.vb new file mode 100644 index 000000000..c2a580ef8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-TransverseMercator.vb @@ -0,0 +1,21 @@ +Imports NETGeographicLib + +Module example_TransverseMercator + Sub Main() + Try + Dim proj As TransverseMercator = New TransverseMercator() ' WGS84 + Dim lon0 As Double = -75 ' Central meridian for UTM zone 18 + ' Sample forward calculation + Dim lat As Double = 40.3, lon = -74.7 ' Princeton, NJ + Dim x, y As Double + proj.Forward(lon0, lat, lon, x, y) + Console.WriteLine(String.Format("{0} {1}", x, y)) + ' Sample reverse calculation + x = 25000.0 : y = 4461000.0 + proj.Reverse(lon0, x, y, lat, lon) + Console.WriteLine(String.Format("{0} {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-TransverseMercatorExact.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-TransverseMercatorExact.vb new file mode 100644 index 000000000..064deddee --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-TransverseMercatorExact.vb @@ -0,0 +1,21 @@ +Imports NETGeographicLib + +Module example_TransverseMercatorExact + Sub Main() + Try + Dim proj As TransverseMercatorExact = New TransverseMercatorExact() ' WGS84 + Dim lon0 As Double = -75 ' Central meridian for UTM zone 18 + ' Sample forward calculation + Dim lat As Double = 40.3, lon = -74.7 ' Princeton, NJ + Dim x, y As Double + proj.Forward(lon0, lat, lon, x, y) + Console.WriteLine(String.Format("{0} {1}", x, y)) + ' Sample reverse calculation + x = 25000.0 : y = 4461000.0 + proj.Reverse(lon0, x, y, lat, lon) + Console.WriteLine(String.Format("{0} {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-UTMUPS.vb b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-UTMUPS.vb new file mode 100644 index 000000000..9e45a0fa8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/dotnet/examples/VB/example-UTMUPS.vb @@ -0,0 +1,25 @@ +Imports NETGeographicLib + +Module example_UTMUPS + Sub Main() + Try + ' See also example-GeoCoords.cpp + ' Sample forward calculation + Dim lat As Double = 33.3, lon = 44.4 ' Baghdad + Dim zone As Integer + Dim northp As Boolean + Dim x, y As Double + UTMUPS.Forward(lat, lon, zone, northp, x, y, -1, True) + Dim zonestr As String = UTMUPS.EncodeZone(zone, northp) + Console.WriteLine(String.Format("{0} {1} {2}", zonestr, x, y)) + ' Sample reverse calculation + zonestr = "38N" + UTMUPS.DecodeZone(zonestr, zone, northp) + x = 444000.0 : y = 3688000.0 + UTMUPS.Reverse(zone, northp, x, y, lat, lon, True) + Console.WriteLine(String.Format("{0} {1}", lat, lon)) + Catch ex As GeographicErr + Console.WriteLine(String.Format("Caught exception: {0}", ex.Message)) + End Try + End Sub +End Module diff --git a/gtsam/3rdparty/GeographicLib/examples/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/examples/CMakeLists.txt new file mode 100644 index 000000000..fe0034b04 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/CMakeLists.txt @@ -0,0 +1,53 @@ +# Compile a bunch of tiny example programs. These are built with the +# "exampleprograms" target. These are mainly for including as examples +# within the doxygen documentation; however, compiling them catches some +# obvious blunders. +file (GLOB EXAMPLE_SOURCES example-*.cpp) +set (EXAMPLES) +add_definitions (${PROJECT_DEFINITIONS}) + +foreach (EXAMPLE_SOURCE ${EXAMPLE_SOURCES}) + get_filename_component (EXAMPLE ${EXAMPLE_SOURCE} NAME_WE) + set (EXAMPLES ${EXAMPLES} ${EXAMPLE}) + add_executable (${EXAMPLE} EXCLUDE_FROM_ALL ${EXAMPLE_SOURCE}) + target_link_libraries (${EXAMPLE} ${PROJECT_LIBRARIES}) +endforeach () + +set (OTHER_EXAMPLES GeoidToGTX.cpp) + +foreach (EXAMPLE_SOURCE ${OTHER_EXAMPLES}) + get_filename_component (EXAMPLE ${EXAMPLE_SOURCE} NAME_WE) + set (EXAMPLES ${EXAMPLES} ${EXAMPLE}) + add_executable (${EXAMPLE} EXCLUDE_FROM_ALL ${EXAMPLE_SOURCE}) + target_link_libraries (${EXAMPLE} ${PROJECT_LIBRARIES}) +endforeach () + +find_package (OpenMP QUIET) + +if (OPENMP_FOUND) + set_target_properties (GeoidToGTX PROPERTIES + COMPILE_FLAGS ${OpenMP_CXX_FLAGS} COMPILE_DEFINITIONS HAVE_OPENMP=1) + if (NOT WIN32) + set_target_properties (GeoidToGTX PROPERTIES LINK_FLAGS ${OpenMP_CXX_FLAGS}) + endif () + message (STATUS "Example program GeoidToGTX will use OpenMP") +else () + message (STATUS "Example program GeoidToGTX will not use OpenMP") +endif () + +add_custom_target (exampleprograms DEPENDS ${EXAMPLES}) + +if (MSVC) + get_target_property (_LIBTYPE ${PROJECT_LIBRARIES} TYPE) + if (_LIBTYPE STREQUAL "SHARED_LIBRARY") + # Copy the shared library on Windows systems to this directory + # (examples) so that the tests can be run. + add_custom_command (TARGET exampleprograms POST_BUILD + COMMAND ${CMAKE_COMMAND} -E + copy $ ${CMAKE_CFG_INTDIR} + COMMENT "Copying shared library to examples directory") + endif () +endif () + +# Put all the examples into a folder in the IDE +set_property (TARGET exampleprograms ${EXAMPLES} PROPERTY FOLDER examples) diff --git a/gtsam/3rdparty/GeographicLib/examples/GeoidToGTX.cpp b/gtsam/3rdparty/GeographicLib/examples/GeoidToGTX.cpp new file mode 100644 index 000000000..b4b29deed --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/GeoidToGTX.cpp @@ -0,0 +1,103 @@ +// Write out a gtx file of geoid heights. For egm2008 at 1' resolution this +// takes about 40 mins on a 8-processor Intel 2.66 GHz machine using OpenMP +// (-DHAVE_OPENMP=1). +// +// For the format of gtx files, see +// http://vdatum.noaa.gov/dev/gtx_info.html#dev_gtx_binary +// +// data is binary big-endian: +// south latitude edge (degrees double) +// west longitude edge (degrees double) +// delta latitude (degrees double) +// delta longitude (degrees double) +// nlat = number of latitude rows (integer) +// nlong = number of longitude columns (integer) +// nlat * nlong geoid heights (meters float) + +#include +#include +#include +#include +#include + +#if HAVE_OPENMP +# include +#endif + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main(int argc, char* argv[]) { + // Hardwired for 3 args: + // 1 = the gravity model (e.g., egm2008) + // 2 = intervals per degree + // 3 = output GTX file + if (argc != 4) { + cerr << "Usage: " << argv[0] + << " gravity-model intervals-per-degree output.gtx\n"; + return 1; + } + try { + string model(argv[1]); + // Number of intervals per degree + int ndeg = Utility::num(string(argv[2])); + string filename(argv[3]); + GravityModel g(model); + int + nlat = 180 * ndeg + 1, + nlon = 360 * ndeg; + double + delta = 1 / double(ndeg), // Grid spacing + latorg = -90, + lonorg = -180; + // Write results as floats in binary mode + ofstream file(filename.c_str(), ios::binary); + + // Write header + { + double transform[] = {latorg, lonorg, delta, delta}; + unsigned sizes[] = {unsigned(nlat), unsigned(nlon)}; + Utility::writearray(file, transform, 4); + Utility::writearray(file, sizes, 2); + } + + // Compute and store results for nbatch latitudes at a time + const int nbatch = 64; + vector< vector > N(nbatch, vector(nlon)); + + for (int ilat0 = 0; ilat0 < nlat; ilat0 += nbatch) { // Loop over batches + int nlat0 = min(nlat, ilat0 + nbatch); + +#if HAVE_OPENMP +# pragma omp parallel for +#endif + for (int ilat = ilat0; ilat < nlat0; ++ilat) { // Loop over latitudes + double + lat = latorg + (ilat / ndeg) + delta * (ilat - ndeg * (ilat / ndeg)), + h = 0; + GravityCircle c(g.Circle(lat, h, GravityModel::GEOID_HEIGHT)); + for (int ilon = 0; ilon < nlon; ++ilon) { // Loop over longitudes + double lon = lonorg + + (ilon / ndeg) + delta * (ilon - ndeg * (ilon / ndeg)); + N[ilat - ilat0][ilon] = float(c.GeoidHeight(lon)); + } // longitude loop + } // latitude loop -- end of parallel section + + for (int ilat = ilat0; ilat < nlat0; ++ilat) // write out data + Utility::writearray(file, N[ilat - ilat0]); + } // batch loop + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + catch (...) { + cerr << "Caught unknown exception\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/Makefile.am b/gtsam/3rdparty/GeographicLib/examples/Makefile.am new file mode 100644 index 000000000..8e3205745 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/Makefile.am @@ -0,0 +1,49 @@ +# +# Makefile.am +# +# Copyright (C) 2011, Charles Karney + +EXAMPLE_FILES = \ + example-Accumulator.cpp \ + example-AlbersEqualArea.cpp \ + example-AzimuthalEquidistant.cpp \ + example-CassiniSoldner.cpp \ + example-CircularEngine.cpp \ + example-Constants.cpp \ + example-DMS.cpp \ + example-Ellipsoid.cpp \ + example-EllipticFunction.cpp \ + example-GeoCoords.cpp \ + example-Geocentric.cpp \ + example-Geodesic.cpp \ + example-Geodesic-small.cpp \ + example-GeodesicExact.cpp \ + example-GeodesicLine.cpp \ + example-GeodesicLineExact.cpp \ + example-GeographicErr.cpp \ + example-Geohash.cpp \ + example-Geoid.cpp \ + example-Gnomonic.cpp \ + example-GravityCircle.cpp \ + example-GravityModel.cpp \ + example-LambertConformalConic.cpp \ + example-LocalCartesian.cpp \ + example-MGRS.cpp \ + example-MagneticCircle.cpp \ + example-MagneticModel.cpp \ + example-Math.cpp \ + example-NormalGravity.cpp \ + example-OSGB.cpp \ + example-PolarStereographic.cpp \ + example-PolygonArea.cpp \ + example-SphericalEngine.cpp \ + example-SphericalHarmonic.cpp \ + example-SphericalHarmonic1.cpp \ + example-SphericalHarmonic2.cpp \ + example-TransverseMercator.cpp \ + example-TransverseMercatorExact.cpp \ + example-UTMUPS.cpp \ + example-Utility.cpp \ + GeoidToGTX.cpp + +EXTRA_DIST = CMakeLists.txt $(EXAMPLE_FILES) diff --git a/gtsam/3rdparty/GeographicLib/examples/Makefile.in b/gtsam/3rdparty/GeographicLib/examples/Makefile.in new file mode 100644 index 000000000..8e86fd70e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/Makefile.in @@ -0,0 +1,451 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile.am +# +# Copyright (C) 2011, Charles Karney +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = examples +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/GeographicLib/Config-ac.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COL = @COL@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GEOGRAPHICLIB_VERSION_MAJOR = @GEOGRAPHICLIB_VERSION_MAJOR@ +GEOGRAPHICLIB_VERSION_MINOR = @GEOGRAPHICLIB_VERSION_MINOR@ +GEOGRAPHICLIB_VERSION_PATCH = @GEOGRAPHICLIB_VERSION_PATCH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POD2HTML = @POD2HTML@ +POD2MAN = @POD2MAN@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXAMPLE_FILES = \ + example-Accumulator.cpp \ + example-AlbersEqualArea.cpp \ + example-AzimuthalEquidistant.cpp \ + example-CassiniSoldner.cpp \ + example-CircularEngine.cpp \ + example-Constants.cpp \ + example-DMS.cpp \ + example-Ellipsoid.cpp \ + example-EllipticFunction.cpp \ + example-GeoCoords.cpp \ + example-Geocentric.cpp \ + example-Geodesic.cpp \ + example-Geodesic-small.cpp \ + example-GeodesicExact.cpp \ + example-GeodesicLine.cpp \ + example-GeodesicLineExact.cpp \ + example-GeographicErr.cpp \ + example-Geohash.cpp \ + example-Geoid.cpp \ + example-Gnomonic.cpp \ + example-GravityCircle.cpp \ + example-GravityModel.cpp \ + example-LambertConformalConic.cpp \ + example-LocalCartesian.cpp \ + example-MGRS.cpp \ + example-MagneticCircle.cpp \ + example-MagneticModel.cpp \ + example-Math.cpp \ + example-NormalGravity.cpp \ + example-OSGB.cpp \ + example-PolarStereographic.cpp \ + example-PolygonArea.cpp \ + example-SphericalEngine.cpp \ + example-SphericalHarmonic.cpp \ + example-SphericalHarmonic1.cpp \ + example-SphericalHarmonic2.cpp \ + example-TransverseMercator.cpp \ + example-TransverseMercatorExact.cpp \ + example-UTMUPS.cpp \ + example-Utility.cpp \ + GeoidToGTX.cpp + +EXTRA_DIST = CMakeLists.txt $(EXAMPLE_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +cscope cscopelist: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Accumulator.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Accumulator.cpp new file mode 100644 index 000000000..d301e1900 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Accumulator.cpp @@ -0,0 +1,25 @@ +// Example of using the GeographicLib::Accumulator class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + // Compare using Accumulator and ordinary summation for a sum of large and + // small terms. + double sum = 0; + Accumulator acc = 0; + sum += 1e20; sum += 1; sum += 2; sum += 100; sum += 5000; sum += -1e20; + acc += 1e20; acc += 1; acc += 2; acc += 100; acc += 5000; acc += -1e20; + cout << sum << " " << acc() << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-AlbersEqualArea.cpp b/gtsam/3rdparty/GeographicLib/examples/example-AlbersEqualArea.cpp new file mode 100644 index 000000000..f56dc73c0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-AlbersEqualArea.cpp @@ -0,0 +1,40 @@ +// Example of using the GeographicLib::AlbersEqualArea class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + const double + a = Constants::WGS84_a(), + f = Constants::WGS84_f(), + lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels + k1 = 1, // scale + lon0 = -77 - 45/60.0; // Central meridan + // Set up basic projection + const AlbersEqualArea albers(a, f, lat1, lat2, k1); + { + // Sample conversion from geodetic to Albers Equal Area + double lat = 39.95, lon = -75.17; // Philadelphia + double x, y; + albers.Forward(lon0, lat, lon, x, y); + std::cout << x << " " << y << "\n"; + } + { + // Sample conversion from Albers Equal Area grid to geodetic + double x = 220e3, y = -53e3; + double lat, lon; + albers.Reverse(lon0, x, y, lat, lon); + std::cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-AzimuthalEquidistant.cpp b/gtsam/3rdparty/GeographicLib/examples/example-AzimuthalEquidistant.cpp new file mode 100644 index 000000000..8af2d009b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-AzimuthalEquidistant.cpp @@ -0,0 +1,37 @@ +// Example of using the GeographicLib::AzimuthalEquidistant class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Geodesic& geod = Geodesic::WGS84; + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + AzimuthalEquidistant proj(geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj.Forward(lat0, lon0, lat, lon, x, y); + cout << x << " " << y << "\n"; + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj.Reverse(lat0, lon0, x, y, lat, lon); + cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-CassiniSoldner.cpp b/gtsam/3rdparty/GeographicLib/examples/example-CassiniSoldner.cpp new file mode 100644 index 000000000..173a717f0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-CassiniSoldner.cpp @@ -0,0 +1,37 @@ +// Example of using the GeographicLib::CassiniSoldner class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Geodesic& geod = Geodesic::WGS84; + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + CassiniSoldner proj(lat0, lon0, geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj.Forward(lat, lon, x, y); + cout << x << " " << y << "\n"; + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj.Reverse(x, y, lat, lon); + cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-CircularEngine.cpp b/gtsam/3rdparty/GeographicLib/examples/example-CircularEngine.cpp new file mode 100644 index 000000000..10ac74c6b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-CircularEngine.cpp @@ -0,0 +1,35 @@ +// Example of using the GeographicLib::CircularEngine class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + // This computes the same value as example-SphericalHarmonic.cpp using a + // CircularEngine (which will be faster if many values on a circle of + // latitude are to be found). + try { + int N = 3; // The maxium degree + double ca[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + vector C(ca, ca + (N + 1) * (N + 2) / 2); + double sa[] = {6, 5, 4, 3, 2, 1}; // sine coefficients + vector S(sa, sa + N * (N + 1) / 2); + double a = 1; + SphericalHarmonic h(C, S, N, a); + double x = 2, y = 3, z = 1, p = Math::hypot(x, y); + CircularEngine circ = h.Circle(p, z, true); + double v, vx, vy, vz; + v = circ(x/p, y/p, vx, vy, vz); + cout << v << " " << vx << " " << vy << " " << vz << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Constants.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Constants.cpp new file mode 100644 index 000000000..8123d8d89 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Constants.cpp @@ -0,0 +1,21 @@ +// Example of using the GeographicLib::Constants class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + cout << "WGS84 parameters:\n" + << "a = " << Constants::WGS84_a() << " m\n" + << "f = 1/" << 1/Constants::WGS84_f() << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-DMS.cpp b/gtsam/3rdparty/GeographicLib/examples/example-DMS.cpp new file mode 100644 index 000000000..dc4006c99 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-DMS.cpp @@ -0,0 +1,29 @@ +// Example of using the GeographicLib::DMS class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + { + string dms = "30d14'45.6\"S"; + DMS::flag type; + double ang = DMS::Decode(dms, type); + cout << type << " " << ang << "\n"; + } + { + double ang = -30.245715; + string dms = DMS::Encode(ang, 6, DMS::LATITUDE); + cout << dms << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Ellipsoid.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Ellipsoid.cpp new file mode 100644 index 000000000..3e00a7562 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Ellipsoid.cpp @@ -0,0 +1,26 @@ +// Example of using the GeographicLib::Ellipsoid class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Ellipsoid wgs84(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Ellipsoid& wgs84 = Ellipsoid::WGS84; + cout << "The latitude half way between the equator and the pole is " + << wgs84.InverseRectifyingLatitude(45) << "\n"; + cout << "Half the area of the ellipsoid lies between latitudes +/- " + << wgs84.InverseAuthalicLatitude(30) << "\n"; + cout << "The northernmost edge of a square Mercator map is at latitude " + << wgs84.InverseIsometricLatitude(180) << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-EllipticFunction.cpp b/gtsam/3rdparty/GeographicLib/examples/example-EllipticFunction.cpp new file mode 100644 index 000000000..c2ae4a338 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-EllipticFunction.cpp @@ -0,0 +1,42 @@ +// Example of using the GeographicLib::EllipticFunction class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + EllipticFunction ell(0.1); // parameter m = 0.1 + // See Abramowitz and Stegun, table 17.1 + cout << ell.K() << " " << ell.E() << "\n"; + double phi = 20 * Math::degree(); + // See Abramowitz and Stegun, table 17.6 with + // alpha = asin(sqrt(m)) = 18.43 deg and phi = 20 deg + cout << ell.E(phi) << " " + << ell.E(sin(phi), cos(phi), sqrt(1 - ell.k2() * Math::sq(sin(phi)))) + << "\n"; + // See Carlson 1995, Sec 3. + cout << fixed << setprecision(16) + << "RF(1,2,0) = " << EllipticFunction::RF(1,2) << "\n" + << "RF(2,3,4) = " << EllipticFunction::RF(2,3,4) << "\n" + << "RC(0,1/4) = " << EllipticFunction::RC(0,0.25) << "\n" + << "RC(9/4,2) = " << EllipticFunction::RC(2.25,2) << "\n" + << "RC(1/4,-2) = " << EllipticFunction::RC(0.25,-2) << "\n" + << "RJ(0,1,2,3) = " << EllipticFunction::RJ(0,1,2,3) << "\n" + << "RJ(2,3,4,5) = " << EllipticFunction::RJ(2,3,4,5) << "\n" + << "RD(0,2,1) = " << EllipticFunction::RD(0,2,1) << "\n" + << "RD(2,3,4) = " << EllipticFunction::RD(2,3,4) << "\n" + << "RG(0,16,16) = " << EllipticFunction::RG(16,16) << "\n" + << "RG(2,3,4) = " << EllipticFunction::RG(2,3,4) << "\n" + << "RG(0,0.0796,4) = " << EllipticFunction::RG(0.0796,4) << "\n"; + } + catch (const GeographicErr& e) { + cout << "Caught exception: " << e.what() << "\n"; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-GeoCoords.cpp b/gtsam/3rdparty/GeographicLib/examples/example-GeoCoords.cpp new file mode 100644 index 000000000..1756f4fd1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-GeoCoords.cpp @@ -0,0 +1,28 @@ +// Example of using the GeographicLib::GeoCoords class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + // Miscellaneous conversions + double lat = 33.3, lon = 44.4; + GeoCoords c(lat, lon); + cout << c.MGRSRepresentation(-3) << "\n"; + c.Reset("18TWN0050"); + cout << c.DMSRepresentation() << "\n"; + cout << c.Latitude() << " " << c.Longitude() << "\n"; + c.Reset("1d38'W 55d30'N"); + cout << c.GeoRepresentation() << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Geocentric.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Geocentric.cpp new file mode 100644 index 000000000..4f069f28b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Geocentric.cpp @@ -0,0 +1,37 @@ +// Example of using the GeographicLib::Geocentric class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Geocentric earth(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Geocentric& earth = Geocentric::WGS84; + { + // Sample forward calculation + double lat = 27.99, lon = 86.93, h = 8820; // Mt Everest + double X, Y, Z; + earth.Forward(lat, lon, h, X, Y, Z); + cout << floor(X / 1000 + 0.5) << " " + << floor(Y / 1000 + 0.5) << " " + << floor(Z / 1000 + 0.5) << "\n"; + } + { + // Sample reverse calculation + double X = 302e3, Y = 5636e3, Z = 2980e3; + double lat, lon, h; + earth.Reverse(X, Y, Z, lat, lon, h); + cout << lat << " " << lon << " " << h << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Geodesic-small.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Geodesic-small.cpp new file mode 100644 index 000000000..07cf13598 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Geodesic-small.cpp @@ -0,0 +1,19 @@ +// Small example of using the GeographicLib::Geodesic class + +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + const Geodesic& geod = Geodesic::WGS84; + // Distance from JFK to LHR + double + lat1 = 40.6, lon1 = -73.8, // JFK Airport + lat2 = 51.6, lon2 = -0.5; // LHR Airport + double s12; + geod.Inverse(lat1, lon1, lat2, lon2, s12); + cout << s12 / 1000 << " km\n"; + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Geodesic.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Geodesic.cpp new file mode 100644 index 000000000..d6258d9f9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Geodesic.cpp @@ -0,0 +1,37 @@ +// Example of using the GeographicLib::Geodesic class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Geodesic& geod = Geodesic::WGS84; + { + // Sample direct calculation, travelling about NE from JFK + double lat1 = 40.6, lon1 = -73.8, s12 = 5.5e6, azi1 = 51; + double lat2, lon2; + geod.Direct(lat1, lon1, azi1, s12, lat2, lon2); + cout << lat2 << " " << lon2 << "\n"; + } + { + // Sample inverse calculation, JFK to LHR + double + lat1 = 40.6, lon1 = -73.8, // JFK Airport + lat2 = 51.6, lon2 = -0.5; // LHR Airport + double s12; + geod.Inverse(lat1, lon1, lat2, lon2, s12); + cout << s12 << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-GeodesicExact.cpp b/gtsam/3rdparty/GeographicLib/examples/example-GeodesicExact.cpp new file mode 100644 index 000000000..0745b222e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-GeodesicExact.cpp @@ -0,0 +1,37 @@ +// Example of using the GeographicLib::GeodesicExact class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + GeodesicExact geod(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const GeodesicExact& geod = GeodesicExact::WGS84; + { + // Sample direct calculation, travelling about NE from JFK + double lat1 = 40.6, lon1 = -73.8, s12 = 5.5e6, azi1 = 51; + double lat2, lon2; + geod.Direct(lat1, lon1, azi1, s12, lat2, lon2); + cout << lat2 << " " << lon2 << "\n"; + } + { + // Sample inverse calculation, JFK to LHR + double + lat1 = 40.6, lon1 = -73.8, // JFK Airport + lat2 = 51.6, lon2 = -0.5; // LHR Airport + double s12; + geod.Inverse(lat1, lon1, lat2, lon2, s12); + cout << s12 << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-GeodesicLine.cpp b/gtsam/3rdparty/GeographicLib/examples/example-GeodesicLine.cpp new file mode 100644 index 000000000..ffe4c3735 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-GeodesicLine.cpp @@ -0,0 +1,54 @@ +// Example of using the GeographicLib::GeodesicLine class + +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + // Print waypoints between JFK and SIN + Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Geodesic& geod = Geodesic::WGS84; + double + lat1 = 40.640, lon1 = -73.779, // JFK + lat2 = 1.359, lon2 = 103.989; // SIN + double s12, azi1, azi2, + a12 = geod.Inverse(lat1, lon1, lat2, lon2, s12, azi1, azi2); + const GeographicLib::GeodesicLine line(geod, lat1, lon1, azi1); + // Alternatively + // const GeographicLib::GeodesicLine line = geod.Line(lat1, lon1, azi1); + double ds = 500e3; // Nominal distance between points = 500 km + int num = int(ceil(s12 / ds)); // The number of intervals + cout << fixed << setprecision(3); + { + // Use intervals of equal length + double ds = s12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line.Position(i * ds, lat, lon); + cout << i << " " << lat << " " << lon << "\n"; + } + } + { + // Slightly faster, use intervals of equal arc length + double da = a12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line.ArcPosition(i * da, lat, lon); + cout << i << " " << lat << " " << lon << "\n"; + } + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-GeodesicLineExact.cpp b/gtsam/3rdparty/GeographicLib/examples/example-GeodesicLineExact.cpp new file mode 100644 index 000000000..20473667d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-GeodesicLineExact.cpp @@ -0,0 +1,54 @@ +// Example of using the GeographicLib::GeodesicLineExact class + +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + // Print waypoints between JFK and SIN + GeodesicExact geod(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const GeodesicExact& geod = GeodesicExact::WGS84; + double + lat1 = 40.640, lon1 = -73.779, // JFK + lat2 = 1.359, lon2 = 103.989; // SIN + double s12, azi1, azi2, + a12 = geod.Inverse(lat1, lon1, lat2, lon2, s12, azi1, azi2); + const GeographicLib::GeodesicLineExact line(geod, lat1, lon1, azi1); + // Alternatively + // const GeographicLib::GeodesicLineExact line = geod.Line(lat1, lon1, azi1); + double ds = 500e3; // Nominal distance between points = 500 km + int num = int(ceil(s12 / ds)); // The number of intervals + cout << fixed << setprecision(3); + { + // Use intervals of equal length + double ds = s12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line.Position(i * ds, lat, lon); + cout << i << " " << lat << " " << lon << "\n"; + } + } + { + // Slightly faster, use intervals of equal arc length + double da = a12 / num; + for (int i = 0; i <= num; ++i) { + double lat, lon; + line.ArcPosition(i * da, lat, lon); + cout << i << " " << lat << " " << lon << "\n"; + } + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-GeographicErr.cpp b/gtsam/3rdparty/GeographicLib/examples/example-GeographicErr.cpp new file mode 100644 index 000000000..7bf4acfb5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-GeographicErr.cpp @@ -0,0 +1,17 @@ +// Example of using the GeographicLib::GeographicErr class + +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + throw GeographicErr("Test throwing an exception"); + } + catch (const GeographicErr& e) { + cout << "Caught exception: " << e.what() << "\n"; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Geohash.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Geohash.cpp new file mode 100644 index 000000000..3f3fad019 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Geohash.cpp @@ -0,0 +1,42 @@ +// Example of using the GeographicLib::Geohash class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + { + // Sample forward calculation + double lat = 57.64911, lon = 10.40744; // Jutland (the wikipedia example) + string geohash; + int maxlen = Geohash::GeohashLength(1.0e-5); + for (int len = 0; len <= maxlen; ++len) { + Geohash::Forward(lat, lon, len, geohash); + cout << len << " " << geohash << "\n"; + } + } + { + // Sample reverse calculation + string geohash = "u4pruydqqvj"; + double lat, lon; + cout << fixed; + for (unsigned i = 0; i <= geohash.length(); ++i) { + int len; + Geohash::Reverse(geohash.substr(0, i), lat, lon, len); + cout << setprecision(max(0, Geohash::DecimalPrecision(len))) + << len << " " << lat << " " << lon << "\n"; + } + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Geoid.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Geoid.cpp new file mode 100644 index 000000000..df6e134b8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Geoid.cpp @@ -0,0 +1,26 @@ +// Example of using the GeographicLib::Geoid class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Geoid egm96("egm96-5"); + // Convert height above egm96 to height above the ellipsoid + double lat = 42, lon = -75, height_above_geoid = 20; + double + geoid_height = egm96(lat, lon), + height_above_ellipsoid = (height_above_geoid + + Geoid::GEOIDTOELLIPSOID * geoid_height); + cout << height_above_ellipsoid << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Gnomonic.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Gnomonic.cpp new file mode 100644 index 000000000..a78a8605c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Gnomonic.cpp @@ -0,0 +1,37 @@ +// Example of using the GeographicLib::Gnomonic class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Geodesic& geod = Geodesic::WGS84; + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + Gnomonic proj(geod); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8; // Calais + double x, y; + proj.Forward(lat0, lon0, lat, lon, x, y); + cout << x << " " << y << "\n"; + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3; + double lat, lon; + proj.Reverse(lat0, lon0, x, y, lat, lon); + cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-GravityCircle.cpp b/gtsam/3rdparty/GeographicLib/examples/example-GravityCircle.cpp new file mode 100644 index 000000000..55dd5ee87 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-GravityCircle.cpp @@ -0,0 +1,42 @@ +// Example of using the GeographicLib::GravityCircle class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + GravityModel grav("egm96"); + double lat = 27.99, lon0 = 86.93, h = 8820; // Mt Everest + { + // Slow method of evaluating the values at several points on a circle of + // latitude. + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double gx, gy, gz; + grav.Gravity(lat, lon, h, gx, gy, gz); + cout << lon << " " << gx << " " << gy << " " << gz << "\n"; + } + } + { + // Fast method of evaluating the values at several points on a circle of + // latitude using GravityCircle. + GravityCircle circ = grav.Circle(lat, h); + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double gx, gy, gz; + circ.Gravity(lon, gx, gy, gz); + cout << lon << " " << gx << " " << gy << " " << gz << "\n"; + } + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-GravityModel.cpp b/gtsam/3rdparty/GeographicLib/examples/example-GravityModel.cpp new file mode 100644 index 000000000..f0e634cd6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-GravityModel.cpp @@ -0,0 +1,23 @@ +// Example of using the GeographicLib::GravityModel class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + GravityModel grav("egm96"); + double lat = 27.99, lon = 86.93, h = 8820; // Mt Everest + double gx, gy, gz; + grav.Gravity(lat,lon, h, gx, gy, gz); + cout << gx << " " << gy << " " << gz << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-LambertConformalConic.cpp b/gtsam/3rdparty/GeographicLib/examples/example-LambertConformalConic.cpp new file mode 100644 index 000000000..b57308eeb --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-LambertConformalConic.cpp @@ -0,0 +1,49 @@ +// Example of using the GeographicLib::LambertConformalConic class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + // Define the Pennsylvania South state coordinate system EPSG:3364 + // http://www.spatialreference.org/ref/epsg/3364/ + const double + a = Constants::WGS84_a(), + f = 1/298.257222101, // GRS80 + lat1 = 40 + 58/60.0, lat2 = 39 + 56/60.0, // standard parallels + k1 = 1, // scale + lat0 = 39 + 20/60.0, lon0 =-77 - 45/60.0, // origin + fe = 600000, fn = 0; // false easting and northing + // Set up basic projection + const LambertConformalConic PASouth(a, f, lat1, lat2, k1); + double x0, y0; + // Transform origin point + PASouth.Forward(lon0, lat0, lon0, x0, y0); + x0 -= fe; y0 -= fn; + { + // Sample conversion from geodetic to PASouth grid + double lat = 39.95, lon = -75.17; // Philadelphia + double x, y; + PASouth.Forward(lon0, lat, lon, x, y); + x -= x0; y -= y0; + std::cout << x << " " << y << "\n"; + } + { + // Sample conversion from PASouth grid to geodetic + double x = 820e3, y = 72e3; + double lat, lon; + x += x0; y += y0; + PASouth.Reverse(lon0, x, y, lat, lon); + std::cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-LocalCartesian.cpp b/gtsam/3rdparty/GeographicLib/examples/example-LocalCartesian.cpp new file mode 100644 index 000000000..ce090729b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-LocalCartesian.cpp @@ -0,0 +1,38 @@ +// Example of using the GeographicLib::LocalCartesian class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Geocentric earth(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Geocentric& earth = Geocentric::WGS84; + const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris + LocalCartesian proj(lat0, lon0, 0, earth); + { + // Sample forward calculation + double lat = 50.9, lon = 1.8, h = 0; // Calais + double x, y, z; + proj.Forward(lat, lon, h, x, y, z); + cout << x << " " << y << " " << z << "\n"; + } + { + // Sample reverse calculation + double x = -38e3, y = 230e3, z = -4e3; + double lat, lon, h; + proj.Reverse(x, y, z, lat, lon, h); + cout << lat << " " << lon << " " << h << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-MGRS.cpp b/gtsam/3rdparty/GeographicLib/examples/example-MGRS.cpp new file mode 100644 index 000000000..1fe2f6524 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-MGRS.cpp @@ -0,0 +1,43 @@ +// Example of using the GeographicLib::MGRS class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + // See also example-GeoCoords.cpp + { + // Sample forward calculation + double lat = 33.3, lon = 44.4; // Baghdad + int zone; + bool northp; + double x, y; + UTMUPS::Forward(lat, lon, zone, northp, x, y); + string mgrs; + MGRS::Forward(zone, northp, x, y, lat, 5, mgrs); + cout << mgrs << "\n"; + } + { + // Sample reverse calculation + string mgrs = "38SMB4488"; + int zone, prec; + bool northp; + double x, y; + MGRS::Reverse(mgrs, zone, northp, x, y, prec); + double lat, lon; + UTMUPS::Reverse(zone, northp, x, y, lat, lon); + cout << prec << " " << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-MagneticCircle.cpp b/gtsam/3rdparty/GeographicLib/examples/example-MagneticCircle.cpp new file mode 100644 index 000000000..8dfcbbcfd --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-MagneticCircle.cpp @@ -0,0 +1,42 @@ +// Example of using the GeographicLib::MagneticCircle class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + MagneticModel mag("wmm2010"); + double lat = 27.99, lon0 = 86.93, h = 8820, t = 2012; // Mt Everest + { + // Slow method of evaluating the values at several points on a circle of + // latitude. + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double Bx, By, Bz; + mag(t, lat, lon, h, Bx, By, Bz); + cout << lon << " " << Bx << " " << By << " " << Bz << "\n"; + } + } + { + // Fast method of evaluating the values at several points on a circle of + // latitude using MagneticCircle. + MagneticCircle circ = mag.Circle(t, lat, h); + for (int i = -5; i <= 5; ++i) { + double lon = lon0 + i * 0.2; + double Bx, By, Bz; + circ(lon, Bx, By, Bz); + cout << lon << " " << Bx << " " << By << " " << Bz << "\n"; + } + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-MagneticModel.cpp b/gtsam/3rdparty/GeographicLib/examples/example-MagneticModel.cpp new file mode 100644 index 000000000..8453ad529 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-MagneticModel.cpp @@ -0,0 +1,25 @@ +// Example of using the GeographicLib::MagneticModel class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + MagneticModel mag("wmm2010"); + double lat = 27.99, lon = 86.93, h = 8820, t = 2012; // Mt Everest + double Bx, By, Bz; + mag(t, lat,lon, h, Bx, By, Bz); + double H, F, D, I; + MagneticModel::FieldComponents(Bx, By, Bz, H, F, D, I); + cout << H << " " << F << " " << D << " " << I << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Math.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Math.cpp new file mode 100644 index 000000000..31b1dbf99 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Math.cpp @@ -0,0 +1,19 @@ +// Example of using the GeographicLib::Math class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + cout << Math::pi() << " " << Math::sq(Math::pi()) << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-NormalGravity.cpp b/gtsam/3rdparty/GeographicLib/examples/example-NormalGravity.cpp new file mode 100644 index 000000000..461c1652c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-NormalGravity.cpp @@ -0,0 +1,27 @@ +// Example of using the GeographicLib::NormalGravity class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + NormalGravity grav(Constants::WGS84_a(), Constants::WGS84_GM(), + Constants::WGS84_omega(), + Constants::WGS84_f(), 0); + // Alternatively: const NormalGravity& grav = NormalGravity::WGS84; + double lat = 27.99, h = 8820; // Mt Everest + double gammay, gammaz; + grav.Gravity(lat, h, gammay, gammaz); + cout << gammay << " " << gammaz << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-OSGB.cpp b/gtsam/3rdparty/GeographicLib/examples/example-OSGB.cpp new file mode 100644 index 000000000..801dcea61 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-OSGB.cpp @@ -0,0 +1,45 @@ +// Example of using the GeographicLib::OSGB class + +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + { + // Sample forward calculation from + // A guide to coordinate systems in Great Britain + double + lat = DMS::Decode(52,39,27.2531), + lon = DMS::Decode( 1,43, 4.5177); + double x, y; + OSGB::Forward(lat, lon, x, y); + string gridref; + OSGB::GridReference(x, y, 2, gridref); + cout << fixed << setprecision(3) + << x << " " << y << " " << gridref << "\n"; + } + { + // Sample reverse calculation + string gridref = "TG5113"; + double x, y; + int prec; + OSGB::GridReference(gridref, x, y, prec); + double lat, lon; + OSGB::Reverse(x, y, lat, lon); + cout << fixed << setprecision(8) + << prec << " " << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-PolarStereographic.cpp b/gtsam/3rdparty/GeographicLib/examples/example-PolarStereographic.cpp new file mode 100644 index 000000000..0bf5c633a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-PolarStereographic.cpp @@ -0,0 +1,39 @@ +// Example of using the GeographicLib::PolarStereographic class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + PolarStereographic proj(Constants::WGS84_a(), Constants::WGS84_f(), + Constants::UPS_k0()); + // Alternatively: + // const PolarStereographic& proj = PolarStereographic::UPS; + bool northp = true; + { + // Sample forward calculation + double lat = 61.2, lon = -149.9; // Anchorage + double x, y; + proj.Forward(northp, lat, lon, x, y); + cout << x << " " << y << "\n"; + } + { + // Sample reverse calculation + double x = -1637e3, y = 2824e3; + double lat, lon; + proj.Reverse(northp, x, y, lat, lon); + cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-PolygonArea.cpp b/gtsam/3rdparty/GeographicLib/examples/example-PolygonArea.cpp new file mode 100644 index 000000000..f2610ce55 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-PolygonArea.cpp @@ -0,0 +1,30 @@ +// Example of using the GeographicLib::PolygonArea class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + Geodesic geod(Constants::WGS84_a(), Constants::WGS84_f()); + // Alternatively: const Geodesic& geod = Geodesic::WGS84; + PolygonArea poly(geod); + poly.AddPoint( 52, 0); // London + poly.AddPoint( 41,-74); // New York + poly.AddPoint(-23,-43); // Rio de Janeiro + poly.AddPoint(-26, 28); // Johannesburg + double perimeter, area; + unsigned n = poly.Compute(false, true, perimeter, area); + cout << n << " " << perimeter << " " << area << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-SphericalEngine.cpp b/gtsam/3rdparty/GeographicLib/examples/example-SphericalEngine.cpp new file mode 100644 index 000000000..29fd7a3cd --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-SphericalEngine.cpp @@ -0,0 +1,33 @@ +// Example of using the GeographicLib::SphericalEngine class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + // See also example-SphericHarmonic.cpp + try { + int N = 3; // The maxium degree + double ca[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + vector C(ca, ca + (N + 1) * (N + 2) / 2); + double sa[] = {6, 5, 4, 3, 2, 1}; // sine coefficients + vector S(sa, sa + N * (N + 1) / 2); + SphericalEngine::coeff c[1]; + c[0] = SphericalEngine::coeff(C, S, N); + double f[] = {1}; + double x = 2, y = 3, z = 1, a = 1; + double v, vx, vy, vz; + v = SphericalEngine::Value + (c, f, x, y, z, a, vx, vy, vz); + cout << v << " " << vx << " " << vy << " " << vz << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic.cpp b/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic.cpp new file mode 100644 index 000000000..213b2a772 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic.cpp @@ -0,0 +1,30 @@ +// Example of using the GeographicLib::SphericalHarmonic class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + int N = 3; // The maxium degree + double ca[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + vector C(ca, ca + (N + 1) * (N + 2) / 2); + double sa[] = {6, 5, 4, 3, 2, 1}; // sine coefficients + vector S(sa, sa + N * (N + 1) / 2); + double a = 1; + SphericalHarmonic h(C, S, N, a); + double x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h(x, y, z, vx, vy, vz); + cout << v << " " << vx << " " << vy << " " << vz << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic1.cpp b/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic1.cpp new file mode 100644 index 000000000..fa3d9b809 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic1.cpp @@ -0,0 +1,34 @@ +// Example of using the GeographicLib::SphericalHarmonic1 class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + int N = 3, N1 = 2; // The maxium degrees + double ca[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + vector C(ca, ca + (N + 1) * (N + 2) / 2); + double sa[] = {6, 5, 4, 3, 2, 1}; // sine coefficients + vector S(sa, sa + N * (N + 1) / 2); + double cb[] = {1, 2, 3, 4, 5, 6}; + vector C1(cb, cb + (N1 + 1) * (N1 + 2) / 2); + double sb[] = {3, 2, 1}; + vector S1(sb, sb + N1 * (N1 + 1) / 2); + double a = 1; + SphericalHarmonic1 h(C, S, N, C1, S1, N1, a); + double tau = 0.1, x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h(tau, x, y, z, vx, vy, vz); + cout << v << " " << vx << " " << vy << " " << vz << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic2.cpp b/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic2.cpp new file mode 100644 index 000000000..cce1f49ee --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-SphericalHarmonic2.cpp @@ -0,0 +1,38 @@ +// Example of using the GeographicLib::SphericalHarmonic2 class + +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + int N = 3, N1 = 2, N2 = 1; // The maxium degrees + double ca[] = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1}; // cosine coefficients + vector C(ca, ca + (N + 1) * (N + 2) / 2); + double sa[] = {6, 5, 4, 3, 2, 1}; // sine coefficients + vector S(sa, sa + N * (N + 1) / 2); + double cb[] = {1, 2, 3, 4, 5, 6}; + vector C1(cb, cb + (N1 + 1) * (N1 + 2) / 2); + double sb[] = {3, 2, 1}; + vector S1(sb, sb + N1 * (N1 + 1) / 2); + double cc[] = {2, 1}; + vector C2(cc, cc + (N2 + 1)); + vector S2; + double a = 1; + SphericalHarmonic2 h(C, S, N, N, N, C1, S1, N1, N1, N1, + C2, S2, N2, N2, 0, a); + double tau1 = 0.1, tau2 = 0.05, x = 2, y = 3, z = 1; + double v, vx, vy, vz; + v = h(tau1, tau2, x, y, z, vx, vy, vz); + cout << v << " " << vx << " " << vy << " " << vz << "\n"; + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-TransverseMercator.cpp b/gtsam/3rdparty/GeographicLib/examples/example-TransverseMercator.cpp new file mode 100644 index 000000000..678eeab2e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-TransverseMercator.cpp @@ -0,0 +1,38 @@ +// Example of using the GeographicLib::TransverseMercator class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + TransverseMercator proj(Constants::WGS84_a(), Constants::WGS84_f(), + Constants::UTM_k0()); + // Alternatively: const TransverseMercator& proj = TransverseMercator::UTM; + double lon0 = -75; // Central meridian for UTM zone 18 + { + // Sample forward calculation + double lat = 40.3, lon = -74.7; // Princeton, NJ + double x, y; + proj.Forward(lon0, lat, lon, x, y); + cout << x << " " << y << "\n"; + } + { + // Sample reverse calculation + double x = 25e3, y = 4461e3; + double lat, lon; + proj.Reverse(lon0, x, y, lat, lon); + cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-TransverseMercatorExact.cpp b/gtsam/3rdparty/GeographicLib/examples/example-TransverseMercatorExact.cpp new file mode 100644 index 000000000..0c951bc4a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-TransverseMercatorExact.cpp @@ -0,0 +1,39 @@ +// Example of using the GeographicLib::TransverseMercatorExact class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + TransverseMercatorExact proj(Constants::WGS84_a(), Constants::WGS84_f(), + Constants::UTM_k0()); + // Alternatively: + // const TransverseMercatorExact& proj = TransverseMercatorExact::UTM; + double lon0 = -75; // Central meridian for UTM zone 18 + { + // Sample forward calculation + double lat = 40.3, lon = -74.7; // Princeton, NJ + double x, y; + proj.Forward(lon0, lat, lon, x, y); + cout << x << " " << y << "\n"; + } + { + // Sample reverse calculation + double x = 25e3, y = 4461e3; + double lat, lon; + proj.Reverse(lon0, x, y, lat, lon); + cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-UTMUPS.cpp b/gtsam/3rdparty/GeographicLib/examples/example-UTMUPS.cpp new file mode 100644 index 000000000..a2671d018 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-UTMUPS.cpp @@ -0,0 +1,43 @@ +// Example of using the GeographicLib::UTMUPS class + +#include +#include +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + // See also example-GeoCoords.cpp + { + // Sample forward calculation + double lat = 33.3, lon = 44.4; // Baghdad + int zone; + bool northp; + double x, y; + UTMUPS::Forward(lat, lon, zone, northp, x, y); + string zonestr = UTMUPS::EncodeZone(zone, northp); + cout << fixed << setprecision(2) + << zonestr << " " << x << " " << y << "\n"; + } + { + // Sample reverse calculation + string zonestr = "38N"; + int zone; + bool northp; + UTMUPS::DecodeZone(zonestr, zone, northp); + double x = 444e3, y = 3688e3; + double lat, lon; + UTMUPS::Reverse(zone, northp, x, y, lat, lon); + cout << lat << " " << lon << "\n"; + } + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/examples/example-Utility.cpp b/gtsam/3rdparty/GeographicLib/examples/example-Utility.cpp new file mode 100644 index 000000000..463f85e99 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/examples/example-Utility.cpp @@ -0,0 +1,22 @@ +// Example of using the GeographicLib::Utility class + +#include +#include +#include + +using namespace std; +using namespace GeographicLib; + +int main() { + try { + int + d1 = Utility::day(1939, 9, 3), // Britain declares war on Germany + d2 = Utility::day(1945, 8, 15); // Japan surrenders + cout << d2 - d1 << "\n"; // Length of Second World War for Britain + } + catch (const exception& e) { + cerr << "Caught exception: " << e.what() << "\n"; + return 1; + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Accumulator.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Accumulator.hpp new file mode 100644 index 000000000..798b5b07e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Accumulator.hpp @@ -0,0 +1,172 @@ +/** + * \file Accumulator.hpp + * \brief Header for GeographicLib::Accumulator class + * + * Copyright (c) Charles Karney (2010-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_ACCUMULATOR_HPP) +#define GEOGRAPHICLIB_ACCUMULATOR_HPP 1 + +#include + +namespace GeographicLib { + + /** + * \brief An accumulator for sums + * + * This allow many numbers of floating point type \e T to be added together + * with twice the normal precision. Thus if \e T is double, the effective + * precision of the sum is 106 bits or about 32 decimal places. + * + * The implementation follows J. R. Shewchuk, + * Adaptive Precision + * Floating-Point Arithmetic and Fast Robust Geometric Predicates, + * Discrete & Computational Geometry 18(3) 305--363 (1997). + * + * Approximate timings (summing a vector) + * - double: 2ns + * - Accumulator: 23ns + * + * In the documentation of the member functions, \e sum stands for the value + * currently held in the accumulator. + * + * Example of use: + * \include example-Accumulator.cpp + **********************************************************************/ + template + class GEOGRAPHICLIB_EXPORT Accumulator { + private: + // _s + _t accumulators for the sum. + T _s, _t; + // Same as Math::sum, but requires abs(u) >= abs(v). This isn't currently + // used. + static inline T fastsum(T u, T v, T& t) throw() { + volatile T s = u + v; + volatile T vp = s - u; + t = v - vp; + return s; + } + void Add(T y) throw() { + // Here's Shewchuk's solution... + T u; // hold exact sum as [s, t, u] + y = Math::sum(y, _t, u); // Accumulate starting at least significant end + _s = Math::sum(y, _s, _t); + // Start is _s, _t decreasing and non-adjacent. Sum is now (s + t + u) + // exactly with s, t, u non-adjacent and in decreasing order (except for + // possible zeros). The following code tries to normalize the result. + // Ideally, we want _s = round(s+t+u) and _u = round(s+t+u - _s). The + // following does an approximate job (and maintains the decreasing + // non-adjacent property). Here are two "failures" using 3-bit floats: + // + // Case 1: _s is not equal to round(s+t+u) -- off by 1 ulp + // [12, -1] - 8 -> [4, 0, -1] -> [4, -1] = 3 should be [3, 0] = 3 + // + // Case 2: _s+_t is not as close to s+t+u as it shold be + // [64, 5] + 4 -> [64, 8, 1] -> [64, 8] = 72 (off by 1) + // should be [80, -7] = 73 (exact) + // + // "Fixing" these problems is probably not worth the expense. The + // representation inevitably leads to small errors in the accumulated + // values. The additional errors illustrated here amount to 1 ulp of the + // less significant word during each addition to the Accumulator and an + // additional possible error of 1 ulp in the reported sum. + // + // Incidentally, the "ideal" representation described above is not + // canonical, because _s = round(_s + _t) may not be true. For example, + // with 3-bit floats: + // + // [128, 16] + 1 -> [160, -16] -- 160 = round(145). + // But [160, 0] - 16 -> [128, 16] -- 128 = round(144). + // + if (_s == 0) // This implies t == 0, + _s = u; // so result is u + else + _t += u; // otherwise just accumulate u to t. + } + T Sum(T y) const throw() { + Accumulator a(*this); + a.Add(y); + return a._s; + } + public: + /** + * Construct from a \e T. This is not declared explicit, so that you can + * write Accumulator a = 5;. + * + * @param[in] y set \e sum = \e y. + **********************************************************************/ + Accumulator(T y = T(0)) throw() : _s(y), _t(0) { + STATIC_ASSERT(!std::numeric_limits::is_integer, + "Accumulator type is not floating point"); + } + /** + * Set the accumulator to a number. + * + * @param[in] y set \e sum = \e y. + **********************************************************************/ + Accumulator& operator=(T y) throw() { _s = y; _t = 0; return *this; } + /** + * Return the value held in the accumulator. + * + * @return \e sum. + **********************************************************************/ + T operator()() const throw() { return _s; } + /** + * Return the result of adding a number to \e sum (but don't change \e sum). + * + * @param[in] y the number to be added to the sum. + * @return \e sum + \e y. + **********************************************************************/ + T operator()(T y) const throw() { return Sum(y); } + /** + * Add a number to the accumulator. + * + * @param[in] y set \e sum += \e y. + **********************************************************************/ + Accumulator& operator+=(T y) throw() { Add(y); return *this; } + /** + * Subtract a number from the accumulator. + * + * @param[in] y set \e sum -= \e y. + **********************************************************************/ + Accumulator& operator-=(T y) throw() { Add(-y); return *this; } + /** + * Multiply accumulator by an integer. To avoid loss of accuracy, use only + * integers such that \e n × \e T is exactly representable as a \e T + * (i.e., ± powers of two). Use \e n = −1 to negate \e sum. + * + * @param[in] n set \e sum *= \e n. + **********************************************************************/ + Accumulator& operator*=(int n) throw() { _s *= n; _t *= n; return *this; } + /** + * Test equality of an Accumulator with a number. + **********************************************************************/ + bool operator==(T y) const throw() { return _s == y; } + /** + * Test inequality of an Accumulator with a number. + **********************************************************************/ + bool operator!=(T y) const throw() { return _s != y; } + /** + * Less operator on an Accumulator and a number. + **********************************************************************/ + bool operator<(T y) const throw() { return _s < y; } + /** + * Less or equal operator on an Accumulator and a number. + **********************************************************************/ + bool operator<=(T y) const throw() { return _s <= y; } + /** + * Greater operator on an Accumulator and a number. + **********************************************************************/ + bool operator>(T y) const throw() { return _s > y; } + /** + * Greater or equal operator on an Accumulator and a number. + **********************************************************************/ + bool operator>=(T y) const throw() { return _s >= y; } + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_ACCUMULATOR_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/AlbersEqualArea.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/AlbersEqualArea.hpp new file mode 100644 index 000000000..27cc4725f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/AlbersEqualArea.hpp @@ -0,0 +1,330 @@ +/** + * \file AlbersEqualArea.hpp + * \brief Header for GeographicLib::AlbersEqualArea class + * + * Copyright (c) Charles Karney (2010-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_ALBERSEQUALAREA_HPP) +#define GEOGRAPHICLIB_ALBERSEQUALAREA_HPP 1 + +#include + +namespace GeographicLib { + + /** + * \brief Albers equal area conic projection + * + * Implementation taken from the report, + * - J. P. Snyder, + * Map Projections: A + * Working Manual, USGS Professional Paper 1395 (1987), + * pp. 101--102. + * + * This is a implementation of the equations in Snyder except that divided + * differences will be [have been] used to transform the expressions into + * ones which may be evaluated accurately. [In this implementation, the + * projection correctly becomes the cylindrical equal area or the azimuthal + * equal area projection when the standard latitude is the equator or a + * pole.] + * + * The ellipsoid parameters, the standard parallels, and the scale on the + * standard parallels are set in the constructor. Internally, the case with + * two standard parallels is converted into a single standard parallel, the + * latitude of minimum azimuthal scale, with an azimuthal scale specified on + * this parallel. This latitude is also used as the latitude of origin which + * is returned by AlbersEqualArea::OriginLatitude. The azimuthal scale on + * the latitude of origin is given by AlbersEqualArea::CentralScale. The + * case with two standard parallels at opposite poles is singular and is + * disallowed. The central meridian (which is a trivial shift of the + * longitude) is specified as the \e lon0 argument of the + * AlbersEqualArea::Forward and AlbersEqualArea::Reverse functions. + * AlbersEqualArea::Forward and AlbersEqualArea::Reverse also return the + * meridian convergence, γ, and azimuthal scale, \e k. A small square + * aligned with the cardinal directions is projected to a rectangle with + * dimensions \e k (in the E-W direction) and 1/\e k (in the N-S direction). + * The E-W sides of the rectangle are oriented γ degrees + * counter-clockwise from the \e x axis. There is no provision in this class + * for specifying a false easting or false northing or a different latitude + * of origin. + * + * Example of use: + * \include example-AlbersEqualArea.cpp + * + * ConicProj is a command-line utility + * providing access to the functionality of LambertConformalConic and + * AlbersEqualArea. + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT AlbersEqualArea { + private: + typedef Math::real real; + real _a, _f, _fm, _e2, _e, _e2m, _qZ, _qx; + real _sign, _lat0, _k0; + real _n0, _m02, _nrho0, _k2, _txi0, _scxi0, _sxi0; + static const real eps_; + static const real epsx_; + static const real epsx2_; + static const real tol_; + static const real tol0_; + static const real ahypover_; + static const int numit_ = 5; // Newton iterations in Reverse + static const int numit0_ = 20; // Newton iterations in Init + static inline real hyp(real x) throw() { return Math::hypot(real(1), x); } + // atanh( e * x)/ e if f > 0 + // atan (sqrt(-e2) * x)/sqrt(-e2) if f < 0 + // x if f = 0 + inline real atanhee(real x) const throw() { + return _f > 0 ? Math::atanh(_e * x)/_e : + // We only invoke atanhee in txif for positive latitude. Then x is + // only negative for very prolate ellipsoids (_b/_a >= sqrt(2)) and we + // still need to return a positive result in this case; hence the need + // for the call to atan2. + (_f < 0 ? (std::atan2(_e * std::abs(x), x < 0 ? -1 : 1)/_e) : x); + } + // return atanh(sqrt(x))/sqrt(x) - 1, accurate for small x + static real atanhxm1(real x) throw(); + + // Divided differences + // Definition: Df(x,y) = (f(x)-f(y))/(x-y) + // See: + // W. M. Kahan and R. J. Fateman, + // Symbolic computation of divided differences, + // SIGSAM Bull. 33(3), 7-28 (1999) + // http://dx.doi.org/10.1145/334714.334716 + // http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf + // + // General rules + // h(x) = f(g(x)): Dh(x,y) = Df(g(x),g(y))*Dg(x,y) + // h(x) = f(x)*g(x): + // Dh(x,y) = Df(x,y)*g(x) + Dg(x,y)*f(y) + // = Df(x,y)*g(y) + Dg(x,y)*f(x) + // = Df(x,y)*(g(x)+g(y))/2 + Dg(x,y)*(f(x)+f(y))/2 + // + // sn(x) = x/sqrt(1+x^2): Dsn(x,y) = (x+y)/((sn(x)+sn(y))*(1+x^2)*(1+y^2)) + static inline real Dsn(real x, real y, real sx, real sy) throw() { + // sx = x/hyp(x) + real t = x * y; + return t > 0 ? (x + y) * Math::sq( (sx * sy)/t ) / (sx + sy) : + (x - y != 0 ? (sx - sy) / (x - y) : 1); + } + // Datanhee(x,y) = atanhee((x-y)/(1-e^2*x*y))/(x-y) + inline real Datanhee(real x, real y) const throw() { + real t = x - y, d = 1 - _e2 * x * y; + return t != 0 ? atanhee(t / d) / t : 1 / d; + } + // DDatanhee(x,y) = (Datanhee(1,y) - Datanhee(1,x))/(y-x) + real DDatanhee(real x, real y) const throw(); + void Init(real sphi1, real cphi1, real sphi2, real cphi2, real k1) throw(); + real txif(real tphi) const throw(); + real tphif(real txi) const throw(); + + friend class Ellipsoid; // For access to txif, tphif, etc. + public: + + /** + * Constructor with a single standard parallel. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] stdlat standard parallel (degrees), the circle of tangency. + * @param[in] k0 azimuthal scale on the standard parallel. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k0 is + * not positive. + * @exception GeographicErr if \e stdlat is not in [−90°, + * 90°]. + **********************************************************************/ + AlbersEqualArea(real a, real f, real stdlat, real k0); + + /** + * Constructor with two standard parallels. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] stdlat1 first standard parallel (degrees). + * @param[in] stdlat2 second standard parallel (degrees). + * @param[in] k1 azimuthal scale on the standard parallels. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k1 is + * not positive. + * @exception GeographicErr if \e stdlat1 or \e stdlat2 is not in + * [−90°, 90°], or if \e stdlat1 and \e stdlat2 are + * opposite poles. + **********************************************************************/ + AlbersEqualArea(real a, real f, real stdlat1, real stdlat2, real k1); + + /** + * Constructor with two standard parallels specified by sines and cosines. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] sinlat1 sine of first standard parallel. + * @param[in] coslat1 cosine of first standard parallel. + * @param[in] sinlat2 sine of second standard parallel. + * @param[in] coslat2 cosine of second standard parallel. + * @param[in] k1 azimuthal scale on the standard parallels. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k1 is + * not positive. + * @exception GeographicErr if \e stdlat1 or \e stdlat2 is not in + * [−90°, 90°], or if \e stdlat1 and \e stdlat2 are + * opposite poles. + * + * This allows parallels close to the poles to be specified accurately. + * This routine computes the latitude of origin and the azimuthal scale at + * this latitude. If \e dlat = abs(\e lat2 − \e lat1) ≤ 160°, + * then the error in the latitude of origin is less than 4.5 × + * 10−14d;. + **********************************************************************/ + AlbersEqualArea(real a, real f, + real sinlat1, real coslat1, + real sinlat2, real coslat2, + real k1); + + /** + * Set the azimuthal scale for the projection. + * + * @param[in] lat (degrees). + * @param[in] k azimuthal scale at latitude \e lat (default 1). + * @exception GeographicErr \e k is not positive. + * @exception GeographicErr if \e lat is not in (−90°, + * 90°). + * + * This allows a "latitude of conformality" to be specified. + **********************************************************************/ + void SetScale(real lat, real k = real(1)); + + /** + * Forward projection, from geographic to Lambert conformal conic. + * + * @param[in] lon0 central meridian longitude (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k azimuthal scale of projection at point; the radial + * scale is the 1/\e k. + * + * The latitude origin is given by AlbersEqualArea::LatitudeOrigin(). No + * false easting or northing is added and \e lat should be in the range + * [−90°, 90°]; \e lon and \e lon0 should be in the + * range [−540°, 540°). The values of \e x and \e y + * returned for points which project to infinity (i.e., one or both of the + * poles) will be large but finite. + **********************************************************************/ + void Forward(real lon0, real lat, real lon, + real& x, real& y, real& gamma, real& k) const throw(); + + /** + * Reverse projection, from Lambert conformal conic to geographic. + * + * @param[in] lon0 central meridian longitude (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k azimuthal scale of projection at point; the radial + * scale is the 1/\e k. + * + * The latitude origin is given by AlbersEqualArea::LatitudeOrigin(). No + * false easting or northing is added. \e lon0 should be in the range + * [−540°, 540°). The value of \e lon returned is in + * the range [−180°, 180°). The value of \e lat + * returned is in the range [−90°, 90°]. If the + * input point is outside the legal projected space the nearest pole is + * returned. + **********************************************************************/ + void Reverse(real lon0, real x, real y, + real& lat, real& lon, real& gamma, real& k) const throw(); + + /** + * AlbersEqualArea::Forward without returning the convergence and + * scale. + **********************************************************************/ + void Forward(real lon0, real lat, real lon, + real& x, real& y) const throw() { + real gamma, k; + Forward(lon0, lat, lon, x, y, gamma, k); + } + + /** + * AlbersEqualArea::Reverse without returning the convergence and + * scale. + **********************************************************************/ + void Reverse(real lon0, real x, real y, + real& lat, real& lon) const throw() { + real gamma, k; + Reverse(lon0, x, y, lat, lon, gamma, k); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _a; } + + /** + * @return \e f the flattening of the ellipsoid. This is the value used in + * the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _f; } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() { return 1/_f; } + /// \endcond + + /** + * @return latitude of the origin for the projection (degrees). + * + * This is the latitude of minimum azimuthal scale and equals the \e stdlat + * in the 1-parallel constructor and lies between \e stdlat1 and \e stdlat2 + * in the 2-parallel constructors. + **********************************************************************/ + Math::real OriginLatitude() const throw() { return _lat0; } + + /** + * @return central scale for the projection. This is the azimuthal scale + * on the latitude of origin. + **********************************************************************/ + Math::real CentralScale() const throw() { return _k0; } + ///@} + + /** + * A global instantiation of AlbersEqualArea with the WGS84 ellipsoid, \e + * stdlat = 0, and \e k0 = 1. This degenerates to the cylindrical equal + * area projection. + **********************************************************************/ + static const AlbersEqualArea CylindricalEqualArea; + + /** + * A global instantiation of AlbersEqualArea with the WGS84 ellipsoid, \e + * stdlat = 90°, and \e k0 = 1. This degenerates to the + * Lambert azimuthal equal area projection. + **********************************************************************/ + static const AlbersEqualArea AzimuthalEqualAreaNorth; + + /** + * A global instantiation of AlbersEqualArea with the WGS84 ellipsoid, \e + * stdlat = −90°, and \e k0 = 1. This degenerates to the + * Lambert azimuthal equal area projection. + **********************************************************************/ + static const AlbersEqualArea AzimuthalEqualAreaSouth; + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_ALBERSEQUALAREA_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/AzimuthalEquidistant.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/AzimuthalEquidistant.hpp new file mode 100644 index 000000000..48d88423c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/AzimuthalEquidistant.hpp @@ -0,0 +1,152 @@ +/** + * \file AzimuthalEquidistant.hpp + * \brief Header for GeographicLib::AzimuthalEquidistant class + * + * Copyright (c) Charles Karney (2009-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP) +#define GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP 1 + +#include +#include + +namespace GeographicLib { + + /** + * \brief Azimuthal equidistant projection + * + * Azimuthal equidistant projection centered at an arbitrary position on the + * ellipsoid. For a point in projected space (\e x, \e y), the geodesic + * distance from the center position is hypot(\e x, \e y) and the azimuth of + * the geodesic from the center point is atan2(\e x, \e y). The Forward and + * Reverse methods also return the azimuth \e azi of the geodesic at (\e x, + * \e y) and reciprocal scale \e rk in the azimuthal direction which, + * together with the basic properties of the projection, serve to specify + * completely the local affine transformation between geographic and + * projected coordinates. + * + * The conversions all take place using a Geodesic object (by default + * Geodesic::WGS84). For more information on geodesics see \ref geodesic. + * + * Example of use: + * \include example-AzimuthalEquidistant.cpp + * + * GeodesicProj is a command-line utility + * providing access to the functionality of AzimuthalEquidistant, Gnomonic, + * and CassiniSoldner. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT AzimuthalEquidistant { + private: + typedef Math::real real; + Geodesic _earth; + static const real eps_; + public: + + /** + * Constructor for AzimuthalEquidistant. + * + * @param[in] earth the Geodesic object to use for geodesic calculations. + * By default this uses the WGS84 ellipsoid. + **********************************************************************/ + explicit AzimuthalEquidistant(const Geodesic& earth = Geodesic::WGS84) + throw() : _earth(earth) {} + + /** + * Forward projection, from geographic to azimuthal equidistant. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] azi azimuth of geodesic at point (degrees). + * @param[out] rk reciprocal of azimuthal scale at point. + * + * \e lat0 and \e lat should be in the range [−90°, + * 90°] and \e lon0 and \e lon should be in the range + * [−540°, 540°). The scale of the projection is 1 + * in the "radial" direction, \e azi clockwise from true north, and is 1/\e + * rk in the direction perpendicular to this. A call to Forward followed + * by a call to Reverse will return the original (\e lat, \e lon) (to + * within roundoff). + **********************************************************************/ + void Forward(real lat0, real lon0, real lat, real lon, + real& x, real& y, real& azi, real& rk) const throw(); + + /** + * Reverse projection, from azimuthal equidistant to geographic. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] azi azimuth of geodesic at point (degrees). + * @param[out] rk reciprocal of azimuthal scale at point. + * + * \e lat0 should be in the range [−90°, 90°] and \e + * lon0 should be in the range [−540°, 540°). \e lat + * will be in the range [−90°, 90°] and \e lon will + * be in the range [−180°, 180°). The scale of the + * projection is 1 in the "radial" direction, \e azi clockwise from true + * north, and is 1/\e rk in the direction perpendicular to this. A call to + * Reverse followed by a call to Forward will return the original (\e x, \e + * y) (to roundoff) only if the geodesic to (\e x, \e y) is a shortest + * path. + **********************************************************************/ + void Reverse(real lat0, real lon0, real x, real y, + real& lat, real& lon, real& azi, real& rk) const throw(); + + /** + * AzimuthalEquidistant::Forward without returning the azimuth and scale. + **********************************************************************/ + void Forward(real lat0, real lon0, real lat, real lon, + real& x, real& y) const throw() { + real azi, rk; + Forward(lat0, lon0, lat, lon, x, y, azi, rk); + } + + /** + * AzimuthalEquidistant::Reverse without returning the azimuth and scale. + **********************************************************************/ + void Reverse(real lat0, real lon0, real x, real y, + real& lat, real& lon) const throw() { + real azi, rk; + Reverse(lat0, lon0, x, y, lat, lon, azi, rk); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _earth.Flattening(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return _earth.InverseFlattening(); } + /// \endcond + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_AZIMUTHALEQUIDISTANT_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/include/GeographicLib/CMakeLists.txt new file mode 100644 index 000000000..d4029a1e5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/CMakeLists.txt @@ -0,0 +1,6 @@ +# Install the header files including the generated Config.h (which is in +# the build tree). +file (GLOB HEADERS [A-Za-z]*.hpp) +install (FILES ${HEADERS} DESTINATION include/GeographicLib) +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Config.h + DESTINATION include/GeographicLib) diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/CassiniSoldner.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/CassiniSoldner.hpp new file mode 100644 index 000000000..391505325 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/CassiniSoldner.hpp @@ -0,0 +1,239 @@ +/** + * \file CassiniSoldner.hpp + * \brief Header for GeographicLib::CassiniSoldner class + * + * Copyright (c) Charles Karney (2009-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_CASSINISOLDNER_HPP) +#define GEOGRAPHICLIB_CASSINISOLDNER_HPP 1 + +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief Cassini-Soldner projection + * + * Cassini-Soldner projection centered at an arbitrary position, \e lat0, \e + * lon0, on the ellipsoid. This projection is a transverse cylindrical + * equidistant projection. The projection from (\e lat, \e lon) to easting + * and northing (\e x, \e y) is defined by geodesics as follows. Go north + * along a geodesic a distance \e y from the central point; then turn + * clockwise 90° and go a distance \e x along a geodesic. + * (Although the initial heading is north, this changes to south if the pole + * is crossed.) This procedure uniquely defines the reverse projection. The + * forward projection is constructed as follows. Find the point (\e lat1, \e + * lon1) on the meridian closest to (\e lat, \e lon). Here we consider the + * full meridian so that \e lon1 may be either \e lon0 or \e lon0 + + * 180°. \e x is the geodesic distance from (\e lat1, \e lon1) to + * (\e lat, \e lon), appropriately signed according to which side of the + * central meridian (\e lat, \e lon) lies. \e y is the shortest distance + * along the meridian from (\e lat0, \e lon0) to (\e lat1, \e lon1), again, + * appropriately signed according to the initial heading. [Note that, in the + * case of prolate ellipsoids, the shortest meridional path from (\e lat0, \e + * lon0) to (\e lat1, \e lon1) may not be the shortest path.] This procedure + * uniquely defines the forward projection except for a small class of points + * for which there may be two equally short routes for either leg of the + * path. + * + * Because of the properties of geodesics, the (\e x, \e y) grid is + * orthogonal. The scale in the easting direction is unity. The scale, \e + * k, in the northing direction is unity on the central meridian and + * increases away from the central meridian. The projection routines return + * \e azi, the true bearing of the easting direction, and \e rk = 1/\e k, the + * reciprocal of the scale in the northing direction. + * + * The conversions all take place using a Geodesic object (by default + * Geodesic::WGS84). For more information on geodesics see \ref geodesic. + * The determination of (\e lat1, \e lon1) in the forward projection is by + * solving the inverse geodesic problem for (\e lat, \e lon) and its twin + * obtained by reflection in the meridional plane. The scale is found by + * determining where two neighboring geodesics intersecting the central + * meridian at \e lat1 and \e lat1 + \e dlat1 intersect and taking the ratio + * of the reduced lengths for the two geodesics between that point and, + * respectively, (\e lat1, \e lon1) and (\e lat, \e lon). + * + * Example of use: + * \include example-CassiniSoldner.cpp + * + * GeodesicProj is a command-line utility + * providing access to the functionality of AzimuthalEquidistant, Gnomonic, + * and CassiniSoldner. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT CassiniSoldner { + private: + typedef Math::real real; + Geodesic _earth; + GeodesicLine _meridian; + real _sbet0, _cbet0; + static const real eps1_; + static const real tiny_; + static const unsigned maxit_ = 10; + + // The following private helper functions are copied from Geodesic. + static inline real AngRound(real x) throw() { + // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^57 + // for reals = 0.7 pm on the earth if x is an angle in degrees. (This + // is about 1000 times more resolution than we get with angles around 90 + // degrees.) We use this to avoid having to deal with near singular + // cases when x is non-zero but tiny (e.g., 1.0e-200). + const real z = 1/real(16); + volatile real y = std::abs(x); + // The compiler mustn't "simplify" z - (z - y) to y + y = y < z ? z - (z - y) : y; + return x < 0 ? -y : y; + } + static inline void SinCosNorm(real& sinx, real& cosx) throw() { + real r = Math::hypot(sinx, cosx); + sinx /= r; + cosx /= r; + } + public: + + /** + * Constructor for CassiniSoldner. + * + * @param[in] earth the Geodesic object to use for geodesic calculations. + * By default this uses the WGS84 ellipsoid. + * + * This constructor makes an "uninitialized" object. Call Reset to set the + * central latitude and longitude, prior to calling Forward and Reverse. + **********************************************************************/ + explicit CassiniSoldner(const Geodesic& earth = Geodesic::WGS84) throw() + : _earth(earth) {} + + /** + * Constructor for CassiniSoldner specifying a center point. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] earth the Geodesic object to use for geodesic calculations. + * By default this uses the WGS84 ellipsoid. + * + * \e lat0 should be in the range [−90°, 90°] and \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + CassiniSoldner(real lat0, real lon0, + const Geodesic& earth = Geodesic::WGS84) throw() + : _earth(earth) { + Reset(lat0, lon0); + } + + /** + * Set the central point of the projection + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * + * \e lat0 should be in the range [−90°, 90°] and \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + void Reset(real lat0, real lon0) throw(); + + /** + * Forward projection, from geographic to Cassini-Soldner. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] azi azimuth of easting direction at point (degrees). + * @param[out] rk reciprocal of azimuthal northing scale at point. + * + * \e lat should be in the range [−90°, 90°] and \e + * lon should be in the range [−540°, 540°). A call + * to Forward followed by a call to Reverse will return the original (\e + * lat, \e lon) (to within roundoff). The routine does nothing if the + * origin has not been set. + **********************************************************************/ + void Forward(real lat, real lon, + real& x, real& y, real& azi, real& rk) const throw(); + + /** + * Reverse projection, from Cassini-Soldner to geographic. + * + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] azi azimuth of easting direction at point (degrees). + * @param[out] rk reciprocal of azimuthal northing scale at point. + * + * A call to Reverse followed by a call to Forward will return the original + * (\e x, \e y) (to within roundoff), provided that \e x and \e y are + * sufficiently small not to "wrap around" the earth. The routine does + * nothing if the origin has not been set. + **********************************************************************/ + void Reverse(real x, real y, + real& lat, real& lon, real& azi, real& rk) const throw(); + + /** + * CassiniSoldner::Forward without returning the azimuth and scale. + **********************************************************************/ + void Forward(real lat, real lon, + real& x, real& y) const throw() { + real azi, rk; + Forward(lat, lon, x, y, azi, rk); + } + + /** + * CassiniSoldner::Reverse without returning the azimuth and scale. + **********************************************************************/ + void Reverse(real x, real y, + real& lat, real& lon) const throw() { + real azi, rk; + Reverse(x, y, lat, lon, azi, rk); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return true if the object has been initialized. + **********************************************************************/ + bool Init() const throw() { return _meridian.Init(); } + + /** + * @return \e lat0 the latitude of origin (degrees). + **********************************************************************/ + Math::real LatitudeOrigin() const throw() + { return _meridian.Latitude(); } + + /** + * @return \e lon0 the longitude of origin (degrees). + **********************************************************************/ + Math::real LongitudeOrigin() const throw() + { return _meridian.Longitude(); } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _earth.Flattening(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return _earth.InverseFlattening(); } + /// \endcond + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_CASSINISOLDNER_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/CircularEngine.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/CircularEngine.hpp new file mode 100644 index 000000000..3ce88b74c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/CircularEngine.hpp @@ -0,0 +1,204 @@ +/** + * \file CircularEngine.hpp + * \brief Header for GeographicLib::CircularEngine class + * + * Copyright (c) Charles Karney (2011) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_CIRCULARENGINE_HPP) +#define GEOGRAPHICLIB_CIRCULARENGINE_HPP 1 + +#include +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs vector +# pragma warning (push) +# pragma warning (disable: 4251) +#endif + +namespace GeographicLib { + + /** + * \brief Spherical harmonic sums for a circle + * + * The class is a companion to SphericalEngine. If the results of a + * spherical harmonic sum are needed for several points on a circle of + * constant latitude \e lat and height \e h, then SphericalEngine::Circle can + * compute the inner sum, which is independent of longitude \e lon, and + * produce a CircularEngine object. CircularEngine::operator()() can + * then be used to perform the outer sum for particular vales of \e lon. + * This can lead to substantial improvements in computational speed for high + * degree sum (approximately by a factor of \e N / 2 where \e N is the + * maximum degree). + * + * CircularEngine is tightly linked to the internals of SphericalEngine. For + * that reason, the constructor for this class is private. Use + * SphericalHarmonic::Circle, SphericalHarmonic1::Circle, and + * SphericalHarmonic2::Circle to create instances of this class. + * + * CircularEngine stores the coefficients needed to allow the summation over + * order to be performed in 2 or 6 vectors of length \e M + 1 (depending on + * whether gradients are to be calculated). For this reason the constructor + * may throw a std::bad_alloc exception. + * + * Example of use: + * \include example-CircularEngine.cpp + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT CircularEngine { + private: + typedef Math::real real; + enum normalization { + FULL = SphericalEngine::FULL, + SCHMIDT = SphericalEngine::SCHMIDT, + }; + int _M; + bool _gradp; + unsigned _norm; + real _a, _r, _u, _t; + std::vector _wc, _ws, _wrc, _wrs, _wtc, _wts; + real _q, _uq, _uq2; + + Math::real Value(bool gradp, real cl, real sl, + real& gradx, real& grady, real& gradz) const throw(); + + static inline void cossin(real x, real& cosx, real& sinx) { + x = x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); + real xi = x * Math::degree(); + cosx = std::abs(x) == 90 ? 0 : cos(xi); + sinx = x == -180 ? 0 : sin(xi); + } + + friend class SphericalEngine; + friend class GravityCircle; // Access to cossin + friend class MagneticCircle; // Access to cossin + CircularEngine(int M, bool gradp, unsigned norm, + real a, real r, real u, real t) + : _M(M) + , _gradp(gradp) + , _norm(norm) + , _a(a) + , _r(r) + , _u(u) + , _t(t) + , _wc(std::vector(_M + 1, 0)) + , _ws(std::vector(_M + 1, 0)) + , _wrc(std::vector(_gradp ? _M + 1 : 0, 0)) + , _wrs(std::vector(_gradp ? _M + 1 : 0, 0)) + , _wtc(std::vector(_gradp ? _M + 1 : 0, 0)) + , _wts(std::vector(_gradp ? _M + 1 : 0, 0)) + { + _q = _a / _r; + _uq = _u * _q; + _uq2 = Math::sq(_uq); + } + + void SetCoeff(int m, real wc, real ws) + { _wc[m] = wc; _ws[m] = ws; } + + void SetCoeff(int m, real wc, real ws, + real wrc, real wrs, real wtc, real wts) { + _wc[m] = wc; _ws[m] = ws; + if (_gradp) { + _wrc[m] = wrc; _wrs[m] = wrs; + _wtc[m] = wtc; _wts[m] = wts; + } + } + + public: + + /** + * A default constructor. CircularEngine::operator()() on the resulting + * object returns zero. The resulting object can be assigned to the result + * of SphericalHarmonic::Circle. + **********************************************************************/ + CircularEngine() + : _M(-1) + , _gradp(true) + , _u(0) + , _t(1) + {} + + /** + * Evaluate the sum for a particular longitude given in terms of its + * cosine and sine. + * + * @param[in] coslon the cosine of the longitude. + * @param[in] sinlon the sine of the longitude. + * @return \e V the value of the sum. + * + * The arguments must satisfy coslon2 + + * sinlon2 = 1. + **********************************************************************/ + Math::real operator()(real coslon, real sinlon) const throw() { + real dummy; + return Value(false, coslon, sinlon, dummy, dummy, dummy); + } + + /** + * Evaluate the sum for a particular longitude. + * + * @param[in] lon the longitude (degrees). + * @return \e V the value of the sum. + **********************************************************************/ + Math::real operator()(real lon) const throw() { + real coslon, sinlon; + cossin(lon, coslon, sinlon); + return (*this)(coslon, sinlon); + } + + /** + * Evaluate the sum and its gradient for a particular longitude given in + * terms of its cosine and sine. + * + * @param[in] coslon the cosine of the longitude. + * @param[in] sinlon the sine of the longitude. + * @param[out] gradx \e x component of the gradient. + * @param[out] grady \e y component of the gradient. + * @param[out] gradz \e z component of the gradient. + * @return \e V the value of the sum. + * + * The gradients will only be computed if the CircularEngine object was + * created with this capability (e.g., via \e gradp = true in + * SphericalHarmonic::Circle). If not, \e gradx, etc., will not be + * touched. The arguments must satisfy coslon2 + + * sinlon2 = 1. + **********************************************************************/ + Math::real operator()(real coslon, real sinlon, + real& gradx, real& grady, real& gradz) const throw() { + return Value(true, coslon, sinlon, gradx, grady, gradz); + } + + /** + * Evaluate the sum and its gradient for a particular longitude. + * + * @param[in] lon the longitude (degrees). + * @param[out] gradx \e x component of the gradient. + * @param[out] grady \e y component of the gradient. + * @param[out] gradz \e z component of the gradient. + * @return \e V the value of the sum. + * + * The gradients will only be computed if the CircularEngine object was + * created with this capability (e.g., via \e gradp = true in + * SphericalHarmonic::Circle). If not, \e gradx, etc., will not be + * touched. + **********************************************************************/ + Math::real operator()(real lon, + real& gradx, real& grady, real& gradz) const throw() { + real coslon, sinlon; + cossin(lon, coslon, sinlon); + return (*this)(coslon, sinlon, gradx, grady, gradz); + } + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_CIRCULARENGINE_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config-ac.h.in b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config-ac.h.in new file mode 100644 index 000000000..a0064f4ce --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config-ac.h.in @@ -0,0 +1,107 @@ +/* include/GeographicLib/Config-ac.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* major version number */ +#undef GEOGRAPHICLIB_VERSION_MAJOR + +/* minor version number */ +#undef GEOGRAPHICLIB_VERSION_MINOR + +/* patch number */ +#undef GEOGRAPHICLIB_VERSION_PATCH + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if the system has the type `long double'. */ +#undef HAVE_LONG_DOUBLE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if stdbool.h conforms to C99. */ +#undef HAVE_STDBOOL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if the system has the type `_Bool'. */ +#undef HAVE__BOOL + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h new file mode 100644 index 000000000..1e5e30b9b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h @@ -0,0 +1,12 @@ +// This will be overwritten by ./configure + +#define GEOGRAPHICLIB_VERSION_STRING "1.34" +#define GEOGRAPHICLIB_VERSION_MAJOR 1 +#define GEOGRAPHICLIB_VERSION_MINOR 34 +#define GEOGRAPHICLIB_VERSION_PATCH 0 + +// Undefine HAVE_LONG_DOUBLE if this type is unknown to the compiler +#define HAVE_LONG_DOUBLE 1 + +// Define WORDS_BIGENDIAN to be 1 if your machine is big endian +/* #undef WORDS_BIGENDIAN */ diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h.in b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h.in new file mode 100644 index 000000000..7aae77eef --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h.in @@ -0,0 +1,25 @@ +#define GEOGRAPHICLIB_VERSION_STRING "@PROJECT_VERSION@" +#define GEOGRAPHICLIB_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ +#define GEOGRAPHICLIB_VERSION_MINOR @PROJECT_VERSION_MINOR@ +#define GEOGRAPHICLIB_VERSION_PATCH @PROJECT_VERSION_PATCH@ +#define GEOGRAPHICLIB_DATA "@GEOGRAPHICLIB_DATA@" + +// These are macros which affect the building of the library +#cmakedefine01 HAVE_LONG_DOUBLE +#cmakedefine01 WORDS_BIGENDIAN +#define GEOGRAPHICLIB_PRECISION @GEOGRAPHICLIB_PRECISION@ + +// Specify whether GeographicLib is a shared or static library. When compiling +// under Visual Studio it is necessary to specify whether GeographicLib is a +// shared library. This is done with the macro GEOGRAPHICLIB_SHARED_LIB, which +// cmake will correctly define as 0 or 1 when only one type of library is in +// the package. If both shared and static libraries are available, +// GEOGRAPHICLIB_SHARED_LIB is set to 2 which triggers a preprocessor error in +// Geographic.hpp. In this case, the appropriate value (0 or 1) for +// GEOGRAPHICLIB_SHARED_LIB must be specified when compiling any program that +// includes Geographic.hpp. This is done automatically if GeographicLib and +// the the user's code were built with cmake version 2.8.11 (which introduced +// the command target_compile_definitions) or later. +#if !defined(GEOGRAPHICLIB_SHARED_LIB) +#define GEOGRAPHICLIB_SHARED_LIB @GEOGRAPHICLIB_LIB_TYPE_VAL@ +#endif diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Constants.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Constants.hpp new file mode 100644 index 000000000..e37ec62ce --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Constants.hpp @@ -0,0 +1,323 @@ +/** + * \file Constants.hpp + * \brief Header for GeographicLib::Constants class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_CONSTANTS_HPP) +#define GEOGRAPHICLIB_CONSTANTS_HPP 1 + +#include + +/** + * A compile-time assert. Use C++11 static_assert, if available. + **********************************************************************/ +#if !defined(STATIC_ASSERT) +# if __cplusplus >= 201103 +# define STATIC_ASSERT static_assert +# elif defined(__GXX_EXPERIMENTAL_CXX0X__) +# define STATIC_ASSERT static_assert +# elif defined(_MSC_VER) && _MSC_VER >= 1600 +# define STATIC_ASSERT static_assert +# else +# define STATIC_ASSERT(cond,reason) \ + { enum{ STATIC_ASSERT_ENUM = 1/int(cond) }; } +# endif +#endif + +#if defined(_MSC_VER) && defined(GEOGRAPHICLIB_SHARED_LIB) && \ + GEOGRAPHICLIB_SHARED_LIB +# if GEOGRAPHICLIB_SHARED_LIB > 1 +# error GEOGRAPHICLIB_SHARED_LIB must be 0 or 1 +# elif defined(GeographicLib_EXPORTS) +# define GEOGRAPHICLIB_EXPORT __declspec(dllexport) +# else +# define GEOGRAPHICLIB_EXPORT __declspec(dllimport) +# endif +#else +# define GEOGRAPHICLIB_EXPORT +#endif + +#include +#include +#include + +/** + * \brief Namespace for %GeographicLib + * + * All of %GeographicLib is defined within the GeographicLib namespace. In + * addition all the header files are included via %GeographicLib/Class.hpp. + * This minimizes the likelihood of conflicts with other packages. + **********************************************************************/ +namespace GeographicLib { + + /** + * \brief %Constants needed by %GeographicLib + * + * Define constants specifying the WGS84 ellipsoid, the UTM and UPS + * projections, and various unit conversions. + * + * Example of use: + * \include example-Constants.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT Constants { + private: + typedef Math::real real; + Constants(); // Disable constructor + + public: + /** + * A synonym for Math::degree(). + **********************************************************************/ + static inline Math::real degree() throw() { return Math::degree(); } + /** + * @return the number of radians in an arcminute. + **********************************************************************/ + static inline Math::real arcminute() throw() + { return Math::degree() / 60; } + /** + * @return the number of radians in an arcsecond. + **********************************************************************/ + static inline Math::real arcsecond() throw() + { return Math::degree() / 3600; } + + /** \name Ellipsoid parameters + **********************************************************************/ + ///@{ + /** + * @tparam T the type of the returned value. + * @return the equatorial radius of WGS84 ellipsoid (6378137 m). + **********************************************************************/ + template static inline T WGS84_a() throw() + { return T(6378137) * meter(); } + /** + * A synonym for WGS84_a(). + **********************************************************************/ + static inline Math::real WGS84_a() throw() { return WGS84_a(); } + /** + * @tparam T the type of the returned value. + * @return the flattening of WGS84 ellipsoid (1/298.257223563). + **********************************************************************/ + template static inline T WGS84_f() throw() + { return T(1) / ( T(298) + T(257223563) / T(1000000000) ); } + /** + * A synonym for WGS84_f(). + **********************************************************************/ + static inline Math::real WGS84_f() throw() { return WGS84_f(); } + /** + * @tparam T the type of the returned value. + * @return the gravitational constant of the WGS84 ellipsoid, \e GM, in + * m3 s−2. + **********************************************************************/ + template static inline T WGS84_GM() throw() + { return T(3986004) * T(100000000) + T(41800000); } + /** + * @tparam T the type of the returned value. + * @return the angular velocity of the WGS84 ellipsoid, ω, in rad + * s−1. + **********************************************************************/ + template static inline T WGS84_omega() throw() + { return T(7292115) / (T(1000000) * T(100000)); } + /// \cond SKIP + /** + * DEPRECATED + * @return the reciprocal flattening of WGS84 ellipsoid. + **********************************************************************/ + template static inline T WGS84_r() throw() + { return 1/WGS84_f(); } + /** + * DEPRECATED + * A synonym for WGS84_r(). + **********************************************************************/ + static inline Math::real WGS84_r() throw() { return WGS84_r(); } + /// \endcond + /** + * @tparam T the type of the returned value. + * @return the equatorial radius of GRS80 ellipsoid, \e a, in m. + **********************************************************************/ + template static inline T GRS80_a() throw() + { return T(6378137); } + /** + * @tparam T the type of the returned value. + * @return the gravitational constant of the GRS80 ellipsoid, \e GM, in + * m3 s−2. + **********************************************************************/ + template static inline T GRS80_GM() throw() + { return T(3986005) * T(100000000); } + /** + * @tparam T the type of the returned value. + * @return the angular velocity of the GRS80 ellipsoid, ω, in rad + * s−1. + * + * This is about 2 π 366.25 / (365.25 × 24 × 3600) rad + * s−1. 365.25 is the number of days in a Julian year and + * 365.35/366.25 converts from solar days to sidereal days. Using the + * number of days in a Gregorian year (365.2425) results in a worse + * approximation (because the Gregorian year includes the precession of the + * earth's axis). + **********************************************************************/ + template static inline T GRS80_omega() throw() + { return T(7292115) / (T(1000000) * T(100000)); } + /** + * @tparam T the type of the returned value. + * @return the dynamical form factor of the GRS80 ellipsoid, + * J2. + **********************************************************************/ + template static inline T GRS80_J2() throw() + { return T(108263) / T(100000000); } + /** + * @tparam T the type of the returned value. + * @return the central scale factor for UTM (0.9996). + **********************************************************************/ + template static inline T UTM_k0() throw() + {return T(9996) / T(10000); } + /** + * A synonym for UTM_k0(). + **********************************************************************/ + static inline Math::real UTM_k0() throw() { return UTM_k0(); } + /** + * @tparam T the type of the returned value. + * @return the central scale factor for UPS (0.994). + **********************************************************************/ + template static inline T UPS_k0() throw() + { return T(994) / T(1000); } + /** + * A synonym for UPS_k0(). + **********************************************************************/ + static inline Math::real UPS_k0() throw() { return UPS_k0(); } + ///@} + + /** \name SI units + **********************************************************************/ + ///@{ + /** + * @tparam T the type of the returned value. + * @return the number of meters in a meter. + * + * This is unity, but this lets the internal system of units be changed if + * necessary. + **********************************************************************/ + template static inline T meter() throw() { return T(1); } + /** + * A synonym for meter(). + **********************************************************************/ + static inline Math::real meter() throw() { return meter(); } + /** + * @return the number of meters in a kilometer. + **********************************************************************/ + static inline Math::real kilometer() throw() + { return 1000 * meter(); } + /** + * @return the number of meters in a nautical mile (approximately 1 arc + * minute) + **********************************************************************/ + static inline Math::real nauticalmile() throw() + { return 1852 * meter(); } + + /** + * @tparam T the type of the returned value. + * @return the number of square meters in a square meter. + * + * This is unity, but this lets the internal system of units be changed if + * necessary. + **********************************************************************/ + template static inline T square_meter() throw() + { return meter() * meter(); } + /** + * A synonym for square_meter(). + **********************************************************************/ + static inline Math::real square_meter() throw() + { return square_meter(); } + /** + * @return the number of square meters in a hectare. + **********************************************************************/ + static inline Math::real hectare() throw() + { return 10000 * square_meter(); } + /** + * @return the number of square meters in a square kilometer. + **********************************************************************/ + static inline Math::real square_kilometer() throw() + { return kilometer() * kilometer(); } + /** + * @return the number of square meters in a square nautical mile. + **********************************************************************/ + static inline Math::real square_nauticalmile() throw() + { return nauticalmile() * nauticalmile(); } + ///@} + + /** \name Anachronistic British units + **********************************************************************/ + ///@{ + /** + * @return the number of meters in an international foot. + **********************************************************************/ + static inline Math::real foot() throw() + { return real(0.0254L) * 12 * meter(); } + /** + * @return the number of meters in a yard. + **********************************************************************/ + static inline Math::real yard() throw() { return 3 * foot(); } + /** + * @return the number of meters in a fathom. + **********************************************************************/ + static inline Math::real fathom() throw() { return 2 * yard(); } + /** + * @return the number of meters in a chain. + **********************************************************************/ + static inline Math::real chain() throw() { return 22 * yard(); } + /** + * @return the number of meters in a furlong. + **********************************************************************/ + static inline Math::real furlong() throw() { return 10 * chain(); } + /** + * @return the number of meters in a statute mile. + **********************************************************************/ + static inline Math::real mile() throw() { return 8 * furlong(); } + /** + * @return the number of square meters in an acre. + **********************************************************************/ + static inline Math::real acre() throw() { return chain() * furlong(); } + /** + * @return the number of square meters in a square statute mile. + **********************************************************************/ + static inline Math::real square_mile() throw() { return mile() * mile(); } + ///@} + + /** \name Anachronistic US units + **********************************************************************/ + ///@{ + /** + * @return the number of meters in a US survey foot. + **********************************************************************/ + static inline Math::real surveyfoot() throw() + { return real(1200) / real(3937) * meter(); } + ///@} + }; + + /** + * \brief Exception handling for %GeographicLib + * + * A class to handle exceptions. It's derived from std::runtime_error so it + * can be caught by the usual catch clauses. + * + * Example of use: + * \include example-GeographicErr.cpp + **********************************************************************/ + class GeographicErr : public std::runtime_error { + public: + + /** + * Constructor + * + * @param[in] msg a string message, which is accessible in the catch + * clause via what(). + **********************************************************************/ + GeographicErr(const std::string& msg) : std::runtime_error(msg) {} + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_CONSTANTS_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/DMS.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/DMS.hpp new file mode 100644 index 000000000..ea9fe5ce0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/DMS.hpp @@ -0,0 +1,368 @@ +/** + * \file DMS.hpp + * \brief Header for GeographicLib::DMS class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_DMS_HPP) +#define GEOGRAPHICLIB_DMS_HPP 1 + +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs vector and constant conditional expressions +# pragma warning (push) +# pragma warning (disable: 4251 4127) +#endif + +namespace GeographicLib { + + /** + * \brief Convert between degrees and the %DMS representation + * + * Parse a string representing degree, minutes, and seconds and return the + * angle in degrees and format an angle in degrees as degree, minutes, and + * seconds. In addition, handle NANs and infinities on input and output. + * + * Example of use: + * \include example-DMS.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT DMS { + private: + typedef Math::real real; + // Replace all occurrences of pat by c + static void replace(std::string& s, const std::string& pat, char c) { + std::string::size_type p = 0; + while (true) { + p = s.find(pat, p); + if (p == std::string::npos) + break; + s.replace(p, pat.length(), 1, c); + } + } + static const std::string hemispheres_; + static const std::string signs_; + static const std::string digits_; + static const std::string dmsindicators_; + static const std::string components_[3]; + static Math::real NumMatch(const std::string& s); + DMS(); // Disable constructor + + public: + + /** + * Indicator for presence of hemisphere indicator (N/S/E/W) on latitudes + * and longitudes. + **********************************************************************/ + enum flag { + /** + * No indicator present. + * @hideinitializer + **********************************************************************/ + NONE = 0, + /** + * Latitude indicator (N/S) present. + * @hideinitializer + **********************************************************************/ + LATITUDE = 1, + /** + * Longitude indicator (E/W) present. + * @hideinitializer + **********************************************************************/ + LONGITUDE = 2, + /** + * Used in Encode to indicate output of an azimuth in [000, 360) with no + * letter indicator. + * @hideinitializer + **********************************************************************/ + AZIMUTH = 3, + /** + * Used in Encode to indicate output of a plain number. + * @hideinitializer + **********************************************************************/ + NUMBER = 4, + }; + + /** + * Indicator for trailing units on an angle. + **********************************************************************/ + enum component { + /** + * Trailing unit is degrees. + * @hideinitializer + **********************************************************************/ + DEGREE = 0, + /** + * Trailing unit is arc minutes. + * @hideinitializer + **********************************************************************/ + MINUTE = 1, + /** + * Trailing unit is arc seconds. + * @hideinitializer + **********************************************************************/ + SECOND = 2, + }; + + /** + * Convert a string in DMS to an angle. + * + * @param[in] dms string input. + * @param[out] ind a DMS::flag value signaling the presence of a + * hemisphere indicator. + * @exception GeographicErr if \e dms is malformed (see below). + * @return angle (degrees). + * + * Degrees, minutes, and seconds are indicated by the characters d, ' + * (single quote), " (double quote), and these components may only be + * given in this order. Any (but not all) components may be omitted and + * other symbols (e.g., the ° symbol for degrees and the unicode + * prime and double prime symbols for minutes and seconds) may be + * substituted. The last component indicator may be omitted and is assumed + * to be the next smallest unit (thus 33d10 is interpreted as 33d10'). The + * final component may be a decimal fraction but the non-final components + * must be integers. Instead of using d, ', and " to indicate + * degrees, minutes, and seconds, : (colon) may be used to separate + * these components (numbers must appear before and after each colon); thus + * 50d30'10.3" may be written as 50:30:10.3, 5.5' may be written + * 0:5.5, and so on. The integer parts of the minutes and seconds + * components must be less than 60. A single leading sign is permitted. A + * hemisphere designator (N, E, W, S) may be added to the beginning or end + * of the string. The result is multiplied by the implied sign of the + * hemisphere designator (negative for S and W). In addition \e ind is set + * to DMS::LATITUDE if N or S is present, to DMS::LONGITUDE if E or W is + * present, and to DMS::NONE otherwise. Throws an error on a malformed + * string. No check is performed on the range of the result. Examples of + * legal and illegal strings are + * - LEGAL (all the entries on each line are equivalent) + * - -20.51125, 20d30'40.5"S, -20°30'40.5, -20d30.675, + * N-20d30'40.5", -20:30:40.5 + * - 4d0'9, 4d9", 4d9'', 4:0:9, 004:00:09, 4.0025, 4.0025d, 4d0.15, + * 04:.15 + * - ILLEGAL (the exception thrown explains the problem) + * - 4d5"4', 4::5, 4:5:, :4:5, 4d4.5'4", -N20.5, 1.8e2d, 4:60, + * 4d-5' + * + * NOTE: At present, all the string handling in the C++ + * implementation %GeographicLib is with 8-bit characters. The support for + * unicode symbols for degrees, minutes, and seconds is therefore via the + * UTF-8 encoding. (The + * JavaScript implementation of this class uses unicode natively, of + * course.) + * + * Here is the list of Unicode symbols supported for degrees, minutes, + * seconds: + * - degrees: + * - d, D lower and upper case letters + * - U+00b0 degree symbol (°) + * - U+00ba masculine ordinal indicator + * - U+2070 superscript zero + * - U+02da ring above + * - minutes: + * - ' apostrophe + * - U+2032 prime (′) + * - U+00b4 acute accent + * - U+2019 right single quote (’) + * - seconds: + * - " quotation mark + * - U+2033 double prime (″) + * - U+201d right double quote (”) + * - ' ' any two consecutive symbols for minutes + * . + * The codes with a leading zero byte, e.g., U+00b0, are accepted in their + * UTF-8 coded form 0xc2 0xb0 and as a single byte 0xb0. + **********************************************************************/ + static Math::real Decode(const std::string& dms, flag& ind); + + /** + * Convert DMS to an angle. + * + * @param[in] d degrees. + * @param[in] m arc minutes. + * @param[in] s arc seconds. + * @return angle (degrees) + * + * This does not propagate the sign on \e d to the other components, so + * -3d20' would need to be represented as - DMS::Decode(3.0, 20.0) or + * DMS::Decode(-3.0, -20.0). + **********************************************************************/ + static Math::real Decode(real d, real m = 0, real s = 0) throw() + { return d + (m + s/real(60))/real(60); } + + /// \cond SKIP + /** + * DEPRECATED (use Utility::num, instead). + * Convert a string to a real number. + * + * @param[in] str string input. + * @exception GeographicErr if \e str is malformed. + * @return decoded number. + **********************************************************************/ + static Math::real Decode(const std::string& str) + { return Utility::num(str); } + + /** + * DEPRECATED (use Utility::fract, instead). + * Convert a string to a real number treating the case where the string is + * a simple fraction. + * + * @param[in] str string input. + * @exception GeographicErr if \e str is malformed. + * @return decoded number. + **********************************************************************/ + static Math::real DecodeFraction(const std::string& str) + { return Utility::fract(str); } + /// \endcond + + /** + * Convert a pair of strings to latitude and longitude. + * + * @param[in] dmsa first string. + * @param[in] dmsb second string. + * @param[out] lat latitude. + * @param[out] lon longitude reduced to the range [−180°, + * 180°). + * @param[in] swaplatlong if true assume longitude is given before latitude + * in the absence of hemisphere designators (default false). + * @exception GeographicErr if \e dmsa or \e dmsb is malformed. + * @exception GeographicErr if \e dmsa and \e dmsb are both interpreted as + * latitudes. + * @exception GeographicErr if \e dmsa and \e dmsb are both interpreted as + * longitudes. + * @exception GeographicErr if decoded latitude is not in [−90°, + * 90°]. + * @exception GeographicErr if decoded longitude is not in + * [−540°, 540°). + * + * By default, the \e lat (resp., \e lon) is assigned to the results of + * decoding \e dmsa (resp., \e dmsb). However this is overridden if either + * \e dmsa or \e dmsb contain a latitude or longitude hemisphere designator + * (N, S, E, W). If an exception is thrown, \e lat and \e lon are + * unchanged. + **********************************************************************/ + static void DecodeLatLon(const std::string& dmsa, const std::string& dmsb, + real& lat, real& lon, bool swaplatlong = false); + + /** + * Convert a string to an angle in degrees. + * + * @param[in] angstr input string. + * @exception GeographicErr if \e angstr is malformed. + * @exception GeographicErr if \e angstr includes a hemisphere designator. + * @return angle (degrees) + * + * No hemisphere designator is allowed and no check is done on the range of + * the result. + **********************************************************************/ + static Math::real DecodeAngle(const std::string& angstr); + + /** + * Convert a string to an azimuth in degrees. + * + * @param[in] azistr input string. + * @exception GeographicErr if \e azistr is malformed. + * @exception GeographicErr if \e azistr includes a N/S designator. + * @exception GeographicErr if decoded azimuth is not in + * [−540°, 540°). + * @return azimuth (degrees) reduced to the range [−180°, + * 180°). + * + * A hemisphere designator E/W can be used; the result is multiplied by + * −1 if W is present. + **********************************************************************/ + static Math::real DecodeAzimuth(const std::string& azistr); + + /** + * Convert angle (in degrees) into a DMS string (using d, ', and "). + * + * @param[in] angle input angle (degrees) + * @param[in] trailing DMS::component value indicating the trailing units + * on the string and this is given as a decimal number if necessary. + * @param[in] prec the number of digits after the decimal point for the + * trailing component. + * @param[in] ind DMS::flag value indicated additional formatting. + * @param[in] dmssep if non-null, use as the DMS separator character + * (instead of d, ', " delimiters). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return formatted string + * + * The interpretation of \e ind is as follows: + * - ind == DMS::NONE, signed result no leading zeros on degrees except in + * the units place, e.g., -8d03'. + * - ind == DMS::LATITUDE, trailing N or S hemisphere designator, no sign, + * pad degrees to 2 digits, e.g., 08d03'S. + * - ind == DMS::LONGITUDE, trailing E or W hemisphere designator, no + * sign, pad degrees to 3 digits, e.g., 008d03'W. + * - ind == DMS::AZIMUTH, convert to the range [0, 360°), no + * sign, pad degrees to 3 digits, , e.g., 351d57'. + * . + * The integer parts of the minutes and seconds components are always given + * with 2 digits. + **********************************************************************/ + static std::string Encode(real angle, component trailing, unsigned prec, + flag ind = NONE, char dmssep = char(0)); + + /** + * Convert angle into a DMS string (using d, ', and ") selecting the + * trailing component based on the precision. + * + * @param[in] angle input angle (degrees) + * @param[in] prec the precision relative to 1 degree. + * @param[in] ind DMS::flag value indicated additional formatting. + * @param[in] dmssep if non-null, use as the DMS separator character + * (instead of d, ', " delimiters). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return formatted string + * + * \e prec indicates the precision relative to 1 degree, e.g., \e prec = 3 + * gives a result accurate to 0.1' and \e prec = 4 gives a result accurate + * to 1". \e ind is interpreted as in DMS::Encode with the additional + * facility that DMS::NUMBER represents \e angle as a number in fixed + * format with precision \e prec. + **********************************************************************/ + static std::string Encode(real angle, unsigned prec, flag ind = NONE, + char dmssep = char(0)) { + return ind == NUMBER ? Utility::str(angle, int(prec)) : + Encode(angle, + prec < 2 ? DEGREE : (prec < 4 ? MINUTE : SECOND), + prec < 2 ? prec : (prec < 4 ? prec - 2 : prec - 4), + ind, dmssep); + } + + /** + * Split angle into degrees and minutes + * + * @param[in] ang angle (degrees) + * @param[out] d degrees (an integer returned as a real) + * @param[out] m arc minutes. + **********************************************************************/ + static void Encode(real ang, real& d, real& m) throw() { + d = int(ang); m = 60 * (ang - d); + } + + /** + * Split angle into degrees and minutes and seconds. + * + * @param[in] ang angle (degrees) + * @param[out] d degrees (an integer returned as a real) + * @param[out] m arc minutes (an integer returned as a real) + * @param[out] s arc seconds. + **********************************************************************/ + static void Encode(real ang, real& d, real& m, real& s) throw() { + d = int(ang); ang = 60 * (ang - d); + m = int(ang); s = 60 * (ang - m); + } + + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_DMS_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Ellipsoid.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Ellipsoid.hpp new file mode 100644 index 000000000..72e0c6d86 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Ellipsoid.hpp @@ -0,0 +1,537 @@ +/** + * \file Ellipsoid.hpp + * \brief Header for GeographicLib::Ellipsoid class + * + * Copyright (c) Charles Karney (2012) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_ELLIPSOID_HPP) +#define GEOGRAPHICLIB_ELLIPSOID_HPP 1 + +#include +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief Properties of an ellipsoid + * + * This class returns various properties of the ellipsoid and converts + * between various types of latitudes. The latitude conversions are also + * possible using the various projections supported by %GeographicLib; but + * Ellipsoid provides more direct access (sometimes using private functions + * of the projection classes). Ellipsoid::RectifyingLatitude, + * Ellipsoid::InverseRectifyingLatitude, and Ellipsoid::MeridianDistance + * provide functionality which can be provided by the Geodesic class. + * However Geodesic uses a series approximation (valid for abs \e f < 1/150), + * whereas Ellipsoid computes these quantities using EllipticFunction which + * provides accurate results even when \e f is large. Use of this class + * should be limited to −3 < \e f < 3/4 (i.e., 1/4 < b/a < 4). + * + * Example of use: + * \include example-Ellipsoid.cpp + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT Ellipsoid { + private: + typedef Math::real real; + static const int numit_ = 10; + static const real stol_; + real _a, _f, _f1, _f12, _e2, _e12, _n, _b; + TransverseMercator _tm; + EllipticFunction _ell; + AlbersEqualArea _au; + static real tand(real x) throw() { + return + std::abs(x) == real(90) ? (x < 0 ? + - TransverseMercator::overflow_ + : TransverseMercator::overflow_) : + std::tan(x * Math::degree()); + } + static real atand(real x) throw() + { return std::atan(x) / Math::degree(); } + + public: + /** \name Constructor + **********************************************************************/ + ///@{ + + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @exception GeographicErr if \e a or (1 − \e f ) \e a is not + * positive. + **********************************************************************/ + Ellipsoid(real a, real f); + ///@} + + /** \name %Ellipsoid dimensions. + **********************************************************************/ + ///@{ + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _a; } + + /** + * @return \e b the polar semi-axis (meters). + **********************************************************************/ + Math::real MinorRadius() const throw() { return _b; } + + /** + * @return \e L the distance between the equator and a pole along a + * meridian (meters). For a sphere \e L = (π/2) \e a. The radius + * of a sphere with the same meridian length is \e L / (π/2). + **********************************************************************/ + Math::real QuarterMeridian() const throw(); + + /** + * @return \e A the total area of the ellipsoid (meters2). For + * a sphere \e A = 4π a2. The radius of a sphere + * with the same area is sqrt(\e A / (4π)). + **********************************************************************/ + Math::real Area() const throw(); + + /** + * @return \e V the total volume of the ellipsoid (meters3). + * For a sphere \e V = (4π / 3) a3. The radius of + * a sphere with the same volume is cbrt(\e V / (4π/3)). + **********************************************************************/ + Math::real Volume() const throw() + { return (4 * Math::pi()) * Math::sq(_a) * _b / 3; } + ///@} + + /** \name %Ellipsoid shape + **********************************************************************/ + ///@{ + + /** + * @return \e f = (\e a − \e b) / \e a, the flattening of the + * ellipsoid. This is the value used in the constructor. This is zero, + * positive, or negative for a sphere, oblate ellipsoid, or prolate + * ellipsoid. + **********************************************************************/ + Math::real Flattening() const throw() { return _f; } + + /** + * @return \e f ' = (\e a − \e b) / \e b, the second flattening of + * the ellipsoid. This is zero, positive, or negative for a sphere, + * oblate ellipsoid, or prolate ellipsoid. + **********************************************************************/ + Math::real SecondFlattening() const throw() { return _f / (1 - _f); } + + /** + * @return \e n = (\e a − \e b) / (\e a + \e b), the third flattening + * of the ellipsoid. This is zero, positive, or negative for a sphere, + * oblate ellipsoid, or prolate ellipsoid. + **********************************************************************/ + Math::real ThirdFlattening() const throw() { return _n; } + + /** + * @return e2 = (a2 − + * b2) / a2, the eccentricity squared + * of the ellipsoid. This is zero, positive, or negative for a sphere, + * oblate ellipsoid, or prolate ellipsoid. + **********************************************************************/ + Math::real EccentricitySq() const throw() { return _e2; } + + /** + * @return e' 2 = (a2 − + * b2) / b2, the second eccentricity + * squared of the ellipsoid. This is zero, positive, or negative for a + * sphere, oblate ellipsoid, or prolate ellipsoid. + **********************************************************************/ + Math::real SecondEccentricitySq() const throw() { return _e12; } + + /** + * @return e'' 2 = (a2 − + * b2) / (a2 + b2), + * the third eccentricity squared of the ellipsoid. This is zero, + * positive, or negative for a sphere, oblate ellipsoid, or prolate + * ellipsoid. + **********************************************************************/ + Math::real ThirdEccentricitySq() const throw() { return _e2 / (2 - _e2); } + ///@} + + /** \name Latitude conversion. + **********************************************************************/ + ///@{ + + /** + * @param[in] phi the geographic latitude (degrees). + * @return β the parametric latitude (degrees). + * + * The geographic latitude, φ, is the angle beween the equatorial + * plane and a vector normal to the surface of the ellipsoid. + * + * The parametric latitude (also called the reduced latitude), β, + * allows the cartesian coordinated of a meridian to be expressed + * conveniently in parametric form as + * - \e R = \e a cos β + * - \e Z = \e b sin β + * . + * where \e a and \e b are the equatorial radius and the polar semi-axis. + * For a sphere β = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * β lies in [−90°, 90°]. + **********************************************************************/ + Math::real ParametricLatitude(real phi) const throw(); + + /** + * @param[in] beta the parametric latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * β must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + Math::real InverseParametricLatitude(real beta) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return θ the geocentric latitude (degrees). + * + * The geocentric latitude, θ, is the angle beween the equatorial + * plane and a line between the center of the ellipsoid and a point on the + * ellipsoid. For a sphere θ = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * θ lies in [−90°, 90°]. + **********************************************************************/ + Math::real GeocentricLatitude(real phi) const throw(); + + /** + * @param[in] theta the geocentric latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * θ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + Math::real InverseGeocentricLatitude(real theta) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return μ the rectifying latitude (degrees). + * + * The rectifying latitude, μ, has the property that the distance along + * a meridian of the ellipsoid between two points with rectifying latitudes + * μ1 and μ2 is equal to + * (μ2 - μ1) \e L / 90°, + * where \e L = QuarterMeridian(). For a sphere μ = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * μ lies in [−90°, 90°]. + **********************************************************************/ + Math::real RectifyingLatitude(real phi) const throw(); + + /** + * @param[in] mu the rectifying latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * μ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + Math::real InverseRectifyingLatitude(real mu) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return ξ the authalic latitude (degrees). + * + * The authalic latitude, ξ, has the property that the area of the + * ellipsoid between two circles with authalic latitudes + * ξ1 and ξ2 is equal to (sin + * ξ2 - sin ξ1) \e A / 2, where \e A + * = Area(). For a sphere ξ = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * ξ lies in [−90°, 90°]. + **********************************************************************/ + Math::real AuthalicLatitude(real phi) const throw(); + + /** + * @param[in] xi the authalic latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * ξ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + Math::real InverseAuthalicLatitude(real xi) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return χ the conformal latitude (degrees). + * + * The conformal latitude, χ, gives the mapping of the ellipsoid to a + * sphere which which is conformal (angles are preserved) and in which the + * equator of the ellipsoid maps to the equator of the sphere. For a + * sphere χ = φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * χ lies in [−90°, 90°]. + **********************************************************************/ + Math::real ConformalLatitude(real phi) const throw(); + + /** + * @param[in] chi the conformal latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * χ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. The returned value + * φ lies in [−90°, 90°]. + **********************************************************************/ + Math::real InverseConformalLatitude(real chi) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return ψ the isometric latitude (degrees). + * + * The isometric latitude gives the mapping of the ellipsoid to a plane + * which which is conformal (angles are preserved) and in which the equator + * of the ellipsoid maps to a straight line of constant scale; this mapping + * defines the Mercator projection. For a sphere ψ = + * sinh−1 tan φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + Math::real IsometricLatitude(real phi) const throw(); + + /** + * @param[in] psi the isometric latitude (degrees). + * @return φ the geographic latitude (degrees). + * + * The returned value φ lies in [−90°, 90°]. + **********************************************************************/ + Math::real InverseIsometricLatitude(real psi) const throw(); + ///@} + + /** \name Other quantities. + **********************************************************************/ + ///@{ + + /** + * @param[in] phi the geographic latitude (degrees). + * @return \e R = \e a cos β the radius of a circle of latitude + * φ (meters). \e R (π/180°) gives meters per degree + * longitude measured along a circle of latitude. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + Math::real CircleRadius(real phi) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return \e Z = \e b sin β the distance of a circle of latitude + * φ from the equator measured parallel to the ellipsoid axis + * (meters). + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + Math::real CircleHeight(real phi) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return \e s the distance along a meridian + * between the equator and a point of latitude φ (meters). \e s is + * given by \e s = μ \e L / 90°, where \e L = + * QuarterMeridian()). + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + Math::real MeridianDistance(real phi) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return ρ the meridional radius of curvature of the ellipsoid at + * latitude φ (meters); this is the curvature of the meridian. \e + * rho is given by ρ = (180°/π) d\e s / dφ, + * where \e s = MeridianDistance(); thus ρ (π/180°) + * gives meters per degree latitude measured along a meridian. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + Math::real MeridionalCurvatureRadius(real phi) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @return ν the transverse radius of curvature of the ellipsoid at + * latitude φ (meters); this is the curvature of a curve on the + * ellipsoid which also lies in a plane perpendicular to the ellipsoid + * and to the meridian. ν is related to \e R = CircleRadius() by \e + * R = ν cos φ. + * + * φ must lie in the range [−90°, 90°]; the + * result is undefined if this condition does not hold. + **********************************************************************/ + Math::real TransverseCurvatureRadius(real phi) const throw(); + + /** + * @param[in] phi the geographic latitude (degrees). + * @param[in] azi the angle between the meridian and the normal section + * (degrees). + * @return the radius of curvature of the ellipsoid in the normal + * section at latitude φ inclined at an angle \e azi to the + * meridian (meters). + * + * φ must lie in the range [−90°, 90°] and \e + * azi must lie in the range [−540°, 540°); the + * result is undefined if either of conditions does not hold. + **********************************************************************/ + Math::real NormalCurvatureRadius(real phi, real azi) const throw(); + ///@} + + /** \name Eccentricity conversions. + **********************************************************************/ + ///@{ + + /** + * @param[in] fp = \e f ' = (\e a − \e b) / \e b, the second + * flattening. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * \e f ' should lie in (−1, ∞). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static Math::real SecondFlatteningToFlattening(real fp) throw() + { return fp / (1 + fp); } + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return \e f ' = (\e a − \e b) / \e b, the second flattening. + * + * \e f should lie in (−∞, 1). + * The returned value \e f ' lies in (−1, ∞). + **********************************************************************/ + static Math::real FlatteningToSecondFlattening(real f) throw() + { return f / (1 - f); } + + /** + * @param[in] n = (\e a − \e b) / (\e a + \e b), the third + * flattening. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * \e n should lie in (−1, 1). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static Math::real ThirdFlatteningToFlattening(real n) throw() + { return 2 * n / (1 + n); } + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return \e n = (\e a − \e b) / (\e a + \e b), the third + * flattening. + * + * \e f should lie in (−∞, 1). + * The returned value \e n lies in (−1, 1). + **********************************************************************/ + static Math::real FlatteningToThirdFlattening(real f) throw() + { return f / (2 - f); } + + /** + * @param[in] e2 = e2 = (a2 − + * b2) / a2, the eccentricity + * squared. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * e2 should lie in (−∞, 1). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static Math::real EccentricitySqToFlattening(real e2) throw() + { return e2 / (std::sqrt(1 - e2) + 1); } + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return e2 = (a2 − + * b2) / a2, the eccentricity + * squared. + * + * \e f should lie in (−∞, 1). + * The returned value e2 lies in (−∞, 1). + **********************************************************************/ + static Math::real FlatteningToEccentricitySq(real f) throw() + { return f * (2 - f); } + + /** + * @param[in] ep2 = e' 2 = (a2 − + * b2) / b2, the second eccentricity + * squared. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * e' 2 should lie in (−1, ∞). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static Math::real SecondEccentricitySqToFlattening(real ep2) throw() + { return ep2 / (std::sqrt(1 + ep2) + 1 + ep2); } + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return e' 2 = (a2 − + * b2) / b2, the second eccentricity + * squared. + * + * \e f should lie in (−∞, 1). + * The returned value e' 2 lies in (−1, ∞). + **********************************************************************/ + static Math::real FlatteningToSecondEccentricitySq(real f) throw() + { return f * (2 - f) / Math::sq(1 - f); } + + /** + * @param[in] epp2 = e'' 2 = (a2 + * − b2) / (a2 + + * b2), the third eccentricity squared. + * @return \e f = (\e a − \e b) / \e a, the flattening. + * + * e'' 2 should lie in (−1, 1). + * The returned value \e f lies in (−∞, 1). + **********************************************************************/ + static Math::real ThirdEccentricitySqToFlattening(real epp2) throw() + { return 2 * epp2 / (sqrt((1 - epp2) * (1 + epp2)) + 1 + epp2); } + + /** + * @param[in] f = (\e a − \e b) / \e a, the flattening. + * @return e'' 2 = (a2 − + * b2) / (a2 + b2), + * the third eccentricity squared. + * + * \e f should lie in (−∞, 1). + * The returned value e'' 2 lies in (−1, 1). + **********************************************************************/ + static Math::real FlatteningToThirdEccentricitySq(real f) throw() + { return f * (2 - f) / (1 + Math::sq(1 - f)); } + + ///@} + + /** + * A global instantiation of Ellipsoid with the parameters for the WGS84 + * ellipsoid. + **********************************************************************/ + static const Ellipsoid WGS84; + + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_ELLIPSOID_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/EllipticFunction.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/EllipticFunction.hpp new file mode 100644 index 000000000..802b6e7cc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/EllipticFunction.hpp @@ -0,0 +1,709 @@ +/** + * \file EllipticFunction.hpp + * \brief Header for GeographicLib::EllipticFunction class + * + * Copyright (c) Charles Karney (2008-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_ELLIPTICFUNCTION_HPP) +#define GEOGRAPHICLIB_ELLIPTICFUNCTION_HPP 1 + +#include + +namespace GeographicLib { + + /** + * \brief Elliptic integrals and functions + * + * This provides the elliptic functions and integrals needed for Ellipsoid, + * GeodesicExact, and TransverseMercatorExact. Two categories of function + * are provided: + * - \e static functions to compute symmetric elliptic integrals + * (http://dlmf.nist.gov/19.16.i) + * - \e member functions to compute Legrendre's elliptic + * integrals (http://dlmf.nist.gov/19.2.ii) and the + * Jacobi elliptic functions (http://dlmf.nist.gov/22.2). + * . + * In the latter case, an object is constructed giving the modulus \e k (and + * optionally the parameter α2). The modulus is always + * passed as its square k2 which allows \e k to be pure + * imaginary (k2 < 0). (Confusingly, Abramowitz and + * Stegun call \e m = k2 the "parameter" and \e n = + * α2 the "characteristic".) + * + * In geodesic applications, it is convenient to separate the incomplete + * integrals into secular and periodic components, e.g., + * \f[ + * E(\phi, k) = (2 E(\phi) / \pi) [ \phi + \delta E(\phi, k) ] + * \f] + * where δ\e E(φ, \e k) is an odd periodic function with period + * π. + * + * The computation of the elliptic integrals uses the algorithms given in + * - B. C. Carlson, + * Computation of real or + * complex elliptic integrals, Numerical Algorithms 10, 13--26 (1995) + * . + * with the additional optimizations given in http://dlmf.nist.gov/19.36.i. + * The computation of the Jacobi elliptic functions uses the algorithm given + * in + * - R. Bulirsch, + * Numerical Calculation of + * Elliptic Integrals and Elliptic Functions, Numericshe Mathematik 7, + * 78--90 (1965). + * . + * The notation follows http://dlmf.nist.gov/19 and http://dlmf.nist.gov/22 + * + * Example of use: + * \include example-EllipticFunction.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT EllipticFunction { + private: + typedef Math::real real; + static const real tol_; + static const real tolRF_; + static const real tolRD_; + static const real tolRG0_; + static const real tolJAC_; + enum { num_ = 13 }; // Max depth required for sncndn. Probably 5 is enough. + real _k2, _kp2, _alpha2, _alphap2, _eps; + mutable bool _init; + mutable real _Kc, _Ec, _Dc, _Pic, _Gc, _Hc; + bool Init() const throw(); + public: + /** \name Constructor + **********************************************************************/ + ///@{ + /** + * Constructor specifying the modulus and parameter. + * + * @param[in] k2 the square of the modulus k2. + * k2 must lie in (-∞, 1). (No checking is + * done.) + * @param[in] alpha2 the parameter α2. + * α2 must lie in (-∞, 1). (No checking is done.) + * + * If only elliptic integrals of the first and second kinds are needed, + * then set α2 = 0 (the default value); in this case, we + * have Π(φ, 0, \e k) = \e F(φ, \e k), \e G(φ, 0, \e k) = \e + * E(φ, \e k), and \e H(φ, 0, \e k) = \e F(φ, \e k) - \e + * D(φ, \e k). + **********************************************************************/ + EllipticFunction(real k2 = 0, real alpha2 = 0) throw(); + + /** + * Constructor specifying the modulus and parameter and their complements. + * + * @param[in] k2 the square of the modulus k2. + * k2 must lie in (-∞, 1). (No checking is + * done.) + * @param[in] alpha2 the parameter α2. + * α2 must lie in (-∞, 1). (No checking is done.) + * @param[in] kp2 the complementary modulus squared k'2 = + * 1 − k2. + * @param[in] alphap2 the complementary parameter α'2 = 1 + * − α2. + * + * The arguments must satisfy \e k2 + \e kp2 = 1 and \e alpha2 + \e alphap2 + * = 1. (No checking is done that these conditions are met.) This + * constructor is provided to enable accuracy to be maintained, e.g., when + * \e k is very close to unity. + **********************************************************************/ + EllipticFunction(real k2, real alpha2, real kp2, real alphap2) throw(); + + /** + * Reset the modulus and parameter. + * + * @param[in] k2 the new value of square of the modulus + * k2 which must lie in (-∞, 1). (No checking is + * done.) + * @param[in] alpha2 the new value of parameter α2. + * α2 must lie in (-∞, 1). (No checking is done.) + **********************************************************************/ + void Reset(real k2 = 0, real alpha2 = 0) throw() + { Reset(k2, alpha2, 1 - k2, 1 - alpha2); } + + /** + * Reset the modulus and parameter supplying also their complements. + * + * @param[in] k2 the square of the modulus k2. + * k2 must lie in (-∞, 1). (No checking is + * done.) + * @param[in] alpha2 the parameter α2. + * α2 must lie in (-∞, 1). (No checking is done.) + * @param[in] kp2 the complementary modulus squared k'2 = + * 1 − k2. + * @param[in] alphap2 the complementary parameter α'2 = 1 + * − α2. + * + * The arguments must satisfy \e k2 + \e kp2 = 1 and \e alpha2 + \e alphap2 + * = 1. (No checking is done that these conditions are met.) This + * constructor is provided to enable accuracy to be maintained, e.g., when + * is very small. + **********************************************************************/ + void Reset(real k2, real alpha2, real kp2, real alphap2) throw(); + + ///@} + + /** \name Inspector functions. + **********************************************************************/ + ///@{ + /** + * @return the square of the modulus k2. + **********************************************************************/ + Math::real k2() const throw() { return _k2; } + + /** + * @return the square of the complementary modulus k'2 = + * 1 − k2. + **********************************************************************/ + Math::real kp2() const throw() { return _kp2; } + + /** + * @return the parameter α2. + **********************************************************************/ + Math::real alpha2() const throw() { return _alpha2; } + + /** + * @return the complementary parameter α'2 = 1 − + * α2. + **********************************************************************/ + Math::real alphap2() const throw() { return _alphap2; } + ///@} + + /// \cond SKIP + /** + * @return the square of the modulus k2. + * + * DEPRECATED, use k2() instead. + **********************************************************************/ + Math::real m() const throw() { return _k2; } + /** + * @return the square of the complementary modulus k'2 = + * 1 − k2. + * + * DEPRECATED, use kp2() instead. + **********************************************************************/ + Math::real m1() const throw() { return _kp2; } + /// \endcond + + /** \name Complete elliptic integrals. + **********************************************************************/ + ///@{ + /** + * The complete integral of the first kind. + * + * @return \e K(\e k). + * + * \e K(\e k) is defined in http://dlmf.nist.gov/19.2.E4 + * \f[ + * K(k) = \int_0^{\pi/2} \frac1{\sqrt{1-k^2\sin^2\phi}}\,d\phi. + * \f] + **********************************************************************/ + Math::real K() const throw() { _init || Init(); return _Kc; } + + /** + * The complete integral of the second kind. + * + * @return \e E(\e k) + * + * \e E(\e k) is defined in http://dlmf.nist.gov/19.2.E5 + * \f[ + * E(k) = \int_0^{\pi/2} \sqrt{1-k^2\sin^2\phi}\,d\phi. + * \f] + **********************************************************************/ + Math::real E() const throw() { _init || Init(); return _Ec; } + + /** + * Jahnke's complete integral. + * + * @return \e D(\e k). + * + * \e D(\e k) is defined in http://dlmf.nist.gov/19.2.E6 + * \f[ + * D(k) = \int_0^{\pi/2} \frac{\sin^2\phi}{\sqrt{1-k^2\sin^2\phi}}\,d\phi. + * \f] + **********************************************************************/ + Math::real D() const throw() { _init || Init(); return _Dc; } + + /** + * The difference between the complete integrals of the first and second + * kinds. + * + * @return \e K(\e k) − \e E(\e k). + **********************************************************************/ + Math::real KE() const throw() { _init || Init(); return _k2 * _Dc; } + + /** + * The complete integral of the third kind. + * + * @return Π(α2, \e k) + * + * Π(α2, \e k) is defined in + * http://dlmf.nist.gov/19.2.E7 + * \f[ + * \Pi(\alpha^2, k) = \int_0^{\pi/2} + * \frac1{\sqrt{1-k^2\sin^2\phi}(1 - \alpha^2\sin^2\phi_)}\,d\phi. + * \f] + **********************************************************************/ + Math::real Pi() const throw() { _init || Init(); return _Pic; } + + /** + * Legendre's complete geodesic longitude integral. + * + * @return \e G(α2, \e k) + * + * \e G(α2, \e k) is given by + * \f[ + * G(\alpha^2, k) = \int_0^{\pi/2} + * \frac{\sqrt{1-k^2\sin^2\phi}}{1 - \alpha^2\sin^2\phi}\,d\phi. + * \f] + **********************************************************************/ + Math::real G() const throw() { _init || Init(); return _Gc; } + + /** + * Cayley's complete geodesic longitude difference integral. + * + * @return \e H(α2, \e k) + * + * \e H(α2, \e k) is given by + * \f[ + * H(\alpha^2, k) = \int_0^{\pi/2} + * \frac{\cos^2\phi}{(1-\alpha^2\sin^2\phi)\sqrt{1-k^2\sin^2\phi}} + * \,d\phi. + * \f] + **********************************************************************/ + Math::real H() const throw() { _init || Init(); return _Hc; } + ///@} + + /** \name Incomplete elliptic integrals. + **********************************************************************/ + ///@{ + /** + * The incomplete integral of the first kind. + * + * @param[in] phi + * @return \e F(φ, \e k). + * + * \e F(φ, \e k) is defined in http://dlmf.nist.gov/19.2.E4 + * \f[ + * F(\phi, k) = \int_0^\phi \frac1{\sqrt{1-k^2\sin^2\theta}}\,d\theta. + * \f] + **********************************************************************/ + Math::real F(real phi) const throw(); + + /** + * The incomplete integral of the second kind. + * + * @param[in] phi + * @return \e E(φ, \e k). + * + * \e E(φ, \e k) is defined in http://dlmf.nist.gov/19.2.E5 + * \f[ + * E(\phi, k) = \int_0^\phi \sqrt{1-k^2\sin^2\theta}\,d\theta. + * \f] + **********************************************************************/ + Math::real E(real phi) const throw(); + + /** + * The incomplete integral of the second kind with the argument given in + * degrees. + * + * @param[in] ang in degrees. + * @return \e E(π ang/180, \e k). + **********************************************************************/ + Math::real Ed(real ang) const throw(); + + /** + * The inverse of the incomplete integral of the second kind. + * + * @param[in] x + * @return φ = E−1(\e x, \e k); i.e., the + * solution of such that \e E(φ, \e k) = \e x. + **********************************************************************/ + Math::real Einv(real x) const throw(); + + /** + * The incomplete integral of the third kind. + * + * @param[in] phi + * @return Π(φ, α2, \e k). + * + * Π(φ, α2, \e k) is defined in + * http://dlmf.nist.gov/19.2.E7 + * \f[ + * \Pi(\phi, \alpha^2, k) = \int_0^\phi + * \frac1{\sqrt{1-k^2\sin^2\theta}(1 - \alpha^2\sin^2\theta_)}\,d\theta. + * \f] + **********************************************************************/ + Math::real Pi(real phi) const throw(); + + /** + * Jahnke's incomplete elliptic integral. + * + * @param[in] phi + * @return \e D(φ, \e k). + * + * \e D(φ, \e k) is defined in http://dlmf.nist.gov/19.2.E4 + * \f[ + * D(\phi, k) = \int_0^\phi + * \frac{\sin^2\theta}{\sqrt{1-k^2\sin^2\theta}}\,d\theta. + * \f] + **********************************************************************/ + Math::real D(real phi) const throw(); + + /** + * Legendre's geodesic longitude integral. + * + * @param[in] phi + * @return \e G(φ, α2, \e k). + * + * \e G(φ, α2, \e k) is defined by + * \f[ + * \begin{aligned} + * G(\phi, \alpha^2, k) &= + * \frac{k^2}{\alpha^2} F(\phi, k) + + * \biggl(1 - \frac{k^2}{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\ + * &= \int_0^\phi + * \frac{\sqrt{1-k^2\sin^2\theta}}{1 - \alpha^2\sin^2\theta}\,d\theta. + * \end{aligned} + * \f] + * + * Legendre expresses the longitude of a point on the geodesic in terms of + * this combination of elliptic integrals in Exercices de Calcul + * Intégral, Vol. 1 (1811), p. 181, + * http://books.google.com/books?id=riIOAAAAQAAJ&pg=PA181. + * + * See \ref geodellip for the expression for the longitude in terms of this + * function. + **********************************************************************/ + Math::real G(real phi) const throw(); + + /** + * Cayley's geodesic longitude difference integral. + * + * @param[in] phi + * @return \e H(φ, α2, \e k). + * + * \e H(φ, α2, \e k) is defined by + * \f[ + * \begin{aligned} + * H(\phi, \alpha^2, k) &= + * \frac1{\alpha^2} F(\phi, k) + + * \biggl(1 - \frac1{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\ + * &= \int_0^\phi + * \frac{\cos^2\theta}{(1-\alpha^2\sin^2\theta)\sqrt{1-k^2\sin^2\theta}} + * \,d\theta. + * \end{aligned} + * \f] + * + * Cayley expresses the longitude difference of a point on the geodesic in + * terms of this combination of elliptic integrals in Phil. Mag. 40 + * (1870), p. 333, http://books.google.com/books?id=Zk0wAAAAIAAJ&pg=PA333. + * + * See \ref geodellip for the expression for the longitude in terms of this + * function. + **********************************************************************/ + Math::real H(real phi) const throw(); + ///@} + + /** \name Incomplete integrals in terms of Jacobi elliptic functions. + **********************************************************************/ + /** + * The incomplete integral of the first kind in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e F(φ, \e k) as though φ ∈ (−π, π]. + **********************************************************************/ + Math::real F(real sn, real cn, real dn) const throw(); + + /** + * The incomplete integral of the second kind in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e E(φ, \e k) as though φ ∈ (−π, π]. + **********************************************************************/ + Math::real E(real sn, real cn, real dn) const throw(); + + /** + * The incomplete integral of the third kind in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return Π(φ, α2, \e k) as though φ ∈ + * (−π, π]. + **********************************************************************/ + Math::real Pi(real sn, real cn, real dn) const throw(); + + /** + * Jahnke's incomplete elliptic integral in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e D(φ, \e k) as though φ ∈ (−π, π]. + **********************************************************************/ + Math::real D(real sn, real cn, real dn) const throw(); + + /** + * Legendre's geodesic longitude integral in terms of Jacobi elliptic + * functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e G(φ, α2, \e k) as though φ ∈ + * (−π, π]. + **********************************************************************/ + Math::real G(real sn, real cn, real dn) const throw(); + + /** + * Cayley's geodesic longitude difference integral in terms of Jacobi + * elliptic functions. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return \e H(φ, α2, \e k) as though φ ∈ + * (−π, π]. + **********************************************************************/ + Math::real H(real sn, real cn, real dn) const throw(); + ///@} + + /** \name Periodic versions of incomplete elliptic integrals. + **********************************************************************/ + ///@{ + /** + * The periodic incomplete integral of the first kind. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e F(φ, \e k) / (2 \e K(\e k)) - + * φ + **********************************************************************/ + Math::real deltaF(real sn, real cn, real dn) const throw(); + + /** + * The periodic incomplete integral of the second kind. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e E(φ, \e k) / (2 \e E(\e k)) - + * φ + **********************************************************************/ + Math::real deltaE(real sn, real cn, real dn) const throw(); + + /** + * The periodic inverse of the incomplete integral of the second kind. + * + * @param[in] stau = sinτ + * @param[in] ctau = sinτ + * @return the periodic function E−1(τ (2 \e + * E(\e k)/π), \e k) - τ + **********************************************************************/ + Math::real deltaEinv(real stau, real ctau) const throw(); + + /** + * The periodic incomplete integral of the third kind. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π Π(φ, \e k) / (2 Π(\e k)) - + * φ + **********************************************************************/ + Math::real deltaPi(real sn, real cn, real dn) const throw(); + + /** + * The periodic Jahnke's incomplete elliptic integral. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e D(φ, \e k) / (2 \e D(\e k)) - + * φ + **********************************************************************/ + Math::real deltaD(real sn, real cn, real dn) const throw(); + + /** + * Legendre's periodic geodesic longitude integral. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e G(φ, \e k) / (2 \e G(\e k)) - + * φ + **********************************************************************/ + Math::real deltaG(real sn, real cn, real dn) const throw(); + + /** + * Cayley's periodic geodesic longitude difference integral. + * + * @param[in] sn = sinφ + * @param[in] cn = cosφ + * @param[in] dn = sqrt(1 − k2 + * sin2φ) + * @return the periodic function π \e H(φ, \e k) / (2 \e H(\e k)) - + * φ + **********************************************************************/ + Math::real deltaH(real sn, real cn, real dn) const throw(); + ///@} + + /** \name Elliptic functions. + **********************************************************************/ + ///@{ + /** + * The Jacobi elliptic functions. + * + * @param[in] x the argument. + * @param[out] sn sn(\e x, \e k). + * @param[out] cn cn(\e x, \e k). + * @param[out] dn dn(\e x, \e k). + **********************************************************************/ + void sncndn(real x, real& sn, real& cn, real& dn) const throw(); + + /** + * The Δ amplitude function. + * + * @param[in] sn sinφ + * @param[in] cn cosφ + * @return Δ = sqrt(1 − k2 + * sin2φ) + **********************************************************************/ + Math::real Delta(real sn, real cn) const throw() + { return std::sqrt(_k2 < 0 ? 1 - _k2 * sn*sn : _kp2 + _k2 * cn*cn); } + ///@} + + /** \name Symmetric elliptic integrals. + **********************************************************************/ + ///@{ + /** + * Symmetric integral of the first kind RF. + * + * @param[in] x + * @param[in] y + * @param[in] z + * @return RF(\e x, \e y, \e z) + * + * RF is defined in http://dlmf.nist.gov/19.16.E1 + * \f[ R_F(x, y, z) = \frac12 + * \int_0^\infty\frac1{\sqrt{(t + x) (t + y) (t + z)}}\, dt \f] + * If one of the arguments is zero, it is more efficient to call the + * two-argument version of this function with the non-zero arguments. + **********************************************************************/ + static real RF(real x, real y, real z) throw(); + + /** + * Complete symmetric integral of the first kind, RF with + * one argument zero. + * + * @param[in] x + * @param[in] y + * @return RF(\e x, \e y, 0) + **********************************************************************/ + static real RF(real x, real y) throw(); + + /** + * Degenerate symmetric integral of the first kind RC. + * + * @param[in] x + * @param[in] y + * @return RC(\e x, \e y) = RF(\e x, \e + * y, \e y) + * + * RC is defined in http://dlmf.nist.gov/19.2.E17 + * \f[ R_C(x, y) = \frac12 + * \int_0^\infty\frac1{\sqrt{t + x}(t + y)}\,dt \f] + **********************************************************************/ + static real RC(real x, real y) throw(); + + /** + * Symmetric integral of the second kind RG. + * + * @param[in] x + * @param[in] y + * @param[in] z + * @return RG(\e x, \e y, \e z) + * + * RG is defined in Carlson, eq 1.5 + * \f[ R_G(x, y, z) = \frac14 + * \int_0^\infty[(t + x) (t + y) (t + z)]^{-1/2} + * \biggl( + * \frac x{t + x} + \frac y{t + y} + \frac z{t + z} + * \biggr)t\,dt \f] + * See also http://dlmf.nist.gov/19.16.E3. + * If one of the arguments is zero, it is more efficient to call the + * two-argument version of this function with the non-zero arguments. + **********************************************************************/ + static real RG(real x, real y, real z) throw(); + + /** + * Complete symmetric integral of the second kind, RG + * with one argument zero. + * + * @param[in] x + * @param[in] y + * @return RG(\e x, \e y, 0) + **********************************************************************/ + static real RG(real x, real y) throw(); + + /** + * Symmetric integral of the third kind RJ. + * + * @param[in] x + * @param[in] y + * @param[in] z + * @param[in] p + * @return RJ(\e x, \e y, \e z, \e p) + * + * RJ is defined in http://dlmf.nist.gov/19.16.E2 + * \f[ R_J(x, y, z, p) = \frac32 + * \int_0^\infty[(t + x) (t + y) (t + z)]^{-1/2} (t + p)^{-1}\, dt \f] + **********************************************************************/ + static real RJ(real x, real y, real z, real p) throw(); + + /** + * Degenerate symmetric integral of the third kind RD. + * + * @param[in] x + * @param[in] y + * @param[in] z + * @return RD(\e x, \e y, \e z) = RJ(\e + * x, \e y, \e z, \e z) + * + * RD is defined in http://dlmf.nist.gov/19.16.E5 + * \f[ R_D(x, y, z) = \frac32 + * \int_0^\infty[(t + x) (t + y)]^{-1/2} (t + z)^{-3/2}\, dt \f] + **********************************************************************/ + static real RD(real x, real y, real z) throw(); + ///@} + + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_ELLIPTICFUNCTION_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeoCoords.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeoCoords.hpp new file mode 100644 index 000000000..b97a692bb --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeoCoords.hpp @@ -0,0 +1,541 @@ +/** + * \file GeoCoords.hpp + * \brief Header for GeographicLib::GeoCoords class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GEOCOORDS_HPP) +#define GEOGRAPHICLIB_GEOCOORDS_HPP 1 + +#include +#include + +namespace GeographicLib { + + /** + * \brief Conversion between geographic coordinates + * + * This class stores a geographic position which may be set via the + * constructors or Reset via + * - latitude and longitude + * - UTM or UPS coordinates + * - a string representation of these or an MGRS coordinate string + * + * The state consists of the latitude and longitude and the supplied UTM or + * UPS coordinates (possibly derived from the MGRS coordinates). If latitude + * and longitude were given then the UTM/UPS coordinates follows the standard + * conventions. + * + * The mutable state consists of the UTM or UPS coordinates for a alternate + * zone. A method SetAltZone is provided to set the alternate UPS/UTM zone. + * + * Methods are provided to return the geographic coordinates, the input UTM + * or UPS coordinates (and associated meridian convergence and scale), or + * alternate UTM or UPS coordinates (and their associated meridian + * convergence and scale). + * + * Once the input string has been parsed, you can print the result out in any + * of the formats, decimal degrees, degrees minutes seconds, MGRS, UTM/UPS. + * + * Example of use: + * \include example-GeoCoords.cpp + * + * GeoConvert is a command-line utility + * providing access to the functionality of GeoCoords. + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT GeoCoords { + private: + typedef Math::real real; + real _lat, _long, _easting, _northing, _gamma, _k; + bool _northp; + int _zone; // See UTMUPS::zonespec + mutable real _alt_easting, _alt_northing, _alt_gamma, _alt_k; + mutable int _alt_zone; + + void CopyToAlt() const throw() { + _alt_easting = _easting; + _alt_northing = _northing; + _alt_gamma = _gamma; + _alt_k = _k; + _alt_zone = _zone; + } + static void UTMUPSString(int zone, bool northp, real easting, real northing, + int prec, std::string& utm); + void FixHemisphere(); + public: + + /** \name Initializing the GeoCoords object + **********************************************************************/ + ///@{ + /** + * The default constructor is equivalent to \e latitude = 90°, + * \e longitude = 0°. + **********************************************************************/ + GeoCoords() throw() + // This is the N pole + : _lat(90) + , _long(0) + , _easting(2000000) + , _northing(2000000) + , _northp(true) + , _zone(0) + { CopyToAlt(); } + + /** + * Construct from a string. + * + * @param[in] s 1-element, 2-element, or 3-element string representation of + * the position. + * @param[in] centerp governs the interpretation of MGRS coordinates (see + * below). + * @param[in] swaplatlong governs the interpretation of geographic + * coordinates (see below). + * @exception GeographicErr if the \e s is malformed (see below). + * + * Parse as a string and interpret it as a geographic position. The input + * string is broken into space (or comma) separated pieces and Basic + * decision on which format is based on number of components + * -# MGRS + * -# "Lat Long" or "Long Lat" + * -# "Zone Easting Northing" or "Easting Northing Zone" + * + * The following inputs are approximately the same (Ar Ramadi Bridge, Iraq) + * - Latitude and Longitude + * - 33.44 43.27 + * - N33d26.4' E43d16.2' + * - 43d16'12"E 33d26'24"N + * - 43:16:12E 33:26:24 + * - MGRS + * - 38SLC301 + * - 38SLC391014 + * - 38SLC3918701405 + * - 37SHT9708 + * - UTM + * - 38N 339188 3701405 + * - 897039 3708229 37N + * + * Latitude and Longitude parsing: Latitude precedes longitude, + * unless a N, S, E, W hemisphere designator is used on one or both + * coordinates. If \e swaplatlong = true (default is false), then + * longitude precedes latitude in the absence of a hemisphere designator. + * Thus (with \e swaplatlong = false) + * - 40 -75 + * - N40 W75 + * - -75 N40 + * - 75W 40N + * - E-75 -40S + * . + * are all the same position. The coordinates may be given in + * decimal degrees, degrees and decimal minutes, degrees, minutes, + * seconds, etc. Use d, ', and " to mark off the degrees, + * minutes and seconds. Various alternative symbols for degrees, minutes, + * and seconds are allowed. Alternatively, use : to separate these + * components. (See DMS::Decode for details.) Thus + * - 40d30'30" + * - 40d30'30 + * - 40°30'30 + * - 40d30.5' + * - 40d30.5 + * - 40:30:30 + * - 40:30.5 + * - 40.508333333 + * . + * all specify the same angle. The leading sign applies to all components + * so -1d30 is -(1+30/60) = -1.5. Latitudes must be in the range + * [−90°, 90°] and longitudes in the range + * [−540°, 540°). Internally longitudes are reduced + * to the range [−180°, 180°). + * + * UTM/UPS parsing: For UTM zones (−80° ≤ Lat < + * 84°), the zone designator is made up of a zone number (for 1 to 60) + * and a hemisphere letter (N or S), e.g., 38N. The latitude zone designer + * ([C--M] in the southern hemisphere and [N--X] in the northern) should + * NOT be used. (This is part of the MGRS coordinate.) The zone + * designator for the poles (where UPS is employed) is a hemisphere letter + * by itself, i.e., N or S. + * + * MGRS parsing interprets the grid references as square area at the + * specified precision (1m, 10m, 100m, etc.). If \e centerp = true (the + * default), the center of this square is then taken to be the precise + * position; thus: + * - 38SMB = 38N 450000 3650000 + * - 38SMB4484 = 38N 444500 3684500 + * - 38SMB44148470 = 38N 444145 3684705 + * . + * Otherwise, the "south-west" corner of the square is used, i.e., + * - 38SMB = 38N 400000 3600000 + * - 38SMB4484 = 38N 444000 3684000 + * - 38SMB44148470 = 38N 444140 3684700 + **********************************************************************/ + explicit GeoCoords(const std::string& s, + bool centerp = true, bool swaplatlong = false) + { Reset(s, centerp, swaplatlong); } + + /** + * Construct from geographic coordinates. + * + * @param[in] latitude (degrees). + * @param[in] longitude (degrees). + * @param[in] zone if specified, force the UTM/UPS representation to use a + * specified zone using the rules given in UTMUPS::zonespec. + * @exception GeographicErr if \e latitude is not in [−90°, + * 90°]. + * @exception GeographicErr if \e longitude is not in [−540°, + * 540°). + * @exception GeographicErr if \e zone cannot be used for this location. + **********************************************************************/ + GeoCoords(real latitude, real longitude, int zone = UTMUPS::STANDARD) { + Reset(latitude, longitude, zone); + } + + /** + * Construct from UTM/UPS coordinates. + * + * @param[in] zone UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] easting (meters). + * @param[in] northing (meters). + * @exception GeographicErr if \e zone, \e easting, or \e northing is + * outside its allowed range. + **********************************************************************/ + GeoCoords(int zone, bool northp, real easting, real northing) { + Reset(zone, northp, easting, northing); + } + + /** + * Reset the location from a string. See + * GeoCoords(const std::string& s, bool centerp, bool swaplatlong). + * + * @param[in] s 1-element, 2-element, or 3-element string representation of + * the position. + * @param[in] centerp governs the interpretation of MGRS coordinates. + * @param[in] swaplatlong governs the interpretation of geographic + * coordinates. + * @exception GeographicErr if the \e s is malformed. + **********************************************************************/ + void Reset(const std::string& s, + bool centerp = true, bool swaplatlong = false); + + /** + * Reset the location in terms of geographic coordinates. See + * GeoCoords(real latitude, real longitude, int zone). + * + * @param[in] latitude (degrees). + * @param[in] longitude (degrees). + * @param[in] zone if specified, force the UTM/UPS representation to use a + * specified zone using the rules given in UTMUPS::zonespec. + * @exception GeographicErr if \e latitude is not in [−90°, + * 90°]. + * @exception GeographicErr if \e longitude is not in [−540°, + * 540°). + * @exception GeographicErr if \e zone cannot be used for this location. + **********************************************************************/ + void Reset(real latitude, real longitude, int zone = UTMUPS::STANDARD) { + UTMUPS::Forward(latitude, longitude, + _zone, _northp, _easting, _northing, _gamma, _k, + zone); + _lat = latitude; + _long = longitude; + if (_long >= 180) _long -= 360; + else if (_long < -180) _long += 360; + CopyToAlt(); + } + + /** + * Reset the location in terms of UPS/UPS coordinates. See + * GeoCoords(int zone, bool northp, real easting, real northing). + * + * @param[in] zone UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] easting (meters). + * @param[in] northing (meters). + * @exception GeographicErr if \e zone, \e easting, or \e northing is + * outside its allowed range. + **********************************************************************/ + void Reset(int zone, bool northp, real easting, real northing) { + UTMUPS::Reverse(zone, northp, easting, northing, + _lat, _long, _gamma, _k); + _zone = zone; + _northp = northp; + _easting = easting; + _northing = northing; + FixHemisphere(); + CopyToAlt(); + } + ///@} + + /** \name Querying the GeoCoords object + **********************************************************************/ + ///@{ + /** + * @return latitude (degrees) + **********************************************************************/ + Math::real Latitude() const throw() { return _lat; } + + /** + * @return longitude (degrees) + **********************************************************************/ + Math::real Longitude() const throw() { return _long; } + + /** + * @return easting (meters) + **********************************************************************/ + Math::real Easting() const throw() { return _easting; } + + /** + * @return northing (meters) + **********************************************************************/ + Math::real Northing() const throw() { return _northing; } + + /** + * @return meridian convergence (degrees) for the UTM/UPS projection. + **********************************************************************/ + Math::real Convergence() const throw() { return _gamma; } + + /** + * @return scale for the UTM/UPS projection. + **********************************************************************/ + Math::real Scale() const throw() { return _k; } + + /** + * @return hemisphere (false means south, true means north). + **********************************************************************/ + bool Northp() const throw() { return _northp; } + + /** + * @return hemisphere letter N or S. + **********************************************************************/ + char Hemisphere() const throw() { return _northp ? 'N' : 'S'; } + + /** + * @return the zone corresponding to the input (return 0 for UPS). + **********************************************************************/ + int Zone() const throw() { return _zone; } + + ///@} + + /** \name Setting and querying the alternate zone + **********************************************************************/ + ///@{ + /** + * Specify alternate zone number. + * + * @param[in] zone zone number for the alternate representation. + * @exception GeographicErr if \e zone cannot be used for this location. + * + * See UTMUPS::zonespec for more information on the interpretation of \e + * zone. Note that \e zone == UTMUPS::STANDARD (the default) use the + * standard UPS or UTM zone, UTMUPS::MATCH does nothing retaining the + * existing alternate representation. Before this is called the alternate + * zone is the input zone. + **********************************************************************/ + void SetAltZone(int zone = UTMUPS::STANDARD) const { + if (zone == UTMUPS::MATCH) + return; + zone = UTMUPS::StandardZone(_lat, _long, zone); + if (zone == _zone) + CopyToAlt(); + else { + bool northp; + UTMUPS::Forward(_lat, _long, + _alt_zone, northp, + _alt_easting, _alt_northing, _alt_gamma, _alt_k, + zone); + } + } + + /** + * @return current alternate zone (return 0 for UPS). + **********************************************************************/ + int AltZone() const throw() { return _alt_zone; } + + /** + * @return easting (meters) for alternate zone. + **********************************************************************/ + Math::real AltEasting() const throw() { return _alt_easting; } + + /** + * @return northing (meters) for alternate zone. + **********************************************************************/ + Math::real AltNorthing() const throw() { return _alt_northing; } + + /** + * @return meridian convergence (degrees) for alternate zone. + **********************************************************************/ + Math::real AltConvergence() const throw() { return _alt_gamma; } + + /** + * @return scale for alternate zone. + **********************************************************************/ + Math::real AltScale() const throw() { return _alt_k; } + ///@} + + /** \name String representations of the GeoCoords object + **********************************************************************/ + ///@{ + /** + * String representation with latitude and longitude as signed decimal + * degrees. + * + * @param[in] prec precision (relative to about 1m). + * @param[in] swaplatlong if true give longitude first (default = false) + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return decimal latitude/longitude string representation. + * + * Precision specifies accuracy of representation as follows: + * - prec = −5 (min), 1° + * - prec = 0, 10−5° (about 1m) + * - prec = 3, 10−8° + * - prec = 9 (max), 10−14° + **********************************************************************/ + std::string GeoRepresentation(int prec = 0, bool swaplatlong = false) const; + + /** + * String representation with latitude and longitude as degrees, minutes, + * seconds, and hemisphere. + * + * @param[in] prec precision (relative to about 1m) + * @param[in] swaplatlong if true give longitude first (default = false) + * @param[in] dmssep if non-null, use as the DMS separator character + * (instead of d, ', " delimiters). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return DMS latitude/longitude string representation. + * + * Precision specifies accuracy of representation as follows: + * - prec = −5 (min), 1° + * - prec = −4, 0.1° + * - prec = −3, 1' + * - prec = −2, 0.1' + * - prec = −1, 1" + * - prec = 0, 0.1" (about 3m) + * - prec = 1, 0.01" + * - prec = 10 (max), 10−11" + **********************************************************************/ + std::string DMSRepresentation(int prec = 0, bool swaplatlong = false, + char dmssep = char(0)) + const; + + /** + * MGRS string. + * + * @param[in] prec precision (relative to about 1m). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return MGRS string. + * + * This gives the coordinates of the enclosing grid square with size given + * by the precision. Thus 38N 444180 3684790 converted to a MGRS + * coordinate at precision −2 (100m) is 38SMB441847 and not + * 38SMB442848. \e prec specifies the precision of the MGRS string as + * follows: + * - prec = −5 (min), 100km + * - prec = −4, 10km + * - prec = −3, 1km + * - prec = −2, 100m + * - prec = −1, 10m + * - prec = 0, 1m + * - prec = 1, 0.1m + * - prec = 6 (max), 1μm + **********************************************************************/ + std::string MGRSRepresentation(int prec = 0) const; + + /** + * UTM/UPS string. + * + * @param[in] prec precision (relative to about 1m) + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return UTM/UPS string representation: zone designator, easting, and + * northing. + * + * Precision specifies accuracy of representation as follows: + * - prec = −5 (min), 100km + * - prec = −3, 1km + * - prec = 0, 1m + * - prec = 3, 1mm + * - prec = 6, 1μm + * - prec = 9 (max), 1nm + **********************************************************************/ + std::string UTMUPSRepresentation(int prec = 0) const; + + /** + * UTM/UPS string with hemisphere override. + * + * @param[in] prec precision (relative to about 1m) + * @param[in] northp hemisphere override + * @exception GeographicErr if the hemisphere override attempts to change + * UPS N to UPS S or vice verse. + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return UTM/UPS string representation: zone designator, easting, and + * northing. + **********************************************************************/ + std::string UTMUPSRepresentation(bool northp, int prec = 0) const; + + /** + * MGRS string for the alternate zone. See GeoCoords::MGRSRepresentation. + * + * @param[in] prec precision (relative to about 1m). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return MGRS string. + **********************************************************************/ + std::string AltMGRSRepresentation(int prec = 0) const; + + /** + * UTM/UPS string for the alternate zone. See + * GeoCoords::UTMUPSRepresentation. + * + * @param[in] prec precision (relative to about 1m) + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return UTM/UPS string representation: zone designator, easting, and + * northing. + **********************************************************************/ + std::string AltUTMUPSRepresentation(int prec = 0) const; + + /** + * UTM/UPS string for the alternate zone, with hemisphere override. + * + * @param[in] prec precision (relative to about 1m) + * @param[in] northp hemisphere override + * @exception GeographicErr if the hemisphere override attempts to change + * UPS N to UPS S or vice verse. + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return UTM/UPS string representation: zone designator, easting, and + * northing. + **********************************************************************/ + std::string AltUTMUPSRepresentation(bool northp, int prec = 0) const; + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the WGS84 ellipsoid (meters). + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + Math::real MajorRadius() const throw() { return UTMUPS::MajorRadius(); } + + /** + * @return \e f the flattening of the WGS84 ellipsoid. + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + Math::real Flattening() const throw() { return UTMUPS::Flattening(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return UTMUPS::InverseFlattening(); } + /// \endcond + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_GEOCOORDS_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geocentric.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geocentric.hpp new file mode 100644 index 000000000..3afdb0b16 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geocentric.hpp @@ -0,0 +1,275 @@ +/** + * \file Geocentric.hpp + * \brief Header for GeographicLib::Geocentric class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GEOCENTRIC_HPP) +#define GEOGRAPHICLIB_GEOCENTRIC_HPP 1 + +#include +#include + +namespace GeographicLib { + + /** + * \brief %Geocentric coordinates + * + * Convert between geodetic coordinates latitude = \e lat, longitude = \e + * lon, height = \e h (measured vertically from the surface of the ellipsoid) + * to geocentric coordinates (\e X, \e Y, \e Z). The origin of geocentric + * coordinates is at the center of the earth. The \e Z axis goes thru the + * north pole, \e lat = 90°. The \e X axis goes thru \e lat = 0, + * \e lon = 0. %Geocentric coordinates are also known as earth centered, + * earth fixed (ECEF) coordinates. + * + * The conversion from geographic to geocentric coordinates is + * straightforward. For the reverse transformation we use + * - H. Vermeille, + * Direct + * transformation from geocentric coordinates to geodetic coordinates, + * J. Geodesy 76, 451--454 (2002). + * . + * Several changes have been made to ensure that the method returns accurate + * results for all finite inputs (even if \e h is infinite). The changes are + * described in Appendix B of + * - C. F. F. Karney, + * Geodesics + * on an ellipsoid of revolution, + * Feb. 2011; + * preprint + * arxiv:1102.1215v1. + * . + * See \ref geocentric for more information. + * + * The errors in these routines are close to round-off. Specifically, for + * points within 5000 km of the surface of the ellipsoid (either inside or + * outside the ellipsoid), the error is bounded by 7 nm (7 nanometers) for + * the WGS84 ellipsoid. See \ref geocentric for further information on the + * errors. + * + * Example of use: + * \include example-Geocentric.cpp + * + * CartConvert is a command-line utility + * providing access to the functionality of Geocentric and LocalCartesian. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT Geocentric { + private: + typedef Math::real real; + friend class LocalCartesian; + friend class MagneticCircle; // MagneticCircle uses Rotation + friend class MagneticModel; // MagneticModel uses IntForward + friend class GravityCircle; // GravityCircle uses Rotation + friend class GravityModel; // GravityModel uses IntForward + friend class NormalGravity; // NormalGravity uses IntForward + friend class SphericalHarmonic; + friend class SphericalHarmonic1; + friend class SphericalHarmonic2; + static const size_t dim_ = 3; + static const size_t dim2_ = dim_ * dim_; + real _a, _f, _e2, _e2m, _e2a, _e4a, _maxrad; + static void Rotation(real sphi, real cphi, real slam, real clam, + real M[dim2_]) throw(); + static void Rotate(real M[dim2_], real x, real y, real z, + real& X, real& Y, real& Z) throw() { + // Perform [X,Y,Z]^t = M.[x,y,z]^t + // (typically local cartesian to geocentric) + X = M[0] * x + M[1] * y + M[2] * z; + Y = M[3] * x + M[4] * y + M[5] * z; + Z = M[6] * x + M[7] * y + M[8] * z; + } + static void Unrotate(real M[dim2_], real X, real Y, real Z, + real& x, real& y, real& z) throw() { + // Perform [x,y,z]^t = M^t.[X,Y,Z]^t + // (typically geocentric to local cartesian) + x = M[0] * X + M[3] * Y + M[6] * Z; + y = M[1] * X + M[4] * Y + M[7] * Z; + z = M[2] * X + M[5] * Y + M[8] * Z; + } + void IntForward(real lat, real lon, real h, real& X, real& Y, real& Z, + real M[dim2_]) const throw(); + void IntReverse(real X, real Y, real Z, real& lat, real& lon, real& h, + real M[dim2_]) const throw(); + + public: + + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @exception GeographicErr if \e a or (1 − \e f ) \e a is not + * positive. + **********************************************************************/ + Geocentric(real a, real f); + + /** + * A default constructor (for use by NormalGravity). + **********************************************************************/ + Geocentric() : _a(-1) {} + + /** + * Convert from geodetic to geocentric coordinates. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] h height of point above the ellipsoid (meters). + * @param[out] X geocentric coordinate (meters). + * @param[out] Y geocentric coordinate (meters). + * @param[out] Z geocentric coordinate (meters). + * + * \e lat should be in the range [−90°, 90°]; \e lon + * should be in the range [−540°, 540°). + **********************************************************************/ + void Forward(real lat, real lon, real h, real& X, real& Y, real& Z) + const throw() { + if (Init()) + IntForward(lat, lon, h, X, Y, Z, NULL); + } + + /** + * Convert from geodetic to geocentric coordinates and return rotation + * matrix. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] h height of point above the ellipsoid (meters). + * @param[out] X geocentric coordinate (meters). + * @param[out] Y geocentric coordinate (meters). + * @param[out] Z geocentric coordinate (meters). + * @param[out] M if the length of the vector is 9, fill with the rotation + * matrix in row-major order. + * + * Let \e v be a unit vector located at (\e lat, \e lon, \e h). We can + * express \e v as \e column vectors in one of two ways + * - in east, north, up coordinates (where the components are relative to a + * local coordinate system at (\e lat, \e lon, \e h)); call this + * representation \e v1. + * - in geocentric \e X, \e Y, \e Z coordinates; call this representation + * \e v0. + * . + * Then we have \e v0 = \e M ⋅ \e v1. + **********************************************************************/ + void Forward(real lat, real lon, real h, real& X, real& Y, real& Z, + std::vector& M) + const throw() { + if (!Init()) + return; + if (M.end() == M.begin() + dim2_) { + real t[dim2_]; + IntForward(lat, lon, h, X, Y, Z, t); + copy(t, t + dim2_, M.begin()); + } else + IntForward(lat, lon, h, X, Y, Z, NULL); + } + + /** + * Convert from geocentric to geodetic to coordinates. + * + * @param[in] X geocentric coordinate (meters). + * @param[in] Y geocentric coordinate (meters). + * @param[in] Z geocentric coordinate (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] h height of point above the ellipsoid (meters). + * + * In general there are multiple solutions and the result which maximizes + * \e h is returned. If there are still multiple solutions with different + * latitudes (applies only if \e Z = 0), then the solution with \e lat > 0 + * is returned. If there are still multiple solutions with different + * longitudes (applies only if \e X = \e Y = 0) then \e lon = 0 is + * returned. The value of \e h returned satisfies \e h ≥ − \e a + * (1 − e2) / sqrt(1 − e2 + * sin2\e lat). The value of \e lon returned is in the range + * [−180°, 180°). + **********************************************************************/ + void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h) + const throw() { + if (Init()) + IntReverse(X, Y, Z, lat, lon, h, NULL); + } + + /** + * Convert from geocentric to geodetic to coordinates. + * + * @param[in] X geocentric coordinate (meters). + * @param[in] Y geocentric coordinate (meters). + * @param[in] Z geocentric coordinate (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] h height of point above the ellipsoid (meters). + * @param[out] M if the length of the vector is 9, fill with the rotation + * matrix in row-major order. + * + * Let \e v be a unit vector located at (\e lat, \e lon, \e h). We can + * express \e v as \e column vectors in one of two ways + * - in east, north, up coordinates (where the components are relative to a + * local coordinate system at (\e lat, \e lon, \e h)); call this + * representation \e v1. + * - in geocentric \e X, \e Y, \e Z coordinates; call this representation + * \e v0. + * . + * Then we have \e v1 = \e MT ⋅ \e v0, where \e + * MT is the transpose of \e M. + **********************************************************************/ + void Reverse(real X, real Y, real Z, real& lat, real& lon, real& h, + std::vector& M) + const throw() { + if (!Init()) + return; + if (M.end() == M.begin() + dim2_) { + real t[dim2_]; + IntReverse(X, Y, Z, lat, lon, h, t); + copy(t, t + dim2_, M.begin()); + } else + IntReverse(X, Y, Z, lat, lon, h, NULL); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return true if the object has been initialized. + **********************************************************************/ + bool Init() const throw() { return _a > 0; } + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() + { return Init() ? _a : Math::NaN(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() + { return Init() ? _f : Math::NaN(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return Init() ? 1/_f : Math::NaN(); } + /// \endcond + + /** + * A global instantiation of Geocentric with the parameters for the WGS84 + * ellipsoid. + **********************************************************************/ + static const Geocentric WGS84; + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_GEOCENTRIC_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geodesic.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geodesic.hpp new file mode 100644 index 000000000..cd687acce --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geodesic.hpp @@ -0,0 +1,895 @@ +/** + * \file Geodesic.hpp + * \brief Header for GeographicLib::Geodesic class + * + * Copyright (c) Charles Karney (2009-2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GEODESIC_HPP) +#define GEOGRAPHICLIB_GEODESIC_HPP 1 + +#include + +#if !defined(GEOGRAPHICLIB_GEODESIC_ORDER) +/** + * The order of the expansions used by Geodesic. + **********************************************************************/ +# define GEOGRAPHICLIB_GEODESIC_ORDER \ + (GEOGRAPHICLIB_PRECISION == 2 ? 6 : (GEOGRAPHICLIB_PRECISION == 1 ? 3 : 7)) +#endif + +namespace GeographicLib { + + class GeodesicLine; + + /** + * \brief %Geodesic calculations + * + * The shortest path between two points on a ellipsoid at (\e lat1, \e lon1) + * and (\e lat2, \e lon2) is called the geodesic. Its length is \e s12 and + * the geodesic from point 1 to point 2 has azimuths \e azi1 and \e azi2 at + * the two end points. (The azimuth is the heading measured clockwise from + * north. \e azi2 is the "forward" azimuth, i.e., the heading that takes you + * beyond point 2 not back to point 1.) In the figure below, latitude if + * labeled φ, longitude λ (with λ12 = + * λ2 − λ1), and azimuth α. + * + * spheroidal triangle + * + * Given \e lat1, \e lon1, \e azi1, and \e s12, we can determine \e lat2, \e + * lon2, and \e azi2. This is the \e direct geodesic problem and its + * solution is given by the function Geodesic::Direct. (If \e s12 is + * sufficiently large that the geodesic wraps more than halfway around the + * earth, there will be another geodesic between the points with a smaller \e + * s12.) + * + * Given \e lat1, \e lon1, \e lat2, and \e lon2, we can determine \e azi1, \e + * azi2, and \e s12. This is the \e inverse geodesic problem, whose solution + * is given by Geodesic::Inverse. Usually, the solution to the inverse + * problem is unique. In cases where there are multiple solutions (all with + * the same \e s12, of course), all the solutions can be easily generated + * once a particular solution is provided. + * + * The standard way of specifying the direct problem is the specify the + * distance \e s12 to the second point. However it is sometimes useful + * instead to specify the arc length \e a12 (in degrees) on the auxiliary + * sphere. This is a mathematical construct used in solving the geodesic + * problems. The solution of the direct problem in this form is provided by + * Geodesic::ArcDirect. An arc length in excess of 180° indicates that + * the geodesic is not a shortest path. In addition, the arc length between + * an equatorial crossing and the next extremum of latitude for a geodesic is + * 90°. + * + * This class can also calculate several other quantities related to + * geodesics. These are: + * - reduced length. If we fix the first point and increase \e azi1 + * by \e dazi1 (radians), the second point is displaced \e m12 \e dazi1 in + * the direction \e azi2 + 90°. The quantity \e m12 is called + * the "reduced length" and is symmetric under interchange of the two + * points. On a curved surface the reduced length obeys a symmetry + * relation, \e m12 + \e m21 = 0. On a flat surface, we have \e m12 = \e + * s12. The ratio s12/\e m12 gives the azimuthal scale for an + * azimuthal equidistant projection. + * - geodesic scale. Consider a reference geodesic and a second + * geodesic parallel to this one at point 1 and separated by a small + * distance \e dt. The separation of the two geodesics at point 2 is \e + * M12 \e dt where \e M12 is called the "geodesic scale". \e M21 is + * defined similarly (with the geodesics being parallel at point 2). On a + * flat surface, we have \e M12 = \e M21 = 1. The quantity 1/\e M12 gives + * the scale of the Cassini-Soldner projection. + + * - area. The area between the geodesic from point 1 to point 2 and + * the equation is represented by \e S12; it is the area, measured + * counter-clockwise, of the geodesic quadrilateral with corners + * (lat1,lon1), (0,lon1), (0,lon2), and + * (lat2,lon2). It can be used to compute the area of any + * simple geodesic polygon. + * + * Overloaded versions of Geodesic::Direct, Geodesic::ArcDirect, and + * Geodesic::Inverse allow these quantities to be returned. In addition + * there are general functions Geodesic::GenDirect, and Geodesic::GenInverse + * which allow an arbitrary set of results to be computed. The quantities \e + * m12, \e M12, \e M21 which all specify the behavior of nearby geodesics + * obey addition rules. If points 1, 2, and 3 all lie on a single geodesic, + * then the following rules hold: + * - \e s13 = \e s12 + \e s23 + * - \e a13 = \e a12 + \e a23 + * - \e S13 = \e S12 + \e S23 + * - \e m13 = \e m12 \e M23 + \e m23 \e M21 + * - \e M13 = \e M12 \e M23 − (1 − \e M12 \e M21) \e m23 / \e m12 + * - \e M31 = \e M32 \e M21 − (1 − \e M23 \e M32) \e m12 / \e m23 + * + * Additional functionality is provided by the GeodesicLine class, which + * allows a sequence of points along a geodesic to be computed. + * + * The shortest distance returned by the solution of the inverse problem is + * (obviously) uniquely defined. However, in a few special cases there are + * multiple azimuths which yield the same shortest distance. Here is a + * catalog of those cases: + * - \e lat1 = −\e lat2 (with neither point at a pole). If \e azi1 = + * \e azi2, the geodesic is unique. Otherwise there are two geodesics and + * the second one is obtained by setting [\e azi1, \e azi2] = [\e azi2, \e + * azi1], [\e M12, \e M21] = [\e M21, \e M12], \e S12 = −\e S12. + * (This occurs when the longitude difference is near ±180° for + * oblate ellipsoids.) + * - \e lon2 = \e lon1 ± 180° (with neither point at a pole). If + * \e azi1 = 0° or ±180°, the geodesic is unique. Otherwise + * there are two geodesics and the second one is obtained by setting [\e + * azi1, \e azi2] = [−\e azi1, −\e azi2], \e S12 = −\e + * S12. (This occurs when \e lat2 is near −\e lat1 for prolate + * ellipsoids.) + * - Points 1 and 2 at opposite poles. There are infinitely many geodesics + * which can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e + * azi2] + [\e d, −\e d], for arbitrary \e d. (For spheres, this + * prescription applies when points 1 and 2 are antipodal.) + * - s12 = 0 (coincident points). There are infinitely many geodesics which + * can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e azi2] + + * [\e d, \e d], for arbitrary \e d. + * + * The calculations are accurate to better than 15 nm (15 nanometers) for the + * WGS84 ellipsoid. See Sec. 9 of + * arXiv:1102.1215v1 for + * details. The algorithms used by this class are based on series expansions + * using the flattening \e f as a small parameter. These are only accurate + * for |f| < 0.02; however reasonably accurate results will be + * obtained for |f| < 0.2. Here is a table of the approximate + * maximum error (expressed as a distance) for an ellipsoid with the same + * major radius as the WGS84 ellipsoid and different values of the + * flattening.
+   *     |f|      error
+   *     0.01     25 nm
+   *     0.02     30 nm
+   *     0.05     10 um
+   *     0.1     1.5 mm
+   *     0.2     300 mm
+   * 
+ * For very eccentric ellipsoids, use GeodesicExact instead. + * + * The algorithms are described in + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * . + * For more information on geodesics see \ref geodesic. + * + * Example of use: + * \include example-Geodesic.cpp + * + * Geod is a command-line utility providing access + * to the functionality of Geodesic and GeodesicLine. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT Geodesic { + private: + typedef Math::real real; + friend class GeodesicLine; + static const int nA1_ = GEOGRAPHICLIB_GEODESIC_ORDER; + static const int nC1_ = GEOGRAPHICLIB_GEODESIC_ORDER; + static const int nC1p_ = GEOGRAPHICLIB_GEODESIC_ORDER; + static const int nA2_ = GEOGRAPHICLIB_GEODESIC_ORDER; + static const int nC2_ = GEOGRAPHICLIB_GEODESIC_ORDER; + static const int nA3_ = GEOGRAPHICLIB_GEODESIC_ORDER; + static const int nA3x_ = nA3_; + static const int nC3_ = GEOGRAPHICLIB_GEODESIC_ORDER; + static const int nC3x_ = (nC3_ * (nC3_ - 1)) / 2; + static const int nC4_ = GEOGRAPHICLIB_GEODESIC_ORDER; + static const int nC4x_ = (nC4_ * (nC4_ + 1)) / 2; + static const unsigned maxit1_ = 20; + static const unsigned maxit2_ = maxit1_ + + std::numeric_limits::digits + 10; + + static const real tiny_; + static const real tol0_; + static const real tol1_; + static const real tol2_; + static const real tolb_; + static const real xthresh_; + + enum captype { + CAP_NONE = 0U, + CAP_C1 = 1U<<0, + CAP_C1p = 1U<<1, + CAP_C2 = 1U<<2, + CAP_C3 = 1U<<3, + CAP_C4 = 1U<<4, + CAP_ALL = 0x1FU, + OUT_ALL = 0x7F80U, + }; + + static real SinCosSeries(bool sinp, + real sinx, real cosx, const real c[], int n) + throw(); + static inline real AngRound(real x) throw() { + // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^57 + // for reals = 0.7 pm on the earth if x is an angle in degrees. (This + // is about 1000 times more resolution than we get with angles around 90 + // degrees.) We use this to avoid having to deal with near singular + // cases when x is non-zero but tiny (e.g., 1.0e-200). + const real z = 1/real(16); + volatile real y = std::abs(x); + // The compiler mustn't "simplify" z - (z - y) to y + y = y < z ? z - (z - y) : y; + return x < 0 ? -y : y; + } + static inline void SinCosNorm(real& sinx, real& cosx) throw() { + real r = Math::hypot(sinx, cosx); + sinx /= r; + cosx /= r; + } + static real Astroid(real x, real y) throw(); + + real _a, _f, _f1, _e2, _ep2, _n, _b, _c2, _etol2; + real _A3x[nA3x_], _C3x[nC3x_], _C4x[nC4x_]; + + void Lengths(real eps, real sig12, + real ssig1, real csig1, real dn1, + real ssig2, real csig2, real dn2, + real cbet1, real cbet2, + real& s12s, real& m12a, real& m0, + bool scalep, real& M12, real& M21, + real C1a[], real C2a[]) const throw(); + real InverseStart(real sbet1, real cbet1, real dn1, + real sbet2, real cbet2, real dn2, + real lam12, + real& salp1, real& calp1, + real& salp2, real& calp2, real& dnm, + real C1a[], real C2a[]) const throw(); + real Lambda12(real sbet1, real cbet1, real dn1, + real sbet2, real cbet2, real dn2, + real salp1, real calp1, + real& salp2, real& calp2, real& sig12, + real& ssig1, real& csig1, real& ssig2, real& csig2, + real& eps, real& domg12, bool diffp, real& dlam12, + real C1a[], real C2a[], real C3a[]) + const throw(); + + // These are Maxima generated functions to provide series approximations to + // the integrals for the ellipsoidal geodesic. + static real A1m1f(real eps) throw(); + static void C1f(real eps, real c[]) throw(); + static void C1pf(real eps, real c[]) throw(); + static real A2m1f(real eps) throw(); + static void C2f(real eps, real c[]) throw(); + + void A3coeff() throw(); + real A3f(real eps) const throw(); + void C3coeff() throw(); + void C3f(real eps, real c[]) const throw(); + void C4coeff() throw(); + void C4f(real k2, real c[]) const throw(); + + public: + + /** + * Bit masks for what calculations to do. These masks do double duty. + * They signify to the GeodesicLine::GeodesicLine constructor and to + * Geodesic::Line what capabilities should be included in the GeodesicLine + * object. They also specify which results to return in the general + * routines Geodesic::GenDirect and Geodesic::GenInverse routines. + * GeodesicLine::mask is a duplication of this enum. + **********************************************************************/ + enum mask { + /** + * No capabilities, no output. + * @hideinitializer + **********************************************************************/ + NONE = 0U, + /** + * Calculate latitude \e lat2. (It's not necessary to include this as a + * capability to GeodesicLine because this is included by default.) + * @hideinitializer + **********************************************************************/ + LATITUDE = 1U<<7 | CAP_NONE, + /** + * Calculate longitude \e lon2. + * @hideinitializer + **********************************************************************/ + LONGITUDE = 1U<<8 | CAP_C3, + /** + * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to + * include this as a capability to GeodesicLine because this is included + * by default.) + * @hideinitializer + **********************************************************************/ + AZIMUTH = 1U<<9 | CAP_NONE, + /** + * Calculate distance \e s12. + * @hideinitializer + **********************************************************************/ + DISTANCE = 1U<<10 | CAP_C1, + /** + * Allow distance \e s12 to be used as input in the direct geodesic + * problem. + * @hideinitializer + **********************************************************************/ + DISTANCE_IN = 1U<<11 | CAP_C1 | CAP_C1p, + /** + * Calculate reduced length \e m12. + * @hideinitializer + **********************************************************************/ + REDUCEDLENGTH = 1U<<12 | CAP_C1 | CAP_C2, + /** + * Calculate geodesic scales \e M12 and \e M21. + * @hideinitializer + **********************************************************************/ + GEODESICSCALE = 1U<<13 | CAP_C1 | CAP_C2, + /** + * Calculate area \e S12. + * @hideinitializer + **********************************************************************/ + AREA = 1U<<14 | CAP_C4, + /** + * All capabilities, calculate everything. + * @hideinitializer + **********************************************************************/ + ALL = OUT_ALL| CAP_ALL, + }; + + /** \name Constructor + **********************************************************************/ + ///@{ + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @exception GeographicErr if \e a or (1 − \e f ) \e a is not + * positive. + **********************************************************************/ + Geodesic(real a, real f); + ///@} + + /** \name Direct geodesic problem specified in terms of distance. + **********************************************************************/ + ///@{ + /** + * Solve the direct geodesic problem where the length of the geodesic + * is specified in terms of distance. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). The values of + * \e lon2 and \e azi2 returned are in the range [−180°, + * 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + * + * The following functions are overloaded versions of Geodesic::Direct + * which omit some of the output parameters. Note, however, that the arc + * length is always computed and returned as the function value. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2, + real& m12, real& M12, real& M21, real& S12) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE | AREA, + lat2, lon2, azi2, t, m12, M12, M21, S12); + } + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE, + lat2, lon2, t, t, t, t, t, t); + } + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH, + lat2, lon2, azi2, t, t, t, t, t); + } + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2, real& m12) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH | REDUCEDLENGTH, + lat2, lon2, azi2, t, m12, t, t, t); + } + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2, + real& M12, real& M21) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH | GEODESICSCALE, + lat2, lon2, azi2, t, t, M12, M21, t); + } + + /** + * See the documentation for Geodesic::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2, + real& m12, real& M12, real& M21) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE, + lat2, lon2, azi2, t, m12, M12, M21, t); + } + ///@} + + /** \name Direct geodesic problem specified in terms of arc length. + **********************************************************************/ + ///@{ + /** + * Solve the direct geodesic problem where the length of the geodesic + * is specified in terms of arc length. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] a12 arc length between point 1 and point 2 (degrees); it can + * be negative. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). The values of + * \e lon2 and \e azi2 returned are in the range [−180°, + * 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + * + * The following functions are overloaded versions of Geodesic::Direct + * which omit some of the output parameters. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, real& s12, + real& m12, real& M12, real& M21, real& S12) + const throw() { + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + REDUCEDLENGTH | GEODESICSCALE | AREA, + lat2, lon2, azi2, s12, m12, M12, M21, S12); + } + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE, + lat2, lon2, t, t, t, t, t, t); + } + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH, + lat2, lon2, azi2, t, t, t, t, t); + } + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, real& s12) + const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE, + lat2, lon2, azi2, s12, t, t, t, t); + } + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, + real& s12, real& m12) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + REDUCEDLENGTH, + lat2, lon2, azi2, s12, m12, t, t, t); + } + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, real& s12, + real& M12, real& M21) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + GEODESICSCALE, + lat2, lon2, azi2, s12, t, M12, M21, t); + } + + /** + * See the documentation for Geodesic::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, real& s12, + real& m12, real& M12, real& M21) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + REDUCEDLENGTH | GEODESICSCALE, + lat2, lon2, azi2, s12, m12, M12, M21, t); + } + ///@} + + /** \name General version of the direct geodesic solution. + **********************************************************************/ + ///@{ + + /** + * The general direct geodesic problem. Geodesic::Direct and + * Geodesic::ArcDirect are defined in terms of this function. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] arcmode boolean flag determining the meaning of the \e + * s12_a12. + * @param[in] s12_a12 if \e arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be negative. + * @param[in] outmask a bitor'ed combination of Geodesic::mask values + * specifying which of the following parameters should be set. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The Geodesic::mask values possible for \e outmask are + * - \e outmask |= Geodesic::LATITUDE for the latitude \e lat2; + * - \e outmask |= Geodesic::LONGITUDE for the latitude \e lon2; + * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2; + * - \e outmask |= Geodesic::DISTANCE for the distance \e s12; + * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= Geodesic::AREA for the area \e S12; + * - \e outmask |= Geodesic::ALL for all of the above. + * . + * The function value \e a12 is always computed and returned and this + * equals \e s12_a12 is \e arcmode is true. If \e outmask includes + * Geodesic::DISTANCE and \e arcmode is false, then \e s12 = \e s12_a12. + * It is not necessary to include Geodesic::DISTANCE_IN in \e outmask; this + * is automatically included is \e arcmode is false. + **********************************************************************/ + Math::real GenDirect(real lat1, real lon1, real azi1, + bool arcmode, real s12_a12, unsigned outmask, + real& lat2, real& lon2, real& azi2, + real& s12, real& m12, real& M12, real& M21, + real& S12) const throw(); + ///@} + + /** \name Inverse geodesic problem. + **********************************************************************/ + ///@{ + /** + * Solve the inverse geodesic problem. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] azi1 azimuth at point 1 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e lat1 and \e lat2 should be in the range [−90°, 90°]; \e + * lon1 and \e lon2 should be in the range [−540°, 540°). + * The values of \e azi1 and \e azi2 returned are in the range + * [−180°, 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. + * + * The solution to the inverse problem is found using Newton's method. If + * this fails to converge (this is very unlikely in geodetic applications + * but does occur for very eccentric ellipsoids), then the bisection method + * is used to refine the solution. + * + * The following functions are overloaded versions of Geodesic::Inverse + * which omit some of the output parameters. Note, however, that the arc + * length is always computed and returned as the function value. + **********************************************************************/ + 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 throw() { + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE | AREA, + s12, azi1, azi2, m12, M12, M21, S12); + } + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12) const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE, + s12, t, t, t, t, t, t); + } + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& azi1, real& azi2) const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + AZIMUTH, + t, azi1, azi2, t, t, t, t); + } + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12, real& azi1, real& azi2) + const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH, + s12, azi1, azi2, t, t, t, t); + } + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12, real& azi1, real& azi2, real& m12) + const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH | REDUCEDLENGTH, + s12, azi1, azi2, m12, t, t, t); + } + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12, real& azi1, real& azi2, + real& M12, real& M21) const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH | GEODESICSCALE, + s12, azi1, azi2, t, M12, M21, t); + } + + /** + * See the documentation for Geodesic::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12, real& azi1, real& azi2, real& m12, + real& M12, real& M21) const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE, + s12, azi1, azi2, m12, M12, M21, t); + } + ///@} + + /** \name General version of inverse geodesic solution. + **********************************************************************/ + ///@{ + /** + * The general inverse geodesic calculation. Geodesic::Inverse is defined + * in terms of this function. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[in] outmask a bitor'ed combination of Geodesic::mask values + * specifying which of the following parameters should be set. + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] azi1 azimuth at point 1 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The Geodesic::mask values possible for \e outmask are + * - \e outmask |= Geodesic::DISTANCE for the distance \e s12; + * - \e outmask |= Geodesic::AZIMUTH for the latitude \e azi2; + * - \e outmask |= Geodesic::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= Geodesic::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= Geodesic::AREA for the area \e S12; + * - \e outmask |= Geodesic::ALL for all of the above. + * . + * The arc length is always computed and returned as the function value. + **********************************************************************/ + Math::real GenInverse(real lat1, real lon1, real lat2, real lon2, + unsigned outmask, + real& s12, real& azi1, real& azi2, + real& m12, real& M12, real& M21, real& S12) + const throw(); + ///@} + + /** \name Interface to GeodesicLine. + **********************************************************************/ + ///@{ + + /** + * Set up to compute several points on a single geodesic. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of Geodesic::mask values + * specifying the capabilities the GeodesicLine object should possess, + * i.e., which quantities can be returned in calls to + * GeodesicLine::Position. + * @return a GeodesicLine object. + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). + * + * The Geodesic::mask values are + * - \e caps |= Geodesic::LATITUDE for the latitude \e lat2; this is + * added automatically; + * - \e caps |= Geodesic::LONGITUDE for the latitude \e lon2; + * - \e caps |= Geodesic::AZIMUTH for the azimuth \e azi2; this is + * added automatically; + * - \e caps |= Geodesic::DISTANCE for the distance \e s12; + * - \e caps |= Geodesic::REDUCEDLENGTH for the reduced length \e m12; + * - \e caps |= Geodesic::GEODESICSCALE for the geodesic scales \e M12 + * and \e M21; + * - \e caps |= Geodesic::AREA for the area \e S12; + * - \e caps |= Geodesic::DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length; + * - \e caps |= Geodesic::ALL for all of the above. + * . + * The default value of \e caps is Geodesic::ALL. + * + * If the point is at a pole, the azimuth is defined by keeping \e lon1 + * fixed, writing \e lat1 = ±(90 − ε), and taking the + * limit ε → 0+. + **********************************************************************/ + GeodesicLine Line(real lat1, real lon1, real azi1, unsigned caps = ALL) + const throw(); + + ///@} + + /** \name Inspector functions. + **********************************************************************/ + ///@{ + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _a; } + + /** + * @return \e f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _f; } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() { return 1/_f; } + /// \endcond + + /** + * @return total area of ellipsoid in meters2. The area of a + * polygon encircling a pole can be found by adding + * Geodesic::EllipsoidArea()/2 to the sum of \e S12 for each side of the + * polygon. + **********************************************************************/ + Math::real EllipsoidArea() const throw() + { return 4 * Math::pi() * _c2; } + ///@} + + /** + * A global instantiation of Geodesic with the parameters for the WGS84 + * ellipsoid. + **********************************************************************/ + static const Geodesic WGS84; + + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_GEODESIC_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicExact.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicExact.hpp new file mode 100644 index 000000000..c0444f70e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicExact.hpp @@ -0,0 +1,783 @@ +/** + * \file GeodesicExact.hpp + * \brief Header for GeographicLib::GeodesicExact class + * + * Copyright (c) Charles Karney (2012-2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GEODESICEXACT_HPP) +#define GEOGRAPHICLIB_GEODESICEXACT_HPP 1 + +#include +#include + +#if !defined(GEOGRAPHICLIB_GEODESICEXACT_ORDER) +/** + * The order of the expansions used by GeodesicExact. + **********************************************************************/ +# define GEOGRAPHICLIB_GEODESICEXACT_ORDER 30 +#endif + +namespace GeographicLib { + + class GeodesicLineExact; + + /** + * \brief Exact %Geodesic calculations + * + * The equations for geodesics on an ellipsoid can be expressed in terms of + * incomplete elliptic integrals. The Geodesic class expands these integrals + * in a series in the flattening \e f and this provides an accurate solution + * for \e f ∈ [-0.01, 0.01]. The GeodesicExact class computes the + * ellitpic integrals directly and so provides a solution which is valid for + * all \e f. However, in practice, its use should be limited to about \e + * b/\e a ∈ [0.01, 100] or \e f ∈ [-99, 0.99]. + * + * For the WGS84 ellipsoid, these classes are 2--3 times \e slower than the + * series solution and 2--3 times \e less \e accurate (because it's less easy + * to control round-off errors with the elliptic integral formulation); i.e., + * the error is about 40 nm (40 nanometers) instead of 15 nm. However the + * error in the series solution scales as f7 while the + * error in the elliptic integral solution depends weakly on \e f. If the + * quarter meridian distance is 10000 km and the ratio \e b/\e a = 1 − + * \e f is varied then the approximate maximum error (expressed as a + * distance) is
+   *       1 - f  error (nm)
+   *       1/128     387
+   *       1/64      345
+   *       1/32      269
+   *       1/16      210
+   *       1/8       115
+   *       1/4        69
+   *       1/2        36
+   *         1        15
+   *         2        25
+   *         4        96
+   *         8       318
+   *        16       985
+   *        32      2352
+   *        64      6008
+   *       128     19024
+   * 
+ * + * The computation of the area in these classes is via a 30th order series. + * This gives accurate results for \e b/\e a ∈ [1/2, 2]; the accuracy is + * about 8 decimal digits for \e b/\e a ∈ [1/4, 4]. + * + * See \ref geodellip for the formulation. See the documentation on the + * Geodesic class for additional information on the geodesics problems. + * + * Example of use: + * \include example-GeodesicExact.cpp + * + * Geod is a command-line utility providing access + * to the functionality of GeodesicExact and GeodesicLineExact (via the -E + * option). + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT GeodesicExact { + private: + typedef Math::real real; + friend class GeodesicLineExact; + static const int nC4_ = GEOGRAPHICLIB_GEODESICEXACT_ORDER; + static const int nC4x_ = (nC4_ * (nC4_ + 1)) / 2; + static const unsigned maxit1_ = 20; + static const unsigned maxit2_ = maxit1_ + + std::numeric_limits::digits + 10; + + static const real tiny_; + static const real tol0_; + static const real tol1_; + static const real tol2_; + static const real tolb_; + static const real xthresh_; + + enum captype { + CAP_NONE = 0U, + CAP_E = 1U<<0, + // Skip 1U<<1 for compatibility with Geodesic (not required) + CAP_D = 1U<<2, + CAP_H = 1U<<3, + CAP_C4 = 1U<<4, + CAP_ALL = 0x1FU, + OUT_ALL = 0x7F80U, + }; + + static real CosSeries(real sinx, real cosx, const real c[], int n) + throw(); + static inline real AngRound(real x) throw() { + // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^57 + // for reals = 0.7 pm on the earth if x is an angle in degrees. (This + // is about 1000 times more resolution than we get with angles around 90 + // degrees.) We use this to avoid having to deal with near singular + // cases when x is non-zero but tiny (e.g., 1.0e-200). + const real z = 1/real(16); + volatile real y = std::abs(x); + // The compiler mustn't "simplify" z - (z - y) to y + y = y < z ? z - (z - y) : y; + return x < 0 ? -y : y; + } + static inline void SinCosNorm(real& sinx, real& cosx) throw() { + real r = Math::hypot(sinx, cosx); + sinx /= r; + cosx /= r; + } + static real Astroid(real x, real y) throw(); + + real _a, _f, _f1, _e2, _ep2, _n, _b, _c2, _etol2; + real _C4x[nC4x_]; + + void Lengths(const EllipticFunction& E, + real sig12, + real ssig1, real csig1, real dn1, + real ssig2, real csig2, real dn2, + real cbet1, real cbet2, + real& s12s, real& m12a, real& m0, + bool scalep, real& M12, real& M21) const throw(); + real InverseStart(EllipticFunction& E, + real sbet1, real cbet1, real dn1, + real sbet2, real cbet2, real dn2, + real lam12, + real& salp1, real& calp1, + real& salp2, real& calp2, real& dnm) const throw(); + real Lambda12(real sbet1, real cbet1, real dn1, + real sbet2, real cbet2, real dn2, + real salp1, real calp1, + real& salp2, real& calp2, real& sig12, + real& ssig1, real& csig1, real& ssig2, real& csig2, + EllipticFunction& E, + real& omg12, bool diffp, real& dlam12) + const throw(); + + // These are Maxima generated functions to provide series approximations to + // the integrals for the area. + void C4coeff() throw(); + void C4f(real k2, real c[]) const throw(); + + public: + + /** + * Bit masks for what calculations to do. These masks do double duty. + * They signify to the GeodesicLineExact::GeodesicLineExact constructor and + * to GeodesicExact::Line what capabilities should be included in the + * GeodesicLineExact object. They also specify which results to return in + * the general routines GeodesicExact::GenDirect and + * GeodesicExact::GenInverse routines. GeodesicLineExact::mask is a + * duplication of this enum. + **********************************************************************/ + enum mask { + /** + * No capabilities, no output. + * @hideinitializer + **********************************************************************/ + NONE = 0U, + /** + * Calculate latitude \e lat2. (It's not necessary to include this as a + * capability to GeodesicLineExact because this is included by default.) + * @hideinitializer + **********************************************************************/ + LATITUDE = 1U<<7 | CAP_NONE, + /** + * Calculate longitude \e lon2. + * @hideinitializer + **********************************************************************/ + LONGITUDE = 1U<<8 | CAP_H, + /** + * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to + * include this as a capability to GeodesicLineExact because this is + * included by default.) + * @hideinitializer + **********************************************************************/ + AZIMUTH = 1U<<9 | CAP_NONE, + /** + * Calculate distance \e s12. + * @hideinitializer + **********************************************************************/ + DISTANCE = 1U<<10 | CAP_E, + /** + * Allow distance \e s12 to be used as input in the direct geodesic + * problem. + * @hideinitializer + **********************************************************************/ + DISTANCE_IN = 1U<<11 | CAP_E, + /** + * Calculate reduced length \e m12. + * @hideinitializer + **********************************************************************/ + REDUCEDLENGTH = 1U<<12 | CAP_D, + /** + * Calculate geodesic scales \e M12 and \e M21. + * @hideinitializer + **********************************************************************/ + GEODESICSCALE = 1U<<13 | CAP_D, + /** + * Calculate area \e S12. + * @hideinitializer + **********************************************************************/ + AREA = 1U<<14 | CAP_C4, + /** + * All capabilities, calculate everything. + * @hideinitializer + **********************************************************************/ + ALL = OUT_ALL| CAP_ALL, + }; + + /** \name Constructor + **********************************************************************/ + ///@{ + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @exception GeographicErr if \e a or (1 − \e f ) \e a is not + * positive. + **********************************************************************/ + GeodesicExact(real a, real f); + ///@} + + /** \name Direct geodesic problem specified in terms of distance. + **********************************************************************/ + ///@{ + /** + * Perform the direct geodesic calculation where the length of the geodesic + * is specified in terms of distance. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * signed. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). The values of + * \e lon2 and \e azi2 returned are in the range [−180°, + * 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + * + * The following functions are overloaded versions of GeodesicExact::Direct + * which omit some of the output parameters. Note, however, that the arc + * length is always computed and returned as the function value. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2, + real& m12, real& M12, real& M21, real& S12) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE | AREA, + lat2, lon2, azi2, t, m12, M12, M21, S12); + } + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE, + lat2, lon2, t, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH, + lat2, lon2, azi2, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2, real& m12) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH | REDUCEDLENGTH, + lat2, lon2, azi2, t, m12, t, t, t); + } + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2, + real& M12, real& M21) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH | GEODESICSCALE, + lat2, lon2, azi2, t, t, M12, M21, t); + } + + /** + * See the documentation for GeodesicExact::Direct. + **********************************************************************/ + Math::real Direct(real lat1, real lon1, real azi1, real s12, + real& lat2, real& lon2, real& azi2, + real& m12, real& M12, real& M21) + const throw() { + real t; + return GenDirect(lat1, lon1, azi1, false, s12, + LATITUDE | LONGITUDE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE, + lat2, lon2, azi2, t, m12, M12, M21, t); + } + ///@} + + /** \name Direct geodesic problem specified in terms of arc length. + **********************************************************************/ + ///@{ + /** + * Perform the direct geodesic calculation where the length of the geodesic + * is specified in terms of arc length. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] a12 arc length between point 1 and point 2 (degrees); it can + * be signed. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). The values of + * \e lon2 and \e azi2 returned are in the range [−180°, + * 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + * + * The following functions are overloaded versions of GeodesicExact::Direct + * which omit some of the output parameters. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, real& s12, + real& m12, real& M12, real& M21, real& S12) + const throw() { + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + REDUCEDLENGTH | GEODESICSCALE | AREA, + lat2, lon2, azi2, s12, m12, M12, M21, S12); + } + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE, + lat2, lon2, t, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH, + lat2, lon2, azi2, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, real& s12) + const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE, + lat2, lon2, azi2, s12, t, t, t, t); + } + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, + real& s12, real& m12) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + REDUCEDLENGTH, + lat2, lon2, azi2, s12, m12, t, t, t); + } + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, real& s12, + real& M12, real& M21) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + GEODESICSCALE, + lat2, lon2, azi2, s12, t, M12, M21, t); + } + + /** + * See the documentation for GeodesicExact::ArcDirect. + **********************************************************************/ + void ArcDirect(real lat1, real lon1, real azi1, real a12, + real& lat2, real& lon2, real& azi2, real& s12, + real& m12, real& M12, real& M21) const throw() { + real t; + GenDirect(lat1, lon1, azi1, true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + REDUCEDLENGTH | GEODESICSCALE, + lat2, lon2, azi2, s12, m12, M12, M21, t); + } + ///@} + + /** \name General version of the direct geodesic solution. + **********************************************************************/ + ///@{ + + /** + * The general direct geodesic calculation. GeodesicExact::Direct and + * GeodesicExact::ArcDirect are defined in terms of this function. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] arcmode boolean flag determining the meaning of the second + * parameter. + * @param[in] s12_a12 if \e arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be signed. + * @param[in] outmask a bitor'ed combination of GeodesicExact::mask values + * specifying which of the following parameters should be set. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The GeodesicExact::mask values possible for \e outmask are + * - \e outmask |= GeodesicExact::LATITUDE for the latitude \e lat2; + * - \e outmask |= GeodesicExact::LONGITUDE for the latitude \e lon2; + * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2; + * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12; + * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= GeodesicExact::AREA for the area \e S12; + * - \e outmask |= GeodesicExact::ALL for all of the above. + * . + * The function value \e a12 is always computed and returned and this + * equals \e s12_a12 is \e arcmode is true. If \e outmask includes + * GeodesicExact::DISTANCE and \e arcmode is false, then \e s12 = \e + * s12_a12. It is not necessary to include GeodesicExact::DISTANCE_IN in + * \e outmask; this is automatically included is \e arcmode is false. + **********************************************************************/ + Math::real GenDirect(real lat1, real lon1, real azi1, + bool arcmode, real s12_a12, unsigned outmask, + real& lat2, real& lon2, real& azi2, + real& s12, real& m12, real& M12, real& M21, + real& S12) const throw(); + ///@} + + /** \name Inverse geodesic problem. + **********************************************************************/ + ///@{ + /** + * Perform the inverse geodesic calculation. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] azi1 azimuth at point 1 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e lat1 and \e lat2 should be in the range [−90°, 90°]; \e + * lon1 and \e lon2 should be in the range [−540°, 540°). + * The values of \e azi1 and \e azi2 returned are in the range + * [−180°, 180°). + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), + * and taking the limit ε → 0+. + * + * The following functions are overloaded versions of GeodesicExact::Inverse + * which omit some of the output parameters. Note, however, that the arc + * length is always computed and returned as the function value. + **********************************************************************/ + 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 throw() { + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE | AREA, + s12, azi1, azi2, m12, M12, M21, S12); + } + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12) const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE, + s12, t, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& azi1, real& azi2) const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + AZIMUTH, + t, azi1, azi2, t, t, t, t); + } + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12, real& azi1, real& azi2) + const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH, + s12, azi1, azi2, t, t, t, t); + } + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12, real& azi1, real& azi2, real& m12) + const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH | REDUCEDLENGTH, + s12, azi1, azi2, m12, t, t, t); + } + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12, real& azi1, real& azi2, + real& M12, real& M21) const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH | GEODESICSCALE, + s12, azi1, azi2, t, M12, M21, t); + } + + /** + * See the documentation for GeodesicExact::Inverse. + **********************************************************************/ + Math::real Inverse(real lat1, real lon1, real lat2, real lon2, + real& s12, real& azi1, real& azi2, real& m12, + real& M12, real& M21) const throw() { + real t; + return GenInverse(lat1, lon1, lat2, lon2, + DISTANCE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE, + s12, azi1, azi2, m12, M12, M21, t); + } + ///@} + + /** \name General version of inverse geodesic solution. + **********************************************************************/ + ///@{ + /** + * The general inverse geodesic calculation. GeodesicExact::Inverse is + * defined in terms of this function. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[in] outmask a bitor'ed combination of GeodesicExact::mask values + * specifying which of the following parameters should be set. + * @param[out] s12 distance between point 1 and point 2 (meters). + * @param[out] azi1 azimuth at point 1 (degrees). + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters). + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless). + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless). + * @param[out] S12 area under the geodesic (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The GeodesicExact::mask values possible for \e outmask are + * - \e outmask |= GeodesicExact::DISTANCE for the distance \e s12; + * - \e outmask |= GeodesicExact::AZIMUTH for the latitude \e azi2; + * - \e outmask |= GeodesicExact::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= GeodesicExact::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= GeodesicExact::AREA for the area \e S12; + * - \e outmask |= GeodesicExact::ALL for all of the above. + * . + * The arc length is always computed and returned as the function value. + **********************************************************************/ + Math::real GenInverse(real lat1, real lon1, real lat2, real lon2, + unsigned outmask, + real& s12, real& azi1, real& azi2, + real& m12, real& M12, real& M21, real& S12) + const throw(); + ///@} + + /** \name Interface to GeodesicLineExact. + **********************************************************************/ + ///@{ + + /** + * Set up to compute several points on a single geodesic. + * + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of GeodesicExact::mask values + * specifying the capabilities the GeodesicLineExact object should + * possess, i.e., which quantities can be returned in calls to + * GeodesicLineExact::Position. + * @return a GeodesicLineExact object. + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). + * + * The GeodesicExact::mask values are + * - \e caps |= GeodesicExact::LATITUDE for the latitude \e lat2; this is + * added automatically; + * - \e caps |= GeodesicExact::LONGITUDE for the latitude \e lon2; + * - \e caps |= GeodesicExact::AZIMUTH for the azimuth \e azi2; this is + * added automatically; + * - \e caps |= GeodesicExact::DISTANCE for the distance \e s12; + * - \e caps |= GeodesicExact::REDUCEDLENGTH for the reduced length \e m12; + * - \e caps |= GeodesicExact::GEODESICSCALE for the geodesic scales \e M12 + * and \e M21; + * - \e caps |= GeodesicExact::AREA for the area \e S12; + * - \e caps |= GeodesicExact::DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length; + * - \e caps |= GeodesicExact::ALL for all of the above. + * . + * The default value of \e caps is GeodesicExact::ALL which turns on all + * the capabilities. + * + * If the point is at a pole, the azimuth is defined by keeping \e lon1 + * fixed, writing \e lat1 = ±(90 − ε), and taking the + * limit ε → 0+. + **********************************************************************/ + GeodesicLineExact Line(real lat1, real lon1, real azi1, unsigned caps = ALL) + const throw(); + + ///@} + + /** \name Inspector functions. + **********************************************************************/ + ///@{ + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _a; } + + /** + * @return \e f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _f; } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() { return 1/_f; } + /// \endcond + + /** + * @return total area of ellipsoid in meters2. The area of a + * polygon encircling a pole can be found by adding + * GeodesicExact::EllipsoidArea()/2 to the sum of \e S12 for each side of + * the polygon. + **********************************************************************/ + Math::real EllipsoidArea() const throw() + { return 4 * Math::pi() * _c2; } + ///@} + + /** + * A global instantiation of GeodesicExact with the parameters for the WGS84 + * ellipsoid. + **********************************************************************/ + static const GeodesicExact WGS84; + + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_GEODESICEXACT_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLine.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLine.hpp new file mode 100644 index 000000000..fd968e2cf --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLine.hpp @@ -0,0 +1,598 @@ +/** + * \file GeodesicLine.hpp + * \brief Header for GeographicLib::GeodesicLine class + * + * Copyright (c) Charles Karney (2009-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GEODESICLINE_HPP) +#define GEOGRAPHICLIB_GEODESICLINE_HPP 1 + +#include +#include + +namespace GeographicLib { + + /** + * \brief A geodesic line + * + * GeodesicLine facilitates the determination of a series of points on a + * single geodesic. The starting point (\e lat1, \e lon1) and the azimuth \e + * azi1 are specified in the constructor. GeodesicLine.Position returns the + * location of point 2 a distance \e s12 along the geodesic. Alternatively + * GeodesicLine.ArcPosition gives the position of point 2 an arc length \e + * a12 along the geodesic. + * + * The default copy constructor and assignment operators work with this + * class. Similarly, a vector can be used to hold GeodesicLine objects. + * + * The calculations are accurate to better than 15 nm (15 nanometers). See + * Sec. 9 of + * arXiv:1102.1215v1 for + * details. The algorithms used by this class are based on series expansions + * using the flattening \e f as a small parameter. These are only accurate + * for |f| < 0.02; however reasonably accurate results will be + * obtained for |f| < 0.2. For very eccentric ellipsoids, use + * GeodesicLineExact instead. + * + * The algorithms are described in + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * . + * For more information on geodesics see \ref geodesic. + * + * Example of use: + * \include example-GeodesicLine.cpp + * + * Geod is a command-line utility providing access + * to the functionality of Geodesic and GeodesicLine. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT GeodesicLine { + private: + typedef Math::real real; + friend class Geodesic; + static const int nC1_ = Geodesic::nC1_; + static const int nC1p_ = Geodesic::nC1p_; + static const int nC2_ = Geodesic::nC2_; + static const int nC3_ = Geodesic::nC3_; + static const int nC4_ = Geodesic::nC4_; + + real _lat1, _lon1, _azi1; + real _a, _f, _b, _c2, _f1, _salp0, _calp0, _k2, + _salp1, _calp1, _ssig1, _csig1, _dn1, _stau1, _ctau1, _somg1, _comg1, + _A1m1, _A2m1, _A3c, _B11, _B21, _B31, _A4, _B41; + // index zero elements of _C1a, _C1pa, _C2a, _C3a are unused + real _C1a[nC1_ + 1], _C1pa[nC1p_ + 1], _C2a[nC2_ + 1], _C3a[nC3_], + _C4a[nC4_]; // all the elements of _C4a are used + unsigned _caps; + + enum captype { + CAP_NONE = Geodesic::CAP_NONE, + CAP_C1 = Geodesic::CAP_C1, + CAP_C1p = Geodesic::CAP_C1p, + CAP_C2 = Geodesic::CAP_C2, + CAP_C3 = Geodesic::CAP_C3, + CAP_C4 = Geodesic::CAP_C4, + CAP_ALL = Geodesic::CAP_ALL, + OUT_ALL = Geodesic::OUT_ALL, + }; + public: + + /** + * Bit masks for what calculations to do. They signify to the + * GeodesicLine::GeodesicLine constructor and to Geodesic::Line what + * capabilities should be included in the GeodesicLine object. This is + * merely a duplication of Geodesic::mask. + **********************************************************************/ + enum mask { + /** + * No capabilities, no output. + * @hideinitializer + **********************************************************************/ + NONE = Geodesic::NONE, + /** + * Calculate latitude \e lat2. (It's not necessary to include this as a + * capability to GeodesicLine because this is included by default.) + * @hideinitializer + **********************************************************************/ + LATITUDE = Geodesic::LATITUDE, + /** + * Calculate longitude \e lon2. + * @hideinitializer + **********************************************************************/ + LONGITUDE = Geodesic::LONGITUDE, + /** + * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to + * include this as a capability to GeodesicLine because this is included + * by default.) + * @hideinitializer + **********************************************************************/ + AZIMUTH = Geodesic::AZIMUTH, + /** + * Calculate distance \e s12. + * @hideinitializer + **********************************************************************/ + DISTANCE = Geodesic::DISTANCE, + /** + * Allow distance \e s12 to be used as input in the direct geodesic + * problem. + * @hideinitializer + **********************************************************************/ + DISTANCE_IN = Geodesic::DISTANCE_IN, + /** + * Calculate reduced length \e m12. + * @hideinitializer + **********************************************************************/ + REDUCEDLENGTH = Geodesic::REDUCEDLENGTH, + /** + * Calculate geodesic scales \e M12 and \e M21. + * @hideinitializer + **********************************************************************/ + GEODESICSCALE = Geodesic::GEODESICSCALE, + /** + * Calculate area \e S12. + * @hideinitializer + **********************************************************************/ + AREA = Geodesic::AREA, + /** + * All capabilities, calculate everything. + * @hideinitializer + **********************************************************************/ + ALL = Geodesic::ALL, + }; + + /** \name Constructors + **********************************************************************/ + ///@{ + + /** + * Constructor for a geodesic line staring at latitude \e lat1, longitude + * \e lon1, and azimuth \e azi1 (all in degrees). + * + * @param[in] g A Geodesic object used to compute the necessary information + * about the GeodesicLine. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of GeodesicLine::mask values + * specifying the capabilities the GeodesicLine object should possess, + * i.e., which quantities can be returned in calls to + * GeodesicLine::Position. + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). + * + * The GeodesicLine::mask values are + * - \e caps |= GeodesicLine::LATITUDE for the latitude \e lat2; this is + * added automatically; + * - \e caps |= GeodesicLine::LONGITUDE for the latitude \e lon2; + * - \e caps |= GeodesicLine::AZIMUTH for the latitude \e azi2; this is + * added automatically; + * - \e caps |= GeodesicLine::DISTANCE for the distance \e s12; + * - \e caps |= GeodesicLine::REDUCEDLENGTH for the reduced length \e m12; + * - \e caps |= GeodesicLine::GEODESICSCALE for the geodesic scales \e M12 + * and \e M21; + * - \e caps |= GeodesicLine::AREA for the area \e S12; + * - \e caps |= GeodesicLine::DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length; + * - \e caps |= GeodesicLine::ALL for all of the above. + * . + * The default value of \e caps is GeodesicLine::ALL. + * + * If the point is at a pole, the azimuth is defined by keeping \e lon1 + * fixed, writing \e lat1 = ±(90° − ε), and taking + * the limit ε → 0+. + **********************************************************************/ + GeodesicLine(const Geodesic& g, real lat1, real lon1, real azi1, + unsigned caps = ALL) + throw(); + + /** + * A default constructor. If GeodesicLine::Position is called on the + * resulting object, it returns immediately (without doing any + * calculations). The object can be set with a call to Geodesic::Line. + * Use Init() to test whether object is still in this uninitialized state. + **********************************************************************/ + GeodesicLine() throw() : _caps(0U) {} + ///@} + + /** \name Position in terms of distance + **********************************************************************/ + ///@{ + + /** + * Compute the position of point 2 which is a distance \e s12 (meters) from + * point 1. + * + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLine object was constructed with \e caps |= + * GeodesicLine::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLine object was constructed with \e caps |= + * GeodesicLine::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= GeodesicLine::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= GeodesicLine::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLine object was constructed with \e caps |= + * GeodesicLine::AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The values of \e lon2 and \e azi2 returned are in the range + * [−180°, 180°). + * + * The GeodesicLine object \e must have been constructed with \e caps |= + * GeodesicLine::DISTANCE_IN; otherwise Math::NaN() is returned and no + * parameters are set. Requesting a value which the GeodesicLine object is + * not capable of computing is not an error; the corresponding argument + * will not be altered. + * + * The following functions are overloaded versions of + * GeodesicLine::Position which omit some of the output parameters. Note, + * however, that the arc length is always computed and returned as the + * function value. + **********************************************************************/ + Math::real Position(real s12, + real& lat2, real& lon2, real& azi2, + real& m12, real& M12, real& M21, + real& S12) const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE | AREA, + lat2, lon2, azi2, t, m12, M12, M21, S12); + } + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + Math::real Position(real s12, real& lat2, real& lon2) const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE, + lat2, lon2, t, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + Math::real Position(real s12, real& lat2, real& lon2, + real& azi2) const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | AZIMUTH, + lat2, lon2, azi2, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + Math::real Position(real s12, real& lat2, real& lon2, + real& azi2, real& m12) const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | + AZIMUTH | REDUCEDLENGTH, + lat2, lon2, azi2, t, m12, t, t, t); + } + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + Math::real Position(real s12, real& lat2, real& lon2, + real& azi2, real& M12, real& M21) + const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | + AZIMUTH | GEODESICSCALE, + lat2, lon2, azi2, t, t, M12, M21, t); + } + + /** + * See the documentation for GeodesicLine::Position. + **********************************************************************/ + Math::real Position(real s12, + real& lat2, real& lon2, real& azi2, + real& m12, real& M12, real& M21) + const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE, + lat2, lon2, azi2, t, m12, M12, M21, t); + } + + ///@} + + /** \name Position in terms of arc length + **********************************************************************/ + ///@{ + + /** + * Compute the position of point 2 which is an arc length \e a12 (degrees) + * from point 1. + * + * @param[in] a12 arc length between point 1 and point 2 (degrees); it can + * be negative. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLine object was constructed with \e caps |= + * GeodesicLine::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters); requires + * that the GeodesicLine object was constructed with \e caps |= + * GeodesicLine::DISTANCE. + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLine object was constructed with \e caps |= + * GeodesicLine::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= GeodesicLine::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= GeodesicLine::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLine object was constructed with \e caps |= + * GeodesicLine::AREA. + * + * The values of \e lon2 and \e azi2 returned are in the range + * [−180°, 180°). + * + * Requesting a value which the GeodesicLine object is not capable of + * computing is not an error; the corresponding argument will not be + * altered. + * + * The following functions are overloaded versions of + * GeodesicLine::ArcPosition which omit some of the output parameters. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12, real& m12, real& M12, real& M21, + real& S12) const throw() { + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + REDUCEDLENGTH | GEODESICSCALE | AREA, + lat2, lon2, azi2, s12, m12, M12, M21, S12); + } + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2) + const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE, + lat2, lon2, t, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, + real& lat2, real& lon2, real& azi2) + const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH, + lat2, lon2, azi2, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12) const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE, + lat2, lon2, azi2, s12, t, t, t, t); + } + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12, real& m12) const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | + DISTANCE | REDUCEDLENGTH, + lat2, lon2, azi2, s12, m12, t, t, t); + } + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12, real& M12, real& M21) + const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | + DISTANCE | GEODESICSCALE, + lat2, lon2, azi2, s12, t, M12, M21, t); + } + + /** + * See the documentation for GeodesicLine::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12, real& m12, real& M12, real& M21) + const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | + DISTANCE | REDUCEDLENGTH | GEODESICSCALE, + lat2, lon2, azi2, s12, m12, M12, M21, t); + } + ///@} + + /** \name The general position function. + **********************************************************************/ + ///@{ + + /** + * The general position function. GeodesicLine::Position and + * GeodesicLine::ArcPosition are defined in terms of this function. + * + * @param[in] arcmode boolean flag determining the meaning of the second + * parameter; if arcmode is false, then the GeodesicLine object must have + * been constructed with \e caps |= GeodesicLine::DISTANCE_IN. + * @param[in] s12_a12 if \e arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be negative. + * @param[in] outmask a bitor'ed combination of GeodesicLine::mask values + * specifying which of the following parameters should be set. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLine object was constructed with \e caps |= + * GeodesicLine::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters); requires + * that the GeodesicLine object was constructed with \e caps |= + * GeodesicLine::DISTANCE. + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLine object was constructed with \e caps |= + * GeodesicLine::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= GeodesicLine::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLine object was constructed + * with \e caps |= GeodesicLine::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLine object was constructed with \e caps |= + * GeodesicLine::AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The GeodesicLine::mask values possible for \e outmask are + * - \e outmask |= GeodesicLine::LATITUDE for the latitude \e lat2; + * - \e outmask |= GeodesicLine::LONGITUDE for the latitude \e lon2; + * - \e outmask |= GeodesicLine::AZIMUTH for the latitude \e azi2; + * - \e outmask |= GeodesicLine::DISTANCE for the distance \e s12; + * - \e outmask |= GeodesicLine::REDUCEDLENGTH for the reduced length \e + * m12; + * - \e outmask |= GeodesicLine::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e outmask |= GeodesicLine::AREA for the area \e S12; + * - \e outmask |= GeodesicLine::ALL for all of the above. + * . + * Requesting a value which the GeodesicLine object is not capable of + * computing is not an error; the corresponding argument will not be + * altered. Note, however, that the arc length is always computed and + * returned as the function value. + **********************************************************************/ + Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, + real& lat2, real& lon2, real& azi2, + real& s12, real& m12, real& M12, real& M21, + real& S12) const throw(); + + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + + /** + * @return true if the object has been initialized. + **********************************************************************/ + bool Init() const throw() { return _caps != 0U; } + + /** + * @return \e lat1 the latitude of point 1 (degrees). + **********************************************************************/ + Math::real Latitude() const throw() + { return Init() ? _lat1 : Math::NaN(); } + + /** + * @return \e lon1 the longitude of point 1 (degrees). + **********************************************************************/ + Math::real Longitude() const throw() + { return Init() ? _lon1 : Math::NaN(); } + + /** + * @return \e azi1 the azimuth (degrees) of the geodesic line at point 1. + **********************************************************************/ + Math::real Azimuth() const throw() + { return Init() ? _azi1 : Math::NaN(); } + + /** + * @return \e azi0 the azimuth (degrees) of the geodesic line as it crosses + * the equator in a northward direction. + **********************************************************************/ + Math::real EquatorialAzimuth() const throw() { + return Init() ? + atan2(_salp0, _calp0) / Math::degree() : Math::NaN(); + } + + /** + * @return \e a1 the arc length (degrees) between the northward equatorial + * crossing and point 1. + **********************************************************************/ + Math::real EquatorialArc() const throw() { + return Init() ? + atan2(_ssig1, _csig1) / Math::degree() : Math::NaN(); + } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() + { return Init() ? _a : Math::NaN(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() + { return Init() ? _f : Math::NaN(); } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return Init() ? 1/_f : Math::NaN(); } + /// \endcond + + /** + * @return \e caps the computational capabilities that this object was + * constructed with. LATITUDE and AZIMUTH are always included. + **********************************************************************/ + unsigned Capabilities() const throw() { return _caps; } + + /** + * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values. + * @return true if the GeodesicLine object has all these capabilities. + **********************************************************************/ + bool Capabilities(unsigned testcaps) const throw() { + testcaps &= OUT_ALL; + return (_caps & testcaps) == testcaps; + } + ///@} + + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_GEODESICLINE_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLineExact.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLineExact.hpp new file mode 100644 index 000000000..ca7d0d211 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLineExact.hpp @@ -0,0 +1,573 @@ +/** + * \file GeodesicLineExact.hpp + * \brief Header for GeographicLib::GeodesicLineExact class + * + * Copyright (c) Charles Karney (2012) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GEODESICLINEEXACT_HPP) +#define GEOGRAPHICLIB_GEODESICLINEEXACT_HPP 1 + +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief An exact geodesic line + * + * GeodesicLineExact facilitates the determination of a series of points on a + * single geodesic. This is a companion to the GeodesicExact class. For + * additional information on this class see the documentation on the + * GeodesicLine class. + * + * Example of use: + * \include example-GeodesicLineExact.cpp + * + * Geod is a command-line utility providing access + * to the functionality of GeodesicExact and GeodesicLineExact (via the -E + * option). + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT GeodesicLineExact { + private: + typedef Math::real real; + friend class GeodesicExact; + static const int nC4_ = GeodesicExact::nC4_; + + real _lat1, _lon1, _azi1; + real _a, _f, _b, _c2, _f1, _e2, _salp0, _calp0, _k2, + _salp1, _calp1, _ssig1, _csig1, _dn1, _stau1, _ctau1, + _somg1, _comg1, _cchi1, + _A4, _B41, _E0, _D0, _H0, _E1, _D1, _H1; + real _C4a[nC4_]; // all the elements of _C4a are used + EllipticFunction _E; + unsigned _caps; + + enum captype { + CAP_NONE = GeodesicExact::CAP_NONE, + CAP_E = GeodesicExact::CAP_E, + CAP_D = GeodesicExact::CAP_D, + CAP_H = GeodesicExact::CAP_H, + CAP_C4 = GeodesicExact::CAP_C4, + CAP_ALL = GeodesicExact::CAP_ALL, + OUT_ALL = GeodesicExact::OUT_ALL, + }; + public: + + /** + * Bit masks for what calculations to do. They signify to the + * GeodesicLineExact::GeodesicLineExact constructor and to + * GeodesicExact::Line what capabilities should be included in the + * GeodesicLineExact object. This is merely a duplication of + * GeodesicExact::mask. + **********************************************************************/ + enum mask { + /** + * No capabilities, no output. + * @hideinitializer + **********************************************************************/ + NONE = GeodesicExact::NONE, + /** + * Calculate latitude \e lat2. (It's not necessary to include this as a + * capability to GeodesicLineExact because this is included by default.) + * @hideinitializer + **********************************************************************/ + LATITUDE = GeodesicExact::LATITUDE, + /** + * Calculate longitude \e lon2. + * @hideinitializer + **********************************************************************/ + LONGITUDE = GeodesicExact::LONGITUDE, + /** + * Calculate azimuths \e azi1 and \e azi2. (It's not necessary to + * include this as a capability to GeodesicLineExact because this is + * included by default.) + * @hideinitializer + **********************************************************************/ + AZIMUTH = GeodesicExact::AZIMUTH, + /** + * Calculate distance \e s12. + * @hideinitializer + **********************************************************************/ + DISTANCE = GeodesicExact::DISTANCE, + /** + * Allow distance \e s12 to be used as input in the direct geodesic + * problem. + * @hideinitializer + **********************************************************************/ + DISTANCE_IN = GeodesicExact::DISTANCE_IN, + /** + * Calculate reduced length \e m12. + * @hideinitializer + **********************************************************************/ + REDUCEDLENGTH = GeodesicExact::REDUCEDLENGTH, + /** + * Calculate geodesic scales \e M12 and \e M21. + * @hideinitializer + **********************************************************************/ + GEODESICSCALE = GeodesicExact::GEODESICSCALE, + /** + * Calculate area \e S12. + * @hideinitializer + **********************************************************************/ + AREA = GeodesicExact::AREA, + /** + * All capabilities, calculate everything. + * @hideinitializer + **********************************************************************/ + ALL = GeodesicExact::ALL, + }; + + /** \name Constructors + **********************************************************************/ + ///@{ + + /** + * Constructor for a geodesic line staring at latitude \e lat1, longitude + * \e lon1, and azimuth \e azi1 (all in degrees). + * + * @param[in] g A GeodesicExact object used to compute the necessary + * information about the GeodesicLineExact. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of GeodesicLineExact::mask values + * specifying the capabilities the GeodesicLineExact object should + * possess, i.e., which quantities can be returned in calls to + * GeodesicLine::Position. + * + * \e lat1 should be in the range [−90°, 90°]; \e lon1 and \e + * azi1 should be in the range [−540°, 540°). + * + * The GeodesicLineExact::mask values are + * - \e caps |= GeodesicLineExact::LATITUDE for the latitude \e lat2; this + * is added automatically; + * - \e caps |= GeodesicLineExact::LONGITUDE for the latitude \e lon2; + * - \e caps |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; this is + * added automatically; + * - \e caps |= GeodesicLineExact::DISTANCE for the distance \e s12; + * - \e caps |= GeodesicLineExact::REDUCEDLENGTH for the reduced length \e + m12; + * - \e caps |= GeodesicLineExact::GEODESICSCALE for the geodesic scales \e + * M12 and \e M21; + * - \e caps |= GeodesicLineExact::AREA for the area \e S12; + * - \e caps |= GeodesicLineExact::DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length; + * - \e caps |= GeodesicLineExact::ALL for all of the above. + * . + * The default value of \e caps is GeodesicLineExact::ALL. + * + * If the point is at a pole, the azimuth is defined by keeping \e lon1 + * fixed, writing \e lat1 = ±(90° − ε), and taking + * the limit ε → 0+. + **********************************************************************/ + GeodesicLineExact(const GeodesicExact& g, real lat1, real lon1, real azi1, + unsigned caps = ALL) + throw(); + + /** + * A default constructor. If GeodesicLineExact::Position is called on the + * resulting object, it returns immediately (without doing any + * calculations). The object can be set with a call to + * GeodesicExact::Line. Use Init() to test whether object is still in this + * uninitialized state. + **********************************************************************/ + GeodesicLineExact() throw() : _caps(0U) {} + ///@} + + /** \name Position in terms of distance + **********************************************************************/ + ///@{ + + /** + * Compute the position of point 2 which is a distance \e s12 (meters) + * from point 1. + * + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * signed. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The values of \e lon2 and \e azi2 returned are in the range + * [−180°, 180°). + * + * The GeodesicLineExact object \e must have been constructed with \e caps + * |= GeodesicLineExact::DISTANCE_IN; otherwise Math::NaN() is returned and + * no parameters are set. Requesting a value which the GeodesicLineExact + * object is not capable of computing is not an error; the corresponding + * argument will not be altered. + * + * The following functions are overloaded versions of + * GeodesicLineExact::Position which omit some of the output parameters. + * Note, however, that the arc length is always computed and returned as + * the function value. + **********************************************************************/ + Math::real Position(real s12, + real& lat2, real& lon2, real& azi2, + real& m12, real& M12, real& M21, + real& S12) const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE | AREA, + lat2, lon2, azi2, t, m12, M12, M21, S12); + } + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + Math::real Position(real s12, real& lat2, real& lon2) const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE, + lat2, lon2, t, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + Math::real Position(real s12, real& lat2, real& lon2, + real& azi2) const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | AZIMUTH, + lat2, lon2, azi2, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + Math::real Position(real s12, real& lat2, real& lon2, + real& azi2, real& m12) const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | + AZIMUTH | REDUCEDLENGTH, + lat2, lon2, azi2, t, m12, t, t, t); + } + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + Math::real Position(real s12, real& lat2, real& lon2, + real& azi2, real& M12, real& M21) + const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | + AZIMUTH | GEODESICSCALE, + lat2, lon2, azi2, t, t, M12, M21, t); + } + + /** + * See the documentation for GeodesicLineExact::Position. + **********************************************************************/ + Math::real Position(real s12, + real& lat2, real& lon2, real& azi2, + real& m12, real& M12, real& M21) + const throw() { + real t; + return GenPosition(false, s12, + LATITUDE | LONGITUDE | AZIMUTH | + REDUCEDLENGTH | GEODESICSCALE, + lat2, lon2, azi2, t, m12, M12, M21, t); + } + + ///@} + + /** \name Position in terms of arc length + **********************************************************************/ + ///@{ + + /** + * Compute the position of point 2 which is an arc length \e a12 (degrees) + * from point 1. + * + * @param[in] a12 arc length between point 1 and point 2 (degrees); it can + * be signed. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::DISTANCE. + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::AREA. + * + * The values of \e lon2 and \e azi2 returned are in the range + * [−180°, 180°). + * + * Requesting a value which the GeodesicLineExact object is not capable of + * computing is not an error; the corresponding argument will not be + * altered. + * + * The following functions are overloaded versions of + * GeodesicLineExact::ArcPosition which omit some of the output parameters. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12, real& m12, real& M12, real& M21, + real& S12) const throw() { + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE | + REDUCEDLENGTH | GEODESICSCALE | AREA, + lat2, lon2, azi2, s12, m12, M12, M21, S12); + } + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2) + const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE, + lat2, lon2, t, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, + real& lat2, real& lon2, real& azi2) + const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH, + lat2, lon2, azi2, t, t, t, t, t); + } + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12) const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | DISTANCE, + lat2, lon2, azi2, s12, t, t, t, t); + } + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12, real& m12) const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | + DISTANCE | REDUCEDLENGTH, + lat2, lon2, azi2, s12, m12, t, t, t); + } + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12, real& M12, real& M21) + const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | + DISTANCE | GEODESICSCALE, + lat2, lon2, azi2, s12, t, M12, M21, t); + } + + /** + * See the documentation for GeodesicLineExact::ArcPosition. + **********************************************************************/ + void ArcPosition(real a12, real& lat2, real& lon2, real& azi2, + real& s12, real& m12, real& M12, real& M21) + const throw() { + real t; + GenPosition(true, a12, + LATITUDE | LONGITUDE | AZIMUTH | + DISTANCE | REDUCEDLENGTH | GEODESICSCALE, + lat2, lon2, azi2, s12, m12, M12, M21, t); + } + ///@} + + /** \name The general position function. + **********************************************************************/ + ///@{ + + /** + * The general position function. GeodesicLineExact::Position and + * GeodesicLineExact::ArcPosition are defined in terms of this function. + * + * @param[in] arcmode boolean flag determining the meaning of the second + * parameter; if arcmode is false, then the GeodesicLineExact object must + * have been constructed with \e caps |= GeodesicLineExact::DISTANCE_IN. + * @param[in] s12_a12 if \e arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be signed. + * @param[in] outmask a bitor'ed combination of GeodesicLineExact::mask + * values specifying which of the following parameters should be set. + * @param[out] lat2 latitude of point 2 (degrees). + * @param[out] lon2 longitude of point 2 (degrees); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::LONGITUDE. + * @param[out] azi2 (forward) azimuth at point 2 (degrees). + * @param[out] s12 distance between point 1 and point 2 (meters); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::DISTANCE. + * @param[out] m12 reduced length of geodesic (meters); requires that the + * GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::REDUCEDLENGTH. + * @param[out] M12 geodesic scale of point 2 relative to point 1 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] M21 geodesic scale of point 1 relative to point 2 + * (dimensionless); requires that the GeodesicLineExact object was + * constructed with \e caps |= GeodesicLineExact::GEODESICSCALE. + * @param[out] S12 area under the geodesic (meters2); requires + * that the GeodesicLineExact object was constructed with \e caps |= + * GeodesicLineExact::AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * The GeodesicLineExact::mask values possible for \e outmask are + * - \e outmask |= GeodesicLineExact::LATITUDE for the latitude \e lat2; + * - \e outmask |= GeodesicLineExact::LONGITUDE for the latitude \e lon2; + * - \e outmask |= GeodesicLineExact::AZIMUTH for the latitude \e azi2; + * - \e outmask |= GeodesicLineExact::DISTANCE for the distance \e s12; + * - \e outmask |= GeodesicLineExact::REDUCEDLENGTH for the reduced length + * \e m12; + * - \e outmask |= GeodesicLineExact::GEODESICSCALE for the geodesic scales + * \e M12 and \e M21; + * - \e outmask |= GeodesicLineExact::AREA for the area \e S12; + * - \e outmask |= GeodesicLine::ALL for all of the above. + * . + * Requesting a value which the GeodesicLineExact object is not capable of + * computing is not an error; the corresponding argument will not be + * altered. Note, however, that the arc length is always computed and + * returned as the function value. + **********************************************************************/ + Math::real GenPosition(bool arcmode, real s12_a12, unsigned outmask, + real& lat2, real& lon2, real& azi2, + real& s12, real& m12, real& M12, real& M21, + real& S12) const throw(); + + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + + /** + * @return true if the object has been initialized. + **********************************************************************/ + bool Init() const throw() { return _caps != 0U; } + + /** + * @return \e lat1 the latitude of point 1 (degrees). + **********************************************************************/ + Math::real Latitude() const throw() + { return Init() ? _lat1 : Math::NaN(); } + + /** + * @return \e lon1 the longitude of point 1 (degrees). + **********************************************************************/ + Math::real Longitude() const throw() + { return Init() ? _lon1 : Math::NaN(); } + + /** + * @return \e azi1 the azimuth (degrees) of the geodesic line at point 1. + **********************************************************************/ + Math::real Azimuth() const throw() + { return Init() ? _azi1 : Math::NaN(); } + + /** + * @return \e azi0 the azimuth (degrees) of the geodesic line as it crosses + * the equator in a northward direction. + **********************************************************************/ + Math::real EquatorialAzimuth() const throw() { + return Init() ? + atan2(_salp0, _calp0) / Math::degree() : Math::NaN(); + } + + /** + * @return \e a1 the arc length (degrees) between the northward equatorial + * crossing and point 1. + **********************************************************************/ + Math::real EquatorialArc() const throw() { + return Init() ? + atan2(_ssig1, _csig1) / Math::degree() : Math::NaN(); + } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the GeodesicExact object used in the + * constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() + { return Init() ? _a : Math::NaN(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the GeodesicExact object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() + { return Init() ? _f : Math::NaN(); } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return Init() ? 1/_f : Math::NaN(); } + /// \endcond + + /** + * @return \e caps the computational capabilities that this object was + * constructed with. LATITUDE and AZIMUTH are always included. + **********************************************************************/ + unsigned Capabilities() const throw() { return _caps; } + + /** + * @param[in] testcaps a set of bitor'ed GeodesicLineExact::mask values. + * @return true if the GeodesicLineExact object has all these capabilities. + **********************************************************************/ + bool Capabilities(unsigned testcaps) const throw() { + testcaps &= OUT_ALL; + return (_caps & testcaps) == testcaps; + } + ///@} + + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_GEODESICLINEEXACT_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geohash.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geohash.hpp new file mode 100644 index 000000000..0533afcd5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geohash.hpp @@ -0,0 +1,179 @@ +/** + * \file Geohash.hpp + * \brief Header for GeographicLib::Geohash class + * + * Copyright (c) Charles Karney (2012) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GEOHASH_HPP) +#define GEOGRAPHICLIB_GEOHASH_HPP 1 + +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs string +# pragma warning (push) +# pragma warning (disable: 4251) +#endif + +namespace GeographicLib { + + /** + * \brief Conversions for geohashes + * + * Geohashes are described in + * - http://en.wikipedia.org/wiki/Geohash + * - http://geohash.org/ + * . + * They provide a compact string representation of a particular geographic + * location (expressed as latitude and longitude), with the property that if + * trailing characters are dropped from the string the geographic location + * remains nearby. + * + * Example of use: + * \include example-Geohash.cpp + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT Geohash { + private: + typedef Math::real real; + static const int maxlen_ = 18; + static const unsigned long long mask_ = 1ULL << 45; + static const int decprec_[]; + static const real loneps_; + static const real lateps_; + static const real shift_; + static const std::string lcdigits_; + static const std::string ucdigits_; + Geohash(); // Disable constructor + + public: + + /** + * Convert from geographic coordinates to a geohash. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] len the length of the resulting geohash. + * @param[out] geohash the geohash. + * @exception GeographicErr if \e la is not in [−90°, + * 90°]. + * @exception GeographicErr if \e lon is not in [−540°, + * 540°). + * @exception std::bad_alloc if memory for \e geohash can't be allocated. + * + * Internally, \e len is first put in the range [0, 18]. + * + * If \e lat or \e lon is NaN, the returned geohash is "nan". + **********************************************************************/ + static void Forward(real lat, real lon, int len, std::string& geohash); + + /** + * Convert from a geohash to geographic coordinates. + * + * @param[in] geohash the geohash. + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] len the length of the geohash. + * @param[in] centerp if true (the default) return the center of the + * geohash location, otherwise return the south-west corner. + * @exception GeographicErr if \e geohash contains illegal characters. + * + * Only the first 18 characters for \e geohash are considered. The case of + * the letters in \e geohash is ignored. + * + * If the first three characters in \e geohash are "nan", then \e lat and + * \e lon are set to NaN. + **********************************************************************/ + static void Reverse(const std::string& geohash, real& lat, real& lon, + int& len, bool centerp = true); + + /** + * The latitude resolution of a geohash. + * + * @param[in] len the length of the geohash. + * @return the latitude resolution (degrees). + * + * Internally, \e len is first put in the range [0, 18]. + **********************************************************************/ + static Math::real LatitudeResolution(int len) throw() { + len = (std::max)(0, (std::min)(int(maxlen_), len)); + return 180 * std::pow(0.5, 5 * len / 2); + } + + /** + * The longitude resolution of a geohash. + * + * @param[in] len the length of the geohash. + * @return the longitude resolution (degrees). + * + * Internally, \e len is first put in the range [0, 18]. + **********************************************************************/ + static Math::real LongitudeResolution(int len) throw() { + len = (std::max)(0, (std::min)(int(maxlen_), len)); + return 360 * std::pow(0.5, 5 * len - 5 * len / 2); + } + + /** + * The geohash length required to meet a given geographic resolution. + * + * @param[in] res the minimum of resolution in latitude and longitude + * (degrees). + * @return geohash length. + * + * The returned length is in the range [0, 18]. + **********************************************************************/ + static int GeohashLength(real res) throw() { + res = std::abs(res); + for (int len = 0; len < maxlen_; ++len) + if (LongitudeResolution(len) <= res) + return len; + return maxlen_; + } + + /** + * The geohash length required to meet a given geographic resolution. + * + * @param[in] latres the resolution in latitude (degrees). + * @param[in] lonres the resolution in longitude (degrees). + * @return geohash length. + * + * The returned length is in the range [0, 18]. + **********************************************************************/ + static int GeohashLength(real latres, real lonres) throw() { + latres = std::abs(latres); + lonres = std::abs(lonres); + for (int len = 0; len < maxlen_; ++len) + if (LatitudeResolution(len) <= latres && + LongitudeResolution(len) <= lonres) + return len; + return maxlen_; + } + + /** + * The decimal geographic precision required to match a given geohash + * length. This is the number of digits needed after decimal point in a + * decimal degrees representation. + * + * @param[in] len the length of the geohash. + * @return the decimal precision (may be negative). + * + * Internally, \e len is first put in the range [0, 18]. The returned + * decimal precision is in the range [−2, 12]. + **********************************************************************/ + static int DecimalPrecision(int len) throw() { + return -int(std::floor(std::log(LatitudeResolution(len))/ + std::log(Math::real(10)))); + } + + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_GEOHASH_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geoid.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geoid.hpp new file mode 100644 index 000000000..0a4537206 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geoid.hpp @@ -0,0 +1,510 @@ +/** + * \file Geoid.hpp + * \brief Header for GeographicLib::Geoid class + * + * Copyright (c) Charles Karney (2009-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GEOID_HPP) +#define GEOGRAPHICLIB_GEOID_HPP 1 + +#include +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs vector and constant conditional expressions +# pragma warning (push) +# pragma warning (disable: 4251 4127) +#endif + +#if !defined(PGM_PIXEL_WIDTH) +/** + * The size of the pixel data in the pgm data files for the geoids. 2 is the + * standard size corresponding to a maxval 216−1. Setting it + * to 4 uses a maxval of 232−1 and changes the extension for + * the data files from .pgm to .pgm4. Note that the format of these pgm4 files + * is a non-standard extension of the pgm format. + **********************************************************************/ +# define PGM_PIXEL_WIDTH 2 +#endif + +namespace GeographicLib { + + /** + * \brief Looking up the height of the geoid + * + * This class evaluated the height of one of the standard geoids, EGM84, + * EGM96, or EGM2008 by bilinear or cubic interpolation into a rectangular + * grid of data. These geoid models are documented in + * - EGM84: + * http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html + * - EGM96: + * http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html + * - EGM2008: + * http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008 + * + * The geoids are defined in terms of spherical harmonics. However in order + * to provide a quick and flexible method of evaluating the geoid heights, + * this class evaluates the height by interpolation into a grid of + * precomputed values. + * + * See \ref geoid for details of how to install the data sets, the data + * format, estimates of the interpolation errors, and how to use caching. + * + * In addition to returning the geoid height, the gradient of the geoid can + * be calculated. The gradient is defined as the rate of change of the geoid + * as a function of position on the ellipsoid. This uses the parameters for + * the WGS84 ellipsoid. The gradient defined in terms of the interpolated + * heights. As a result of the way that the geoid data is stored, the + * calculation of gradients can result in large quantization errors. This is + * particularly acute for fine grids, at high latitudes, and for the easterly + * gradient. + * + * This class is typically \e not thread safe in that a single instantiation + * cannot be safely used by multiple threads because of the way the object + * reads the data set and because it maintains a single-cell cache. If + * multiple threads need to calculate geoid heights they should all construct + * thread-local instantiations. Alternatively, set the optional \e + * threadsafe parameter to true in the constructor. This causes the + * constructor to read all the data into memory and to turn off the + * single-cell caching which results in a Geoid object which \e is thread + * safe. + * + * Example of use: + * \include example-Geoid.cpp + * + * GeoidEval is a command-line utility + * providing access to the functionality of Geoid. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT Geoid { + private: + typedef Math::real real; +#if PGM_PIXEL_WIDTH != 4 + typedef unsigned short pixel_t; + static const unsigned pixel_size_ = 2; + static const unsigned pixel_max_ = 0xffffu; +#else + typedef unsigned pixel_t; + static const unsigned pixel_size_ = 4; + static const unsigned pixel_max_ = 0xffffffffu; +#endif + static const unsigned stencilsize_ = 12; + static const unsigned nterms_ = ((3 + 1) * (3 + 2))/2; // for a cubic fit + static const real c0_; + static const real c0n_; + static const real c0s_; + static const real c3_[stencilsize_ * nterms_]; + static const real c3n_[stencilsize_ * nterms_]; + static const real c3s_[stencilsize_ * nterms_]; + + std::string _name, _dir, _filename; + const bool _cubic; + const real _a, _e2, _degree, _eps; + mutable std::ifstream _file; + real _rlonres, _rlatres; + std::string _description, _datetime; + real _offset, _scale, _maxerror, _rmserror; + int _width, _height; + unsigned long long _datastart, _swidth; + bool _threadsafe; + // Area cache + mutable std::vector< std::vector > _data; + mutable bool _cache; + // NE corner and extent of cache + mutable int _xoffset, _yoffset, _xsize, _ysize; + // Cell cache + mutable int _ix, _iy; + mutable real _v00, _v01, _v10, _v11; + mutable real _t[nterms_]; + void filepos(int ix, int iy) const { + _file.seekg( +#if !(defined(__GNUC__) && __GNUC__ < 4) + // g++ 3.x doesn't know about the cast to streamoff. + std::ios::streamoff +#endif + (_datastart + + pixel_size_ * (unsigned(iy)*_swidth + unsigned(ix)))); + } + real rawval(int ix, int iy) const { + if (ix < 0) + ix += _width; + else if (ix >= _width) + ix -= _width; + if (_cache && iy >= _yoffset && iy < _yoffset + _ysize && + ((ix >= _xoffset && ix < _xoffset + _xsize) || + (ix + _width >= _xoffset && ix + _width < _xoffset + _xsize))) { + return real(_data[iy - _yoffset] + [ix >= _xoffset ? ix - _xoffset : ix + _width - _xoffset]); + } else { + if (iy < 0 || iy >= _height) { + iy = iy < 0 ? -iy : 2 * (_height - 1) - iy; + ix += (ix < _width/2 ? 1 : -1) * _width/2; + } + try { + filepos(ix, iy); + char a, b; + _file.get(a); + _file.get(b); + unsigned r = ((unsigned char)(a) << 8) | (unsigned char)(b); + if (pixel_size_ == 4) { + _file.get(a); + _file.get(b); + r = (r << 16) | ((unsigned char)(a) << 8) | (unsigned char)(b); + } + return real(r); + } + catch (const std::exception& e) { + // throw GeographicErr("Error reading " + _filename + ": " + // + e.what()); + // triggers complaints about the "binary '+'" under Visual Studio. + // So use '+=' instead. + std::string err("Error reading "); + err += _filename; + err += ": "; + err += e.what(); + throw GeographicErr(err); + } + } + } + real height(real lat, real lon, bool gradp, + real& grade, real& gradn) const; + Geoid(const Geoid&); // copy constructor not allowed + Geoid& operator=(const Geoid&); // copy assignment not allowed + public: + + /** + * Flags indicating conversions between heights above the geoid and heights + * above the ellipsoid. + **********************************************************************/ + enum convertflag { + /** + * The multiplier for converting from heights above the geoid to heights + * above the ellipsoid. + **********************************************************************/ + ELLIPSOIDTOGEOID = -1, + /** + * No conversion. + **********************************************************************/ + NONE = 0, + /** + * The multiplier for converting from heights above the ellipsoid to + * heights above the geoid. + **********************************************************************/ + GEOIDTOELLIPSOID = 1, + }; + + /** \name Setting up the geoid + **********************************************************************/ + ///@{ + /** + * Construct a geoid. + * + * @param[in] name the name of the geoid. + * @param[in] path (optional) directory for data file. + * @param[in] cubic (optional) interpolation method; false means bilinear, + * true (the default) means cubic. + * @param[in] threadsafe (optional), if true, construct a thread safe + * object. The default is false + * @exception GeographicErr if the data file cannot be found, is + * unreadable, or is corrupt. + * @exception GeographicErr if \e threadsafe is true but the memory + * necessary for caching the data can't be allocated. + * + * The data file is formed by appending ".pgm" to the name. If \e path is + * specified (and is non-empty), then the file is loaded from directory, \e + * path. Otherwise the path is given by DefaultGeoidPath(). If the \e + * threadsafe parameter is true, the data set is read into memory, the data + * file is closed, and single-cell caching is turned off; this results in a + * Geoid object which \e is thread safe. + **********************************************************************/ + explicit Geoid(const std::string& name, const std::string& path = "", + bool cubic = true, bool threadsafe = false); + + /** + * Set up a cache. + * + * @param[in] south latitude (degrees) of the south edge of the cached area. + * @param[in] west longitude (degrees) of the west edge of the cached area. + * @param[in] north latitude (degrees) of the north edge of the cached area. + * @param[in] east longitude (degrees) of the east edge of the cached area. + * @exception GeographicErr if the memory necessary for caching the data + * can't be allocated (in this case, you will have no cache and can try + * again with a smaller area). + * @exception GeographicErr if there's a problem reading the data. + * @exception GeographicErr if this is called on a threadsafe Geoid. + * + * Cache the data for the specified "rectangular" area bounded by the + * parallels \e south and \e north and the meridians \e west and \e east. + * \e east is always interpreted as being east of \e west, if necessary by + * adding 360° to its value. \e south and \e north should be in + * the range [−90°, 90°]; \e west and \e east should + * be in the range [−540°, 540°). + **********************************************************************/ + void CacheArea(real south, real west, real north, real east) const; + + /** + * Cache all the data. + * + * @exception GeographicErr if the memory necessary for caching the data + * can't be allocated (in this case, you will have no cache and can try + * again with a smaller area). + * @exception GeographicErr if there's a problem reading the data. + * @exception GeographicErr if this is called on a threadsafe Geoid. + * + * On most computers, this is fast for data sets with grid resolution of 5' + * or coarser. For a 1' grid, the required RAM is 450MB; a 2.5' grid needs + * 72MB; and a 5' grid needs 18MB. + **********************************************************************/ + void CacheAll() const { CacheArea(real(-90), real(0), + real(90), real(360)); } + + /** + * Clear the cache. This never throws an error. (This does nothing with a + * thread safe Geoid.) + **********************************************************************/ + void CacheClear() const throw(); + + ///@} + + /** \name Compute geoid heights + **********************************************************************/ + ///@{ + /** + * Compute the geoid height at a point + * + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @exception GeographicErr if there's a problem reading the data; this + * never happens if (\e lat, \e lon) is within a successfully cached area. + * @return geoid height (meters). + * + * The latitude should be in [−90°, 90°] and + * longitude should be in [−540°, 540°). + **********************************************************************/ + Math::real operator()(real lat, real lon) const { + real gradn, grade; + return height(lat, lon, false, gradn, grade); + } + + /** + * Compute the geoid height and gradient at a point + * + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @param[out] gradn northerly gradient (dimensionless). + * @param[out] grade easterly gradient (dimensionless). + * @exception GeographicErr if there's a problem reading the data; this + * never happens if (\e lat, \e lon) is within a successfully cached area. + * @return geoid height (meters). + * + * The latitude should be in [−90°, 90°] and + * longitude should be in [−540°, 540°). As a result + * of the way that the geoid data is stored, the calculation of gradients + * can result in large quantization errors. This is particularly acute for + * fine grids, at high latitudes, and for the easterly gradient. If you + * need to compute the direction of the acceleration due to gravity + * accurately, you should use GravityModel::Gravity. + **********************************************************************/ + Math::real operator()(real lat, real lon, real& gradn, real& grade) const { + return height(lat, lon, true, gradn, grade); + } + + /** + * Convert a height above the geoid to a height above the ellipsoid and + * vice versa. + * + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @param[in] h height of the point (degrees). + * @param[in] d a Geoid::convertflag specifying the direction of the + * conversion; Geoid::GEOIDTOELLIPSOID means convert a height above the + * geoid to a height above the ellipsoid; Geoid::ELLIPSOIDTOGEOID means + * convert a height above the ellipsoid to a height above the geoid. + * @exception GeographicErr if there's a problem reading the data; this + * never happens if (\e lat, \e lon) is within a successfully cached area. + * @return converted height (meters). + **********************************************************************/ + Math::real ConvertHeight(real lat, real lon, real h, + convertflag d) const { + real gradn, grade; + return h + real(d) * height(lat, lon, true, gradn, grade); + } + + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return geoid description, if available, in the data file; if + * absent, return "NONE". + **********************************************************************/ + const std::string& Description() const throw() { return _description; } + + /** + * @return date of the data file; if absent, return "UNKNOWN". + **********************************************************************/ + const std::string& DateTime() const throw() { return _datetime; } + + /** + * @return full file name used to load the geoid data. + **********************************************************************/ + const std::string& GeoidFile() const throw() { return _filename; } + + /** + * @return "name" used to load the geoid data (from the first argument of + * the constructor). + **********************************************************************/ + const std::string& GeoidName() const throw() { return _name; } + + /** + * @return directory used to load the geoid data. + **********************************************************************/ + const std::string& GeoidDirectory() const throw() { return _dir; } + + /** + * @return interpolation method ("cubic" or "bilinear"). + **********************************************************************/ + const std::string Interpolation() const + { return std::string(_cubic ? "cubic" : "bilinear"); } + + /** + * @return estimate of the maximum interpolation and quantization error + * (meters). + * + * This relies on the value being stored in the data file. If the value is + * absent, return −1. + **********************************************************************/ + Math::real MaxError() const throw() { return _maxerror; } + + /** + * @return estimate of the RMS interpolation and quantization error + * (meters). + * + * This relies on the value being stored in the data file. If the value is + * absent, return −1. + **********************************************************************/ + Math::real RMSError() const throw() { return _rmserror; } + + /** + * @return offset (meters). + * + * This in used in converting from the pixel values in the data file to + * geoid heights. + **********************************************************************/ + Math::real Offset() const throw() { return _offset; } + + /** + * @return scale (meters). + * + * This in used in converting from the pixel values in the data file to + * geoid heights. + **********************************************************************/ + Math::real Scale() const throw() { return _scale; } + + /** + * @return true if the object is constructed to be thread safe. + **********************************************************************/ + bool ThreadSafe() const throw() { return _threadsafe; } + + /** + * @return true if a data cache is active. + **********************************************************************/ + bool Cache() const throw() { return _cache; } + + /** + * @return west edge of the cached area; the cache includes this edge. + **********************************************************************/ + Math::real CacheWest() const throw() { + return _cache ? ((_xoffset + (_xsize == _width ? 0 : _cubic) + + _width/2) % _width - _width/2) / _rlonres : + 0; + } + + /** + * @return east edge of the cached area; the cache excludes this edge. + **********************************************************************/ + Math::real CacheEast() const throw() { + return _cache ? + CacheWest() + + (_xsize - (_xsize == _width ? 0 : 1 + 2 * _cubic)) / _rlonres : + 0; + } + + /** + * @return north edge of the cached area; the cache includes this edge. + **********************************************************************/ + Math::real CacheNorth() const throw() { + return _cache ? 90 - (_yoffset + _cubic) / _rlatres : 0; + } + + /** + * @return south edge of the cached area; the cache excludes this edge + * unless it's the south pole. + **********************************************************************/ + Math::real CacheSouth() const throw() { + return _cache ? 90 - ( _yoffset + _ysize - 1 - _cubic) / _rlatres : 0; + } + + /** + * @return \e a the equatorial radius of the WGS84 ellipsoid (meters). + * + * (The WGS84 value is returned because the supported geoid models are all + * based on this ellipsoid.) + **********************************************************************/ + Math::real MajorRadius() const throw() + { return Constants::WGS84_a(); } + + /** + * @return \e f the flattening of the WGS84 ellipsoid. + * + * (The WGS84 value is returned because the supported geoid models are all + * based on this ellipsoid.) + **********************************************************************/ + Math::real Flattening() const throw() { return Constants::WGS84_f(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the WGS84 ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return 1/Constants::WGS84_f(); } + /// \endcond + + /** + * @return the default path for geoid data files. + * + * This is the value of the environment variable GEOID_PATH, if set; + * otherwise, it is $GEOGRAPHICLIB_DATA/geoids if the environment variable + * GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default + * (/usr/local/share/GeographicLib/geoids on non-Windows systems and + * C:/Documents and Settings/All Users/Application + * Data/GeographicLib/geoids on Windows systems). + **********************************************************************/ + static std::string DefaultGeoidPath(); + + /** + * @return the default name for the geoid. + * + * This is the value of the environment variable GEOID_NAME, if set, + * otherwise, it is "egm96-5". The Geoid class does not use this function; + * it is just provided as a convenience for a calling program when + * constructing a Geoid object. + **********************************************************************/ + static std::string DefaultGeoidName(); + + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_GEOID_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Gnomonic.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Gnomonic.hpp new file mode 100644 index 000000000..4b41d4ad5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Gnomonic.hpp @@ -0,0 +1,222 @@ +/** + * \file Gnomonic.hpp + * \brief Header for GeographicLib::Gnomonic class + * + * Copyright (c) Charles Karney (2010-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GNOMONIC_HPP) +#define GEOGRAPHICLIB_GNOMONIC_HPP 1 + +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief %Gnomonic projection + * + * %Gnomonic projection centered at an arbitrary position \e C on the + * ellipsoid. This projection is derived in Section 8 of + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * . + * The projection of \e P is defined as follows: compute the geodesic line + * from \e C to \e P; compute the reduced length \e m12, geodesic scale \e + * M12, and ρ = m12/\e M12; finally \e x = ρ sin \e azi1; \e + * y = ρ cos \e azi1, where \e azi1 is the azimuth of the geodesic at \e + * C. The Gnomonic::Forward and Gnomonic::Reverse methods also return the + * azimuth \e azi of the geodesic at \e P and reciprocal scale \e rk in the + * azimuthal direction. The scale in the radial direction if + * 1/rk2. + * + * For a sphere, ρ is reduces to \e a tan(s12/a), where \e + * s12 is the length of the geodesic from \e C to \e P, and the gnomonic + * projection has the property that all geodesics appear as straight lines. + * For an ellipsoid, this property holds only for geodesics interesting the + * centers. However geodesic segments close to the center are approximately + * straight. + * + * Consider a geodesic segment of length \e l. Let \e T be the point on the + * geodesic (extended if necessary) closest to \e C the center of the + * projection and \e t be the distance \e CT. To lowest order, the maximum + * deviation (as a true distance) of the corresponding gnomonic line segment + * (i.e., with the same end points) from the geodesic is
+ *
+ * (K(T) - K(C)) + * l2 \e t / 32.
+ *
+ * where \e K is the Gaussian curvature. + * + * This result applies for any surface. For an ellipsoid of revolution, + * consider all geodesics whose end points are within a distance \e r of \e + * C. For a given \e r, the deviation is maximum when the latitude of \e C + * is 45°, when endpoints are a distance \e r away, and when their + * azimuths from the center are ± 45° or ± 135°. + * To lowest order in \e r and the flattening \e f, the deviation is \e f + * (r/2a)3 \e r. + * + * The conversions all take place using a Geodesic object (by default + * Geodesic::WGS84). For more information on geodesics see \ref geodesic. + * + * CAUTION: The definition of this projection for a sphere is + * standard. However, there is no standard for how it should be extended to + * an ellipsoid. The choices are: + * - Declare that the projection is undefined for an ellipsoid. + * - Project to a tangent plane from the center of the ellipsoid. This + * causes great ellipses to appear as straight lines in the projection; + * i.e., it generalizes the spherical great circle to a great ellipse. + * This was proposed by independently by Bowring and Williams in 1997. + * - Project to the conformal sphere with the constant of integration chosen + * so that the values of the latitude match for the center point and + * perform a central projection onto the plane tangent to the conformal + * sphere at the center point. This causes normal sections through the + * center point to appear as straight lines in the projection; i.e., it + * generalizes the spherical great circle to a normal section. This was + * proposed by I. G. Letoval'tsev, Generalization of the %Gnomonic + * Projection for a Spheroid and the Principal Geodetic Problems Involved + * in the Alignment of Surface Routes, Geodesy and Aerophotography (5), + * 271--274 (1963). + * - The projection given here. This causes geodesics close to the center + * point to appear as straight lines in the projection; i.e., it + * generalizes the spherical great circle to a geodesic. + * + * Example of use: + * \include example-Gnomonic.cpp + * + * GeodesicProj is a command-line utility + * providing access to the functionality of AzimuthalEquidistant, Gnomonic, + * and CassiniSoldner. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT Gnomonic { + private: + typedef Math::real real; + Geodesic _earth; + real _a, _f; + static const real eps0_; + static const real eps_; + static const int numit_ = 10; + public: + + /** + * Constructor for Gnomonic. + * + * @param[in] earth the Geodesic object to use for geodesic calculations. + * By default this uses the WGS84 ellipsoid. + **********************************************************************/ + explicit Gnomonic(const Geodesic& earth = Geodesic::WGS84) + throw() + : _earth(earth) + , _a(_earth.MajorRadius()) + , _f(_earth.Flattening()) + {} + + /** + * Forward projection, from geographic to gnomonic. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] azi azimuth of geodesic at point (degrees). + * @param[out] rk reciprocal of azimuthal scale at point. + * + * \e lat0 and \e lat should be in the range [−90°, 90°] and + * \e lon0 and \e lon should be in the range [−540°, 540°). + * The scale of the projection is 1/rk2 in the "radial" + * direction, \e azi clockwise from true north, and is 1/\e rk in the + * direction perpendicular to this. If the point lies "over the horizon", + * i.e., if \e rk ≤ 0, then NaNs are returned for \e x and \e y (the + * correct values are returned for \e azi and \e rk). A call to Forward + * followed by a call to Reverse will return the original (\e lat, \e lon) + * (to within roundoff) provided the point in not over the horizon. + **********************************************************************/ + void Forward(real lat0, real lon0, real lat, real lon, + real& x, real& y, real& azi, real& rk) const throw(); + + /** + * Reverse projection, from gnomonic to geographic. + * + * @param[in] lat0 latitude of center point of projection (degrees). + * @param[in] lon0 longitude of center point of projection (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] azi azimuth of geodesic at point (degrees). + * @param[out] rk reciprocal of azimuthal scale at point. + * + * \e lat0 should be in the range [−90°, 90°] and \e + * lon0 should be in the range [−540°, 540°). \e lat + * will be in the range [−90°, 90°] and \e lon will + * be in the range [−180°, 180°). The scale of the + * projection is 1/\e rk2 in the "radial" direction, \e azi + * clockwise from true north, and is 1/\e rk in the direction perpendicular + * to this. Even though all inputs should return a valid \e lat and \e + * lon, it's possible that the procedure fails to converge for very large + * \e x or \e y; in this case NaNs are returned for all the output + * arguments. A call to Reverse followed by a call to Forward will return + * the original (\e x, \e y) (to roundoff). + **********************************************************************/ + void Reverse(real lat0, real lon0, real x, real y, + real& lat, real& lon, real& azi, real& rk) const throw(); + + /** + * Gnomonic::Forward without returning the azimuth and scale. + **********************************************************************/ + void Forward(real lat0, real lon0, real lat, real lon, + real& x, real& y) const throw() { + real azi, rk; + Forward(lat0, lon0, lat, lon, x, y, azi, rk); + } + + /** + * Gnomonic::Reverse without returning the azimuth and scale. + **********************************************************************/ + void Reverse(real lat0, real lon0, real x, real y, + real& lat, real& lon) const throw() { + real azi, rk; + Reverse(lat0, lon0, x, y, lat, lon, azi, rk); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _earth.Flattening(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return _earth.InverseFlattening(); } + /// \endcond + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_GNOMONIC_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GravityCircle.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GravityCircle.hpp new file mode 100644 index 000000000..d11f98b83 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GravityCircle.hpp @@ -0,0 +1,301 @@ +/** + * \file GravityCircle.hpp + * \brief Header for GeographicLib::GravityCircle class + * + * Copyright (c) Charles Karney (2011) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GRAVITYCIRCLE_HPP) +#define GEOGRAPHICLIB_GRAVITYCIRCLE_HPP 1 + +#include +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief Gravity on a circle of latitude + * + * Evaluate the earth's gravity field on a circle of constant height and + * latitude. This uses a CircularEngine to pre-evaluate the inner sum of the + * spherical harmonic sum, allowing the values of the field at several + * different longitudes to be evaluated rapidly. + * + * Use GravityModel::Circle to create a GravityCircle object. (The + * constructor for this class is private.) + * + * See \ref gravityparallel for an example of using GravityCircle (together + * with OpenMP) to speed up the computation of geoid heights. + * + * Example of use: + * \include example-GravityCircle.cpp + * + * Gravity is a command-line utility providing + * access to the functionality of GravityModel and GravityCircle. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT GravityCircle { + private: + typedef Math::real real; + enum mask { + NONE = GravityModel::NONE, + GRAVITY = GravityModel::GRAVITY, + DISTURBANCE = GravityModel::DISTURBANCE, + DISTURBING_POTENTIAL = GravityModel::DISTURBING_POTENTIAL, + GEOID_HEIGHT = GravityModel::GEOID_HEIGHT, + SPHERICAL_ANOMALY = GravityModel::SPHERICAL_ANOMALY, + ALL = GravityModel::ALL, + }; + + unsigned _caps; + real _a, _f, _lat, _h, _Z, _Px, _invR, _cpsi, _spsi, + _cphi, _sphi, _amodel, _GMmodel, _dzonal0, + _corrmult, _gamma0, _gamma, _frot; + CircularEngine _gravitational, _disturbing, _correction; + + GravityCircle(mask caps, real a, real f, real lat, real h, + real Z, real P, real cphi, real sphi, + real amodel, real GMmodel, real dzonal0, real corrmult, + real gamma0, real gamma, real frot, + const CircularEngine& gravitational, + const CircularEngine& disturbing, + const CircularEngine& correction) + : _caps(caps) + , _a(a) + , _f(f) + , _lat(lat) + , _h(h) + , _Z(Z) + , _Px(P) + , _invR(1 / Math::hypot(_Px, _Z)) + , _cpsi(_Px * _invR) + , _spsi(_Z * _invR) + , _cphi(cphi) + , _sphi(sphi) + , _amodel(amodel) + , _GMmodel(GMmodel) + , _dzonal0(dzonal0) + , _corrmult(corrmult) + , _gamma0(gamma0) + , _gamma(gamma) + , _frot(frot) + , _gravitational(gravitational) + , _disturbing(disturbing) + , _correction(correction) + {} + + friend class GravityModel; // GravityModel calls the private constructor + Math::real W(real clam, real slam, + real& gX, real& gY, real& gZ) const throw(); + Math::real V(real clam, real slam, + real& gX, real& gY, real& gZ) const throw(); + Math::real InternalT(real clam, real slam, + real& deltaX, real& deltaY, real& deltaZ, + bool gradp, bool correct) const throw(); + public: + /** + * A default constructor for the normal gravity. This sets up an + * uninitialized object which can be later replaced by the + * GravityModel::Circle. + **********************************************************************/ + GravityCircle() : _a(-1) {} + + /** \name Compute the gravitational field + **********************************************************************/ + ///@{ + /** + * Evaluate the gravity. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] gx the easterly component of the acceleration + * (m s−2). + * @param[out] gy the northerly component of the acceleration + * (m s−2). + * @param[out] gz the upward component of the acceleration + * (m s−2); this is usually negative. + * @return \e W the sum of the gravitational and centrifugal potentials. + * + * The function includes the effects of the earth's rotation. + **********************************************************************/ + Math::real Gravity(real lon, real& gx, real& gy, real& gz) const throw(); + + /** + * Evaluate the gravity disturbance vector. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] deltax the easterly component of the disturbance vector + * (m s−2). + * @param[out] deltay the northerly component of the disturbance vector + * (m s−2). + * @param[out] deltaz the upward component of the disturbance vector + * (m s−2). + * @return \e T the corresponding disturbing potential. + **********************************************************************/ + Math::real Disturbance(real lon, real& deltax, real& deltay, real& deltaz) + const throw(); + + /** + * Evaluate the geoid height. + * + * @param[in] lon the geographic longitude (degrees). + * @return \e N the height of the geoid above the reference ellipsoid + * (meters). + * + * Some approximations are made in computing the geoid height so that the + * results of the NGA codes are reproduced accurately. Details are given + * in \ref gravitygeoid. + **********************************************************************/ + Math::real GeoidHeight(real lon) const throw(); + + /** + * Evaluate the components of the gravity anomaly vector using the + * spherical approximation. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] Dg01 the gravity anomaly (m s−2). + * @param[out] xi the northerly component of the deflection of the vertical + * (degrees). + * @param[out] eta the easterly component of the deflection of the vertical + * (degrees). + * + * The spherical approximation (see Heiskanen and Moritz, Sec 2-14) is used + * so that the results of the NGA codes are reproduced accurately. + * approximations used here. Details are given in \ref gravitygeoid. + **********************************************************************/ + void SphericalAnomaly(real lon, real& Dg01, real& xi, real& eta) + const throw(); + + /** + * Evaluate the components of the acceleration due to gravity and the + * centrifugal acceleration in geocentric coordinates. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] gX the \e X component of the acceleration + * (m s−2). + * @param[out] gY the \e Y component of the acceleration + * (m s−2). + * @param[out] gZ the \e Z component of the acceleration + * (m s−2). + * @return \e W = \e V + Φ the sum of the gravitational and + * centrifugal potentials (m2 s−2). + **********************************************************************/ + Math::real W(real lon, real& gX, real& gY, real& gZ) const throw() { + real clam, slam; + CircularEngine::cossin(lon, clam, slam); + return W(clam, slam, gX, gY, gZ); + } + + /** + * Evaluate the components of the acceleration due to gravity in geocentric + * coordinates. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] GX the \e X component of the acceleration + * (m s−2). + * @param[out] GY the \e Y component of the acceleration + * (m s−2). + * @param[out] GZ the \e Z component of the acceleration + * (m s−2). + * @return \e V = \e W - Φ the gravitational potential + * (m2 s−2). + **********************************************************************/ + Math::real V(real lon, real& GX, real& GY, real& GZ) const throw() { + real clam, slam; + CircularEngine::cossin(lon, clam, slam); + return V(clam, slam, GX, GY, GZ); + } + + /** + * Evaluate the components of the gravity disturbance in geocentric + * coordinates. + * + * @param[in] lon the geographic longitude (degrees). + * @param[out] deltaX the \e X component of the gravity disturbance + * (m s−2). + * @param[out] deltaY the \e Y component of the gravity disturbance + * (m s−2). + * @param[out] deltaZ the \e Z component of the gravity disturbance + * (m s−2). + * @return \e T = \e W - \e U the disturbing potential (also called the + * anomalous potential) (m2 s−2). + **********************************************************************/ + Math::real T(real lon, real& deltaX, real& deltaY, real& deltaZ) + const throw() { + real clam, slam; + CircularEngine::cossin(lon, clam, slam); + return InternalT(clam, slam, deltaX, deltaY, deltaZ, true, true); + } + + /** + * Evaluate disturbing potential in geocentric coordinates. + * + * @param[in] lon the geographic longitude (degrees). + * @return \e T = \e W - \e U the disturbing potential (also called the + * anomalous potential) (m2 s−2). + **********************************************************************/ + Math::real T(real lon) const throw() { + real clam, slam, dummy; + CircularEngine::cossin(lon, clam, slam); + return InternalT(clam, slam, dummy, dummy, dummy, false, true); + } + + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return true if the object has been initialized. + **********************************************************************/ + bool Init() const throw() { return _a > 0; } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the GravityModel object used in the + * constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() + { return Init() ? _a : Math::NaN(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the GravityModel object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() + { return Init() ? _f : Math::NaN(); } + + /** + * @return the latitude of the circle (degrees). + **********************************************************************/ + Math::real Latitude() const throw() + { return Init() ? _lat : Math::NaN(); } + + /** + * @return the height of the circle (meters). + **********************************************************************/ + Math::real Height() const throw() + { return Init() ? _h : Math::NaN(); } + + /** + * @return \e caps the computational capabilities that this object was + * constructed with. + **********************************************************************/ + unsigned Capabilities() const throw() { return _caps; } + + /** + * @param[in] testcaps a set of bitor'ed GeodesicLine::mask values. + * @return true if the GeodesicLine object has all these capabilities. + **********************************************************************/ + bool Capabilities(unsigned testcaps) const throw() { + return (_caps & testcaps) == testcaps; + } + ///@} + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_GRAVITYCIRCLE_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GravityModel.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GravityModel.hpp new file mode 100644 index 000000000..e958eb667 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GravityModel.hpp @@ -0,0 +1,519 @@ +/** + * \file GravityModel.hpp + * \brief Header for GeographicLib::GravityModel class + * + * Copyright (c) Charles Karney (2011) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_GRAVITYMODEL_HPP) +#define GEOGRAPHICLIB_GRAVITYMODEL_HPP 1 + +#include +#include +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs vector +# pragma warning (push) +# pragma warning (disable: 4251) +#endif + +namespace GeographicLib { + + class GravityCircle; + + /** + * \brief Model of the earth's gravity field + * + * Evaluate the earth's gravity field according to a model. The supported + * models treat only the gravitational field exterior to the mass of the + * earth. When computing the field at points near (but above) the surface of + * the earth a small correction can be applied to account for the mass of the + * atomsphere above the point in question; see \ref gravityatmos. + * Determining the geoid height entails correcting for the mass of the earth + * above the geoid. The egm96 and egm2008 include separate correction terms + * to account for this mass. + * + * Definitions and terminology (from Heiskanen and Moritz, Sec 2-13): + * - \e V = gravitational potential; + * - Φ = rotational potential; + * - \e W = \e V + Φ = \e T + \e U = total potential; + * - V0 = normal gravitation potential; + * - \e U = V0 + Φ = total normal potential; + * - \e T = \e W − \e U = \e V − V0 = anomalous + * or disturbing potential; + * - g = ∇\e W = γ + δ; + * - f = ∇Φ; + * - Γ = ∇V0; + * - γ = ∇\e U; + * - δ = ∇\e T = gravity disturbance vector + * = gPγP; + * - δ\e g = gravity disturbance = \e gP − + * γP; + * - Δg = gravity anomaly vector = gP + * − γQ; here the line \e PQ is + * perpendicular to ellipsoid and the potential at \e P equals the normal + * potential at \e Q; + * - Δ\e g = gravity anomaly = \e gP − + * γQ; + * - (ξ, η) deflection of the vertical, the difference in + * directions of gP and + * γQ, ξ = NS, η = EW. + * - \e X, \e Y, \e Z, geocentric coordinates; + * - \e x, \e y, \e z, local cartesian coordinates used to denote the east, + * north and up directions. + * + * See \ref gravity for details of how to install the gravity model and the + * data format. + * + * References: + * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San + * Francisco, 1967). + * + * Example of use: + * \include example-GravityModel.cpp + * + * Gravity is a command-line utility providing + * access to the functionality of GravityModel and GravityCircle. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT GravityModel { + private: + typedef Math::real real; + friend class GravityCircle; + static const int idlength_ = 8; + std::string _name, _dir, _description, _date, _filename, _id; + real _amodel, _GMmodel, _zeta0, _corrmult; + SphericalHarmonic::normalization _norm; + NormalGravity _earth; + std::vector _Cx, _Sx, _CC, _CS, _zonal; + real _dzonal0; // A left over contribution to _zonal. + SphericalHarmonic _gravitational; + SphericalHarmonic1 _disturbing; + SphericalHarmonic _correction; + void ReadMetadata(const std::string& name); + Math::real InternalT(real X, real Y, real Z, + real& deltaX, real& deltaY, real& deltaZ, + bool gradp, bool correct) const throw(); + GravityModel(const GravityModel&); // copy constructor not allowed + GravityModel& operator=(const GravityModel&); // nor copy assignment + + enum captype { + CAP_NONE = 0U, + CAP_G = 1U<<0, // implies potentials W and V + CAP_T = 1U<<1, + CAP_DELTA = 1U<<2 | CAP_T, // delta implies T? + CAP_C = 1U<<3, + CAP_GAMMA0 = 1U<<4, + CAP_GAMMA = 1U<<5, + CAP_ALL = 0x3FU, + }; + + public: + + /** + * Bit masks for the capabilities to be given to the GravityCircle object + * produced by Circle. + **********************************************************************/ + enum mask { + /** + * No capabilities. + * @hideinitializer + **********************************************************************/ + NONE = 0U, + /** + * Allow calls to GravityCircle::Gravity, GravityCircle::W, and + * GravityCircle::V. + * @hideinitializer + **********************************************************************/ + GRAVITY = CAP_G, + /** + * Allow calls to GravityCircle::Disturbance and GravityCircle::T. + * @hideinitializer + **********************************************************************/ + DISTURBANCE = CAP_DELTA, + /** + * Allow calls to GravityCircle::T(real lon) (i.e., computing the + * disturbing potential and not the gravity disturbance vector). + * @hideinitializer + **********************************************************************/ + DISTURBING_POTENTIAL = CAP_T, + /** + * Allow calls to GravityCircle::SphericalAnomaly. + * @hideinitializer + **********************************************************************/ + SPHERICAL_ANOMALY = CAP_DELTA | CAP_GAMMA, + /** + * Allow calls to GravityCircle::GeoidHeight. + * @hideinitializer + **********************************************************************/ + GEOID_HEIGHT = CAP_T | CAP_C | CAP_GAMMA0, + /** + * All capabilities. + * @hideinitializer + **********************************************************************/ + ALL = CAP_ALL, + }; + /** \name Setting up the gravity model + **********************************************************************/ + ///@{ + /** + * Construct a gravity model. + * + * @param[in] name the name of the model. + * @param[in] path (optional) directory for data file. + * @exception GeographicErr if the data file cannot be found, is + * unreadable, or is corrupt. + * @exception std::bad_alloc if the memory necessary for storing the model + * can't be allocated. + * + * A filename is formed by appending ".egm" (World Gravity Model) to the + * name. If \e path is specified (and is non-empty), then the file is + * loaded from directory, \e path. Otherwise the path is given by + * DefaultGravityPath(). + * + * This file contains the metadata which specifies the properties of the + * model. The coefficients for the spherical harmonic sums are obtained + * from a file obtained by appending ".cof" to metadata file (so the + * filename ends in ".egm.cof"). + **********************************************************************/ + explicit GravityModel(const std::string& name, + const std::string& path = ""); + ///@} + + /** \name Compute gravity in geodetic coordinates + **********************************************************************/ + ///@{ + /** + * Evaluate the gravity at an arbitrary point above (or below) the + * ellipsoid. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] lon the geographic longitude (degrees). + * @param[in] h the height above the ellipsoid (meters). + * @param[out] gx the easterly component of the acceleration + * (m s−2). + * @param[out] gy the northerly component of the acceleration + * (m s−2). + * @param[out] gz the upward component of the acceleration + * (m s−2); this is usually negative. + * @return \e W the sum of the gravitational and centrifugal potentials. + * + * The function includes the effects of the earth's rotation. + **********************************************************************/ + Math::real Gravity(real lat, real lon, real h, + real& gx, real& gy, real& gz) const throw(); + + /** + * Evaluate the gravity disturbance vector at an arbitrary point above (or + * below) the ellipsoid. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] lon the geographic longitude (degrees). + * @param[in] h the height above the ellipsoid (meters). + * @param[out] deltax the easterly component of the disturbance vector + * (m s−2). + * @param[out] deltay the northerly component of the disturbance vector + * (m s−2). + * @param[out] deltaz the upward component of the disturbance vector + * (m s−2). + * @return \e T the corresponding disturbing potential. + **********************************************************************/ + Math::real Disturbance(real lat, real lon, real h, + real& deltax, real& deltay, real& deltaz) + const throw(); + + /** + * Evaluate the geoid height. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] lon the geographic longitude (degrees). + * @return \e N the height of the geoid above the ReferenceEllipsoid() + * (meters). + * + * This calls NormalGravity::U for ReferenceEllipsoid(). Some + * approximations are made in computing the geoid height so that the + * results of the NGA codes are reproduced accurately. Details are given + * in \ref gravitygeoid. + **********************************************************************/ + Math::real GeoidHeight(real lat, real lon) const throw(); + + /** + * Evaluate the components of the gravity anomaly vector using the + * spherical approximation. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] lon the geographic longitude (degrees). + * @param[in] h the height above the ellipsoid (meters). + * @param[out] Dg01 the gravity anomaly (m s−2). + * @param[out] xi the northerly component of the deflection of the vertical + * (degrees). + * @param[out] eta the easterly component of the deflection of the vertical + * (degrees). + * + * The spherical approximation (see Heiskanen and Moritz, Sec 2-14) is used + * so that the results of the NGA codes are reproduced accurately. + * approximations used here. Details are given in \ref gravitygeoid. + **********************************************************************/ + void SphericalAnomaly(real lat, real lon, real h, + real& Dg01, real& xi, real& eta) const throw(); + ///@} + + /** \name Compute gravity in geocentric coordinates + **********************************************************************/ + ///@{ + /** + * Evaluate the components of the acceleration due to gravity and the + * centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] gX the \e X component of the acceleration + * (m s−2). + * @param[out] gY the \e Y component of the acceleration + * (m s−2). + * @param[out] gZ the \e Z component of the acceleration + * (m s−2). + * @return \e W = \e V + Φ the sum of the gravitational and + * centrifugal potentials (m2 s−2). + * + * This calls NormalGravity::U for ReferenceEllipsoid(). + **********************************************************************/ + Math::real W(real X, real Y, real Z, + real& gX, real& gY, real& gZ) const throw(); + + /** + * Evaluate the components of the acceleration due to gravity in geocentric + * coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] GX the \e X component of the acceleration + * (m s−2). + * @param[out] GY the \e Y component of the acceleration + * (m s−2). + * @param[out] GZ the \e Z component of the acceleration + * (m s−2). + * @return \e V = \e W - Φ the gravitational potential + * (m2 s−2). + **********************************************************************/ + Math::real V(real X, real Y, real Z, + real& GX, real& GY, real& GZ) const throw(); + + /** + * Evaluate the components of the gravity disturbance in geocentric + * coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] deltaX the \e X component of the gravity disturbance + * (m s−2). + * @param[out] deltaY the \e Y component of the gravity disturbance + * (m s−2). + * @param[out] deltaZ the \e Z component of the gravity disturbance + * (m s−2). + * @return \e T = \e W - \e U the disturbing potential (also called the + * anomalous potential) (m2 s−2). + **********************************************************************/ + Math::real T(real X, real Y, real Z, + real& deltaX, real& deltaY, real& deltaZ) const throw() + { return InternalT(X, Y, Z, deltaX, deltaY, deltaZ, true, true); } + + /** + * Evaluate disturbing potential in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @return \e T = \e W - \e U the disturbing potential (also called the + * anomalous potential) (m2 s−2). + **********************************************************************/ + Math::real T(real X, real Y, real Z) const throw() { + real dummy; + return InternalT(X, Y, Z, dummy, dummy, dummy, false, true); + } + + /** + * Evaluate the components of the acceleration due to normal gravity and + * the centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] gammaX the \e X component of the normal acceleration + * (m s−2). + * @param[out] gammaY the \e Y component of the normal acceleration + * (m s−2). + * @param[out] gammaZ the \e Z component of the normal acceleration + * (m s−2). + * @return \e U = V0 + Φ the sum of the + * normal gravitational and centrifugal potentials + * (m2 s−2). + * + * This calls NormalGravity::U for ReferenceEllipsoid(). + **********************************************************************/ + Math::real U(real X, real Y, real Z, + real& gammaX, real& gammaY, real& gammaZ) const throw() + { return _earth.U(X, Y, Z, gammaX, gammaY, gammaZ); } + + /** + * Evaluate the centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[out] fX the \e X component of the centrifugal acceleration + * (m s−2). + * @param[out] fY the \e Y component of the centrifugal acceleration + * (m s−2). + * @return Φ the centrifugal potential (m2 + * s−2). + * + * This calls NormalGravity::Phi for ReferenceEllipsoid(). + **********************************************************************/ + Math::real Phi(real X, real Y, real& fX, real& fY) const throw() + { return _earth.Phi(X, Y, fX, fY); } + ///@} + + /** \name Compute gravity on a circle of constant latitude + **********************************************************************/ + ///@{ + /** + * Create a GravityCircle object to allow the gravity field at many points + * with constant \e lat and \e h and varying \e lon to be computed + * efficiently. + * + * @param[in] lat latitude of the point (degrees). + * @param[in] h the height of the point above the ellipsoid (meters). + * @param[in] caps bitor'ed combination of GravityModel::mask values + * specifying the capabilities of the resulting GravityCircle object. + * @exception std::bad_alloc if the memory necessary for creating a + * GravityCircle can't be allocated. + * @return a GravityCircle object whose member functions computes the + * gravitational field at a particular values of \e lon. + * + * The GravityModel::mask values are + * - \e caps |= GravityModel::GRAVITY + * - \e caps |= GravityModel::DISTURBANCE + * - \e caps |= GravityModel::DISTURBING_POTENTIAL + * - \e caps |= GravityModel::SPHERICAL_ANOMALY + * - \e caps |= GravityModel::GEOID_HEIGHT + * . + * The default value of \e caps is GravityModel::ALL which turns on all the + * capabilities. If an unsupported function is invoked, it will return + * NaNs. Note that GravityModel::GEOID_HEIGHT will only be honored if \e h + * = 0. + * + * If the field at several points on a circle of latitude need to be + * calculated then creating a GravityCircle object and using its member + * functions will be substantially faster, especially for high-degree + * models. See \ref gravityparallel for an example of using GravityCircle + * (together with OpenMP) to speed up the computation of geoid heights. + **********************************************************************/ + GravityCircle Circle(real lat, real h, unsigned caps = ALL) const; + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + + /** + * @return the NormalGravity object for the reference ellipsoid. + **********************************************************************/ + const NormalGravity& ReferenceEllipsoid() const throw() { return _earth; } + + /** + * @return the description of the gravity model, if available, in the data + * file; if absent, return "NONE". + **********************************************************************/ + const std::string& Description() const throw() { return _description; } + + /** + * @return date of the model; if absent, return "UNKNOWN". + **********************************************************************/ + const std::string& DateTime() const throw() { return _date; } + + /** + * @return full file name used to load the gravity model. + **********************************************************************/ + const std::string& GravityFile() const throw() { return _filename; } + + /** + * @return "name" used to load the gravity model (from the first argument + * of the constructor, but this may be overridden by the model file). + **********************************************************************/ + const std::string& GravityModelName() const throw() { return _name; } + + /** + * @return directory used to load the gravity model. + **********************************************************************/ + const std::string& GravityModelDirectory() const throw() { return _dir; } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). + **********************************************************************/ + Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } + + /** + * @return \e GM the mass constant of the model (m3 + * s−2); this is the product of \e G the gravitational + * constant and \e M the mass of the earth (usually including the mass of + * the earth's atmosphere). + **********************************************************************/ + Math::real MassConstant() const throw() { return _GMmodel; } + + /** + * @return \e GM the mass constant of the ReferenceEllipsoid() + * (m3 s−2). + **********************************************************************/ + Math::real ReferenceMassConstant() const throw() + { return _earth.MassConstant(); } + + /** + * @return ω the angular velocity of the model and the + * ReferenceEllipsoid() (rad s−1). + **********************************************************************/ + Math::real AngularVelocity() const throw() + { return _earth.AngularVelocity(); } + + /** + * @return \e f the flattening of the ellipsoid. + **********************************************************************/ + Math::real Flattening() const throw() { return _earth.Flattening(); } + ///@} + + /** + * @return the default path for gravity model data files. + * + * This is the value of the environment variable GRAVITY_PATH, if set; + * otherwise, it is $GEOGRAPHICLIB_DATA/gravity if the environment variable + * GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time default + * (/usr/local/share/GeographicLib/gravity on non-Windows systems and + * C:/Documents and Settings/All Users/Application + * Data/GeographicLib/gravity on Windows systems). + **********************************************************************/ + static std::string DefaultGravityPath(); + + /** + * @return the default name for the gravity model. + * + * This is the value of the environment variable GRAVITY_NAME, if set, + * otherwise, it is "egm96". The GravityModel class does not use + * this function; it is just provided as a convenience for a calling + * program when constructing a GravityModel object. + **********************************************************************/ + static std::string DefaultGravityName(); + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_GRAVITYMODEL_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/LambertConformalConic.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/LambertConformalConic.hpp new file mode 100644 index 000000000..5f656f02e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/LambertConformalConic.hpp @@ -0,0 +1,332 @@ +/** + * \file LambertConformalConic.hpp + * \brief Header for GeographicLib::LambertConformalConic class + * + * Copyright (c) Charles Karney (2010-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP) +#define GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP 1 + +#include + +namespace GeographicLib { + + /** + * \brief Lambert conformal conic projection + * + * Implementation taken from the report, + * - J. P. Snyder, + * Map Projections: A + * Working Manual, USGS Professional Paper 1395 (1987), + * pp. 107--109. + * + * This is a implementation of the equations in Snyder except that divided + * differences have been used to transform the expressions into ones which + * may be evaluated accurately and that Newton's method is used to invert the + * projection. In this implementation, the projection correctly becomes the + * Mercator projection or the polar stereographic projection when the + * standard latitude is the equator or a pole. The accuracy of the + * projections is about 10 nm (10 nanometers). + * + * The ellipsoid parameters, the standard parallels, and the scale on the + * standard parallels are set in the constructor. Internally, the case with + * two standard parallels is converted into a single standard parallel, the + * latitude of tangency (also the latitude of minimum scale), with a scale + * specified on this parallel. This latitude is also used as the latitude of + * origin which is returned by LambertConformalConic::OriginLatitude. The + * scale on the latitude of origin is given by + * LambertConformalConic::CentralScale. The case with two distinct standard + * parallels where one is a pole is singular and is disallowed. The central + * meridian (which is a trivial shift of the longitude) is specified as the + * \e lon0 argument of the LambertConformalConic::Forward and + * LambertConformalConic::Reverse functions. There is no provision in this + * class for specifying a false easting or false northing or a different + * latitude of origin. However these are can be simply included by the + * calling function. For example the Pennsylvania South state coordinate + * system ( + * EPSG:3364) is obtained by: + * \include example-LambertConformalConic.cpp + * + * ConicProj is a command-line utility + * providing access to the functionality of LambertConformalConic and + * AlbersEqualArea. + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT LambertConformalConic { + private: + typedef Math::real real; + real _a, _f, _fm, _e2, _e, _e2m; + real _sign, _n, _nc, _t0nm1, _scale, _lat0, _k0; + real _scbet0, _tchi0, _scchi0, _psi0, _nrho0, _drhomax; + static const real eps_; + static const real epsx_; + static const real tol_; + static const real ahypover_; + static const int numit_ = 5; + static inline real hyp(real x) throw() { return Math::hypot(real(1), x); } + // e * atanh(e * x) = log( ((1 + e*x)/(1 - e*x))^(e/2) ) if f >= 0 + // - sqrt(-e2) * atan( sqrt(-e2) * x) if f < 0 + inline real eatanhe(real x) const throw() + { return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); } + // Divided differences + // Definition: Df(x,y) = (f(x)-f(y))/(x-y) + // See: + // W. M. Kahan and R. J. Fateman, + // Symbolic computation of divided differences, + // SIGSAM Bull. 33(3), 7-28 (1999) + // http://dx.doi.org/10.1145/334714.334716 + // http://www.cs.berkeley.edu/~fateman/papers/divdiff.pdf + // + // General rules + // h(x) = f(g(x)): Dh(x,y) = Df(g(x),g(y))*Dg(x,y) + // h(x) = f(x)*g(x): + // Dh(x,y) = Df(x,y)*g(x) + Dg(x,y)*f(y) + // = Df(x,y)*g(y) + Dg(x,y)*f(x) + // = Df(x,y)*(g(x)+g(y))/2 + Dg(x,y)*(f(x)+f(y))/2 + // + // hyp(x) = sqrt(1+x^2): Dhyp(x,y) = (x+y)/(hyp(x)+hyp(y)) + static inline real Dhyp(real x, real y, real hx, real hy) throw() + // hx = hyp(x) + { return (x + y) / (hx + hy); } + // sn(x) = x/sqrt(1+x^2): Dsn(x,y) = (x+y)/((sn(x)+sn(y))*(1+x^2)*(1+y^2)) + static inline real Dsn(real x, real y, real sx, real sy) throw() { + // sx = x/hyp(x) + real t = x * y; + return t > 0 ? (x + y) * Math::sq( (sx * sy)/t ) / (sx + sy) : + (x - y != 0 ? (sx - sy) / (x - y) : 1); + } + // Dlog1p(x,y) = log1p((x-y)/(1+y)/(x-y) + static inline real Dlog1p(real x, real y) throw() { + real t = x - y; if (t < 0) { t = -t; y = x; } + return t != 0 ? Math::log1p(t / (1 + y)) / t : 1 / (1 + x); + } + // Dexp(x,y) = exp((x+y)/2) * 2*sinh((x-y)/2)/(x-y) + static inline real Dexp(real x, real y) throw() { + real t = (x - y)/2; + return (t != 0 ? sinh(t)/t : real(1)) * exp((x + y)/2); + } + // Dsinh(x,y) = 2*sinh((x-y)/2)/(x-y) * cosh((x+y)/2) + // cosh((x+y)/2) = (c+sinh(x)*sinh(y)/c)/2 + // c=sqrt((1+cosh(x))*(1+cosh(y))) + // cosh((x+y)/2) = sqrt( (sinh(x)*sinh(y) + cosh(x)*cosh(y) + 1)/2 ) + static inline real Dsinh(real x, real y, real sx, real sy, real cx, real cy) + // sx = sinh(x), cx = cosh(x) + throw() { + // real t = (x - y)/2, c = sqrt((1 + cx) * (1 + cy)); + // return (t != 0 ? sinh(t)/t : real(1)) * (c + sx * sy / c) /2; + real t = (x - y)/2; + return (t != 0 ? sinh(t)/t : real(1)) * sqrt((sx * sy + cx * cy + 1) /2); + } + // Dasinh(x,y) = asinh((x-y)*(x+y)/(x*sqrt(1+y^2)+y*sqrt(1+x^2)))/(x-y) + // = asinh((x*sqrt(1+y^2)-y*sqrt(1+x^2)))/(x-y) + static inline real Dasinh(real x, real y, real hx, real hy) throw() { + // hx = hyp(x) + real t = x - y; + return t != 0 ? + Math::asinh(x*y > 0 ? t * (x+y) / (x*hy + y*hx) : x*hy - y*hx) / t : + 1/hx; + } + // Deatanhe(x,y) = eatanhe((x-y)/(1-e^2*x*y))/(x-y) + inline real Deatanhe(real x, real y) const throw() { + real t = x - y, d = 1 - _e2 * x * y; + return t != 0 ? eatanhe(t / d) / t : _e2 / d; + } + void Init(real sphi1, real cphi1, real sphi2, real cphi2, real k1) throw(); + public: + + /** + * Constructor with a single standard parallel. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] stdlat standard parallel (degrees), the circle of tangency. + * @param[in] k0 scale on the standard parallel. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k0 is + * not positive. + * @exception GeographicErr if \e stdlat is not in [−90°, + * 90°]. + **********************************************************************/ + LambertConformalConic(real a, real f, real stdlat, real k0); + + /** + * Constructor with two standard parallels. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] stdlat1 first standard parallel (degrees). + * @param[in] stdlat2 second standard parallel (degrees). + * @param[in] k1 scale on the standard parallels. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k1 is + * not positive. + * @exception GeographicErr if \e stdlat1 or \e stdlat2 is not in + * [−90°, 90°], or if either \e stdlat1 or \e + * stdlat2 is a pole and \e stdlat1 is not equal \e stdlat2. + **********************************************************************/ + LambertConformalConic(real a, real f, real stdlat1, real stdlat2, real k1); + + /** + * Constructor with two standard parallels specified by sines and cosines. + * + * @param[in] a equatorial radius of ellipsoid (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] sinlat1 sine of first standard parallel. + * @param[in] coslat1 cosine of first standard parallel. + * @param[in] sinlat2 sine of second standard parallel. + * @param[in] coslat2 cosine of second standard parallel. + * @param[in] k1 scale on the standard parallels. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k1 is + * not positive. + * @exception GeographicErr if \e stdlat1 or \e stdlat2 is not in + * [−90°, 90°], or if either \e stdlat1 or \e + * stdlat2 is a pole and \e stdlat1 is not equal \e stdlat2. + * + * This allows parallels close to the poles to be specified accurately. + * This routine computes the latitude of origin and the scale at this + * latitude. In the case where \e lat1 and \e lat2 are different, the + * errors in this routines are as follows: if \e dlat = abs(\e lat2 − + * \e lat1) ≤ 160° and max(abs(\e lat1), abs(\e lat2)) ≤ 90 + * − min(0.0002, 2.2 × 10−6(180 − \e + * dlat), 6 × 10−8 dlat2) (in + * degrees), then the error in the latitude of origin is less than 4.5 + * × 10−14d and the relative error in the scale is + * less than 7 × 10−15. + **********************************************************************/ + LambertConformalConic(real a, real f, + real sinlat1, real coslat1, + real sinlat2, real coslat2, + real k1); + + /** + * Set the scale for the projection. + * + * @param[in] lat (degrees). + * @param[in] k scale at latitude \e lat (default 1). + * @exception GeographicErr \e k is not positive. + * @exception GeographicErr if \e lat is not in [−90°, + * 90°]. + **********************************************************************/ + void SetScale(real lat, real k = real(1)); + + /** + * Forward projection, from geographic to Lambert conformal conic. + * + * @param[in] lon0 central meridian longitude (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * The latitude origin is given by LambertConformalConic::LatitudeOrigin(). + * No false easting or northing is added and \e lat should be in the range + * [−90°, 90°]; \e lon and \e lon0 should be in the + * range [−540°, 540°). The error in the projection + * is less than about 10 nm (10 nanometers), true distance, and the errors + * in the meridian convergence and scale are consistent with this. The + * values of \e x and \e y returned for points which project to infinity + * (i.e., one or both of the poles) will be large but finite. + **********************************************************************/ + void Forward(real lon0, real lat, real lon, + real& x, real& y, real& gamma, real& k) const throw(); + + /** + * Reverse projection, from Lambert conformal conic to geographic. + * + * @param[in] lon0 central meridian longitude (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * The latitude origin is given by LambertConformalConic::LatitudeOrigin(). + * No false easting or northing is added. \e lon0 should be in the range + * [−540°, 540°). The value of \e lon returned is in + * the range [−180°, 180°). The error in the + * projection is less than about 10 nm (10 nanometers), true distance, and + * the errors in the meridian convergence and scale are consistent with + * this. + **********************************************************************/ + void Reverse(real lon0, real x, real y, + real& lat, real& lon, real& gamma, real& k) const throw(); + + /** + * LambertConformalConic::Forward without returning the convergence and + * scale. + **********************************************************************/ + void Forward(real lon0, real lat, real lon, + real& x, real& y) const throw() { + real gamma, k; + Forward(lon0, lat, lon, x, y, gamma, k); + } + + /** + * LambertConformalConic::Reverse without returning the convergence and + * scale. + **********************************************************************/ + void Reverse(real lon0, real x, real y, + real& lat, real& lon) const throw() { + real gamma, k; + Reverse(lon0, x, y, lat, lon, gamma, k); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _a; } + + /** + * @return \e f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _f; } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() { return 1/_f; } + /// \endcond + + /** + * @return latitude of the origin for the projection (degrees). + * + * This is the latitude of minimum scale and equals the \e stdlat in the + * 1-parallel constructor and lies between \e stdlat1 and \e stdlat2 in the + * 2-parallel constructors. + **********************************************************************/ + Math::real OriginLatitude() const throw() { return _lat0; } + + /** + * @return central scale for the projection. This is the scale on the + * latitude of origin. + **********************************************************************/ + Math::real CentralScale() const throw() { return _k0; } + ///@} + + /** + * A global instantiation of LambertConformalConic with the WGS84 + * ellipsoid, \e stdlat = 0, and \e k0 = 1. This degenerates to the + * Mercator projection. + **********************************************************************/ + static const LambertConformalConic Mercator; + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_LAMBERTCONFORMALCONIC_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/LocalCartesian.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/LocalCartesian.hpp new file mode 100644 index 000000000..9ce0b38f4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/LocalCartesian.hpp @@ -0,0 +1,249 @@ +/** + * \file LocalCartesian.hpp + * \brief Header for GeographicLib::LocalCartesian class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_LOCALCARTESIAN_HPP) +#define GEOGRAPHICLIB_LOCALCARTESIAN_HPP 1 + +#include +#include + +namespace GeographicLib { + + /** + * \brief Local cartesian coordinates + * + * Convert between geodetic coordinates latitude = \e lat, longitude = \e + * lon, height = \e h (measured vertically from the surface of the ellipsoid) + * to local cartesian coordinates (\e x, \e y, \e z). The origin of local + * cartesian coordinate system is at \e lat = \e lat0, \e lon = \e lon0, \e h + * = \e h0. The \e z axis is normal to the ellipsoid; the \e y axis points + * due north. The plane \e z = - \e h0 is tangent to the ellipsoid. + * + * The conversions all take place via geocentric coordinates using a + * Geocentric object (by default Geocentric::WGS84). + * + * Example of use: + * \include example-LocalCartesian.cpp + * + * CartConvert is a command-line utility + * providing access to the functionality of Geocentric and LocalCartesian. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT LocalCartesian { + private: + typedef Math::real real; + static const size_t dim_ = 3; + static const size_t dim2_ = dim_ * dim_; + Geocentric _earth; + real _lat0, _lon0, _h0; + real _x0, _y0, _z0, _r[dim2_]; + void IntForward(real lat, real lon, real h, real& x, real& y, real& z, + real M[dim2_]) const throw(); + void IntReverse(real x, real y, real z, real& lat, real& lon, real& h, + real M[dim2_]) const throw(); + void MatrixMultiply(real M[dim2_]) const throw(); + public: + + /** + * Constructor setting the origin. + * + * @param[in] lat0 latitude at origin (degrees). + * @param[in] lon0 longitude at origin (degrees). + * @param[in] h0 height above ellipsoid at origin (meters); default 0. + * @param[in] earth Geocentric object for the transformation; default + * Geocentric::WGS84. + * + * \e lat0 should be in the range [−90°, 90°]; \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + LocalCartesian(real lat0, real lon0, real h0 = 0, + const Geocentric& earth = Geocentric::WGS84) throw() + : _earth(earth) + { Reset(lat0, lon0, h0); } + + /** + * Default constructor. + * + * @param[in] earth Geocentric object for the transformation; default + * Geocentric::WGS84. + * + * Sets \e lat0 = 0, \e lon0 = 0, \e h0 = 0. + **********************************************************************/ + explicit LocalCartesian(const Geocentric& earth = Geocentric::WGS84) + throw() + : _earth(earth) + { Reset(real(0), real(0), real(0)); } + + /** + * Reset the origin. + * + * @param[in] lat0 latitude at origin (degrees). + * @param[in] lon0 longitude at origin (degrees). + * @param[in] h0 height above ellipsoid at origin (meters); default 0. + * + * \e lat0 should be in the range [−90°, 90°]; \e + * lon0 should be in the range [−540°, 540°). + **********************************************************************/ + void Reset(real lat0, real lon0, real h0 = 0) throw(); + + /** + * Convert from geodetic to local cartesian coordinates. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] h height of point above the ellipsoid (meters). + * @param[out] x local cartesian coordinate (meters). + * @param[out] y local cartesian coordinate (meters). + * @param[out] z local cartesian coordinate (meters). + * + * \e lat should be in the range [−90°, 90°]; \e lon + * should be in the range [−540°, 540°). + **********************************************************************/ + void Forward(real lat, real lon, real h, real& x, real& y, real& z) + const throw() { + IntForward(lat, lon, h, x, y, z, NULL); + } + + /** + * Convert from geodetic to local cartesian coordinates and return rotation + * matrix. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[in] h height of point above the ellipsoid (meters). + * @param[out] x local cartesian coordinate (meters). + * @param[out] y local cartesian coordinate (meters). + * @param[out] z local cartesian coordinate (meters). + * @param[out] M if the length of the vector is 9, fill with the rotation + * matrix in row-major order. + * + * \e lat should be in the range [−90°, 90°]; \e lon + * should be in the range [−540°, 540°). + * + * Let \e v be a unit vector located at (\e lat, \e lon, \e h). We can + * express \e v as \e column vectors in one of two ways + * - in east, north, up coordinates (where the components are relative to a + * local coordinate system at (\e lat, \e lon, \e h)); call this + * representation \e v1. + * - in \e x, \e y, \e z coordinates (where the components are relative to + * the local coordinate system at (\e lat0, \e lon0, \e h0)); call this + * representation \e v0. + * . + * Then we have \e v0 = \e M ⋅ \e v1. + **********************************************************************/ + void Forward(real lat, real lon, real h, real& x, real& y, real& z, + std::vector& M) + const throw() { + if (M.end() == M.begin() + dim2_) { + real t[dim2_]; + IntForward(lat, lon, h, x, y, z, t); + copy(t, t + dim2_, M.begin()); + } else + IntForward(lat, lon, h, x, y, z, NULL); + } + + /** + * Convert from local cartesian to geodetic coordinates. + * + * @param[in] x local cartesian coordinate (meters). + * @param[in] y local cartesian coordinate (meters). + * @param[in] z local cartesian coordinate (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] h height of point above the ellipsoid (meters). + * + * The value of \e lon returned is in the range [−180°, + * 180°). + **********************************************************************/ + void Reverse(real x, real y, real z, real& lat, real& lon, real& h) + const throw() { + IntReverse(x, y, z, lat, lon, h, NULL); + } + + /** + * Convert from local cartesian to geodetic coordinates and return rotation + * matrix. + * + * @param[in] x local cartesian coordinate (meters). + * @param[in] y local cartesian coordinate (meters). + * @param[in] z local cartesian coordinate (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] h height of point above the ellipsoid (meters). + * @param[out] M if the length of the vector is 9, fill with the rotation + * matrix in row-major order. + * + * Let \e v be a unit vector located at (\e lat, \e lon, \e h). We can + * express \e v as \e column vectors in one of two ways + * - in east, north, up coordinates (where the components are relative to a + * local coordinate system at (\e lat, \e lon, \e h)); call this + * representation \e v1. + * - in \e x, \e y, \e z coordinates (where the components are relative to + * the local coordinate system at (\e lat0, \e lon0, \e h0)); call this + * representation \e v0. + * . + * Then we have \e v1 = \e MT ⋅ \e v0, where \e + * MT is the transpose of \e M. + **********************************************************************/ + void Reverse(real x, real y, real z, real& lat, real& lon, real& h, + std::vector& M) + const throw() { + if (M.end() == M.begin() + dim2_) { + real t[dim2_]; + IntReverse(x, y, z, lat, lon, h, t); + copy(t, t + dim2_, M.begin()); + } else + IntReverse(x, y, z, lat, lon, h, NULL); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return latitude of the origin (degrees). + **********************************************************************/ + Math::real LatitudeOrigin() const throw() { return _lat0; } + + /** + * @return longitude of the origin (degrees). + **********************************************************************/ + Math::real LongitudeOrigin() const throw() { return _lon0; } + + /** + * @return height of the origin (meters). + **********************************************************************/ + Math::real HeightOrigin() const throw() { return _h0; } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value of \e a inherited from the Geocentric object used in the + * constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geocentric object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _earth.Flattening(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() + { return _earth.InverseFlattening(); } + /// \endcond + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_LOCALCARTESIAN_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/MGRS.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/MGRS.hpp new file mode 100644 index 000000000..e8ff0cbaf --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/MGRS.hpp @@ -0,0 +1,329 @@ +/** + * \file MGRS.hpp + * \brief Header for GeographicLib::MGRS class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_MGRS_HPP) +#define GEOGRAPHICLIB_MGRS_HPP 1 + +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs string +# pragma warning (push) +# pragma warning (disable: 4251) +#endif + +namespace GeographicLib { + + /** + * \brief Convert between UTM/UPS and %MGRS + * + * MGRS is defined in Chapter 3 of + * - J. W. Hager, L. L. Fry, S. S. Jacks, D. R. Hill, + * + + * Datums, Ellipsoids, Grids, and Grid Reference Systems, + * Defense Mapping Agency, Technical Manual TM8358.1 (1990). + * + * This implementation has the following properties: + * - The conversions are closed, i.e., output from Forward is legal input for + * Reverse and vice versa. Conversion in both directions preserve the + * UTM/UPS selection and the UTM zone. + * - Forward followed by Reverse and vice versa is approximately the + * identity. (This is affected in predictable ways by errors in + * determining the latitude band and by loss of precision in the MGRS + * coordinates.) + * - All MGRS coordinates truncate to legal 100 km blocks. All MGRS + * coordinates with a legal 100 km block prefix are legal (even though the + * latitude band letter may now belong to a neighboring band). + * - The range of UTM/UPS coordinates allowed for conversion to MGRS + * coordinates is the maximum consistent with staying within the letter + * ranges of the MGRS scheme. + * - All the transformations are implemented as static methods in the MGRS + * class. + * + * The NGA software package + * geotrans + * also provides conversions to and from MGRS. Version 3.0 (and earlier) + * suffers from some drawbacks: + * - Inconsistent rules are used to determine the whether a particular MGRS + * coordinate is legal. A more systematic approach is taken here. + * - The underlying projections are not very accurately implemented. + * + * Example of use: + * \include example-MGRS.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT MGRS { + private: + typedef Math::real real; + // The smallest length s.t., 1.0e7 - eps_ < 1.0e7 (approx 1.9 nm) + static const real eps_; + // The smallest angle s.t., 90 - eps_ < 90 (approx 50e-12 arcsec) + static const real angeps_; + static const std::string hemispheres_; + static const std::string utmcols_[3]; + static const std::string utmrow_; + static const std::string upscols_[4]; + static const std::string upsrows_[2]; + static const std::string latband_; + static const std::string upsband_; + static const std::string digits_; + + static const int mineasting_[4]; + static const int maxeasting_[4]; + static const int minnorthing_[4]; + static const int maxnorthing_[4]; + enum { + base_ = 10, + // Top-level tiles are 10^5 m = 100 km on a side + tilelevel_ = 5, + // Period of UTM row letters + utmrowperiod_ = 20, + // Row letters are shifted by 5 for even zones + utmevenrowshift_ = 5, + // Maximum precision is um + maxprec_ = 5 + 6, + }; + static void CheckCoords(bool utmp, bool& northp, real& x, real& y); + static int UTMRow(int iband, int icol, int irow) throw(); + + friend class UTMUPS; // UTMUPS::StandardZone calls LatitudeBand + // Return latitude band number [-10, 10) for the given latitude (degrees). + // The bands are reckoned in include their southern edges. + static int LatitudeBand(real lat) throw() { + int ilat = int(std::floor(lat)); + return (std::max)(-10, (std::min)(9, (ilat + 80)/8 - 10)); + } + // Return approximate latitude band number [-10, 10) for the given northing + // (meters). With this rule, each 100km tile would have a unique band + // letter corresponding to the latitude at the center of the tile. This + // function isn't currently used. + static int ApproxLatitudeBand(real y) throw() { + // northing at tile center in units of tile = 100km + real ya = std::floor( (std::min)(real(88), std::abs(y/tile_)) ) + + real(0.5); + // convert to lat (mult by 90/100) and then to band (divide by 8) + // the +1 fine tunes the boundary between bands 3 and 4 + int b = int(std::floor( ((ya * 9 + 1) / 10) / 8 )); + // For the northern hemisphere we have + // band rows num + // N 0 0:8 9 + // P 1 9:17 9 + // Q 2 18:26 9 + // R 3 27:34 8 + // S 4 35:43 9 + // T 5 44:52 9 + // U 6 53:61 9 + // V 7 62:70 9 + // W 8 71:79 9 + // X 9 80:94 15 + return y >= 0 ? b : -(b + 1); + } + // UTMUPS access these enums + enum { + tile_ = 100000, // Size MGRS blocks + minutmcol_ = 1, + maxutmcol_ = 9, + minutmSrow_ = 10, + maxutmSrow_ = 100, // Also used for UTM S false northing + minutmNrow_ = 0, // Also used for UTM N false northing + maxutmNrow_ = 95, + minupsSind_ = 8, // These 4 ind's apply to easting and northing + maxupsSind_ = 32, + minupsNind_ = 13, + maxupsNind_ = 27, + upseasting_ = 20, // Also used for UPS false northing + utmeasting_ = 5, // UTM false easting + // Difference between S hemisphere northing and N hemisphere northing + utmNshift_ = (maxutmSrow_ - minutmNrow_) * tile_ + }; + MGRS(); // Disable constructor + + public: + + /** + * Convert UTM or UPS coordinate to an MGRS coordinate. + * + * @param[in] zone UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[in] prec precision relative to 100 km. + * @param[out] mgrs MGRS string. + * @exception GeographicErr if \e zone, \e x, or \e y is outside its + * allowed range. + * @exception GeographicErr if the memory for the MGRS string can't be + * allocated. + * + * \e prec specifies the precision of the MGRS string as follows: + * - prec = 0 (min), 100 km + * - prec = 1, 10 km + * - prec = 2, 1 km + * - prec = 3, 100 m + * - prec = 4, 10 m + * - prec = 5, 1 m + * - prec = 6, 0.1 m + * - prec = 11 (max), 1 μm + * + * UTM eastings are allowed to be in the range [100 km, 900 km], northings + * are allowed to be in in [0 km, 9500 km] for the northern hemisphere and + * in [1000 km, 10000 km] for the southern hemisphere. (However UTM + * northings can be continued across the equator. So the actual limits on + * the northings are [−9000 km, 9500 km] for the "northern" + * hemisphere and [1000 km, 19500 km] for the "southern" hemisphere.) + * + * UPS eastings/northings are allowed to be in the range [1300 km, 2700 km] + * in the northern hemisphere and in [800 km, 3200 km] in the southern + * hemisphere. + * + * The ranges are 100 km more restrictive that for the conversion between + * geographic coordinates and UTM and UPS given by UTMUPS. These + * restrictions are dictated by the allowed letters in MGRS coordinates. + * The choice of 9500 km for the maximum northing for northern hemisphere + * and of 1000 km as the minimum northing for southern hemisphere provide + * at least 0.5 degree extension into standard UPS zones. The upper ends + * of the ranges for the UPS coordinates is dictated by requiring symmetry + * about the meridians 0E and 90E. + * + * All allowed UTM and UPS coordinates may now be converted to legal MGRS + * coordinates with the proviso that eastings and northings on the upper + * boundaries are silently reduced by about 4 nm (4 nanometers) to place + * them \e within the allowed range. (This includes reducing a southern + * hemisphere northing of 10000 km by 4 nm so that it is placed in latitude + * band M.) The UTM or UPS coordinates are truncated to requested + * precision to determine the MGRS coordinate. Thus in UTM zone 38N, the + * square area with easting in [444 km, 445 km) and northing in [3688 km, + * 3689 km) maps to MGRS coordinate 38SMB4488 (at \e prec = 2, 1 km), + * Khulani Sq., Baghdad. + * + * The UTM/UPS selection and the UTM zone is preserved in the conversion to + * MGRS coordinate. Thus for \e zone > 0, the MGRS coordinate begins with + * the zone number followed by one of [C--M] for the southern + * hemisphere and [N--X] for the northern hemisphere. For \e zone = + * 0, the MGRS coordinates begins with one of [AB] for the southern + * hemisphere and [XY] for the northern hemisphere. + * + * The conversion to the MGRS is exact for prec in [0, 5] except that a + * neighboring latitude band letter may be given if the point is within 5nm + * of a band boundary. For prec in [6, 11], the conversion is accurate to + * roundoff. + * + * If \e x or \e y is NaN or if \e zone is UTMUPS::INVALID, the returned + * MGRS string is "INVALID". + * + * Return the result via a reference argument to avoid the overhead of + * allocating a potentially large number of small strings. If an error is + * thrown, then \e mgrs is unchanged. + **********************************************************************/ + static void Forward(int zone, bool northp, real x, real y, + int prec, std::string& mgrs); + + /** + * Convert UTM or UPS coordinate to an MGRS coordinate when the latitude is + * known. + * + * @param[in] zone UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[in] lat latitude (degrees). + * @param[in] prec precision relative to 100 km. + * @param[out] mgrs MGRS string. + * @exception GeographicErr if \e zone, \e x, or \e y is outside its + * allowed range. + * @exception GeographicErr if \e lat is inconsistent with the given UTM + * coordinates. + * @exception std::bad_alloc if the memory for \e mgrs can't be allocated. + * + * The latitude is ignored for \e zone = 0 (UPS); otherwise the latitude is + * used to determine the latitude band and this is checked for consistency + * using the same tests as Reverse. + **********************************************************************/ + static void Forward(int zone, bool northp, real x, real y, real lat, + int prec, std::string& mgrs); + + /** + * Convert a MGRS coordinate to UTM or UPS coordinates. + * + * @param[in] mgrs MGRS string. + * @param[out] zone UTM zone (zero means UPS). + * @param[out] northp hemisphere (true means north, false means south). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] prec precision relative to 100 km. + * @param[in] centerp if true (default), return center of the MGRS square, + * else return SW (lower left) corner. + * @exception GeographicErr if \e mgrs is illegal. + * + * All conversions from MGRS to UTM/UPS are permitted provided the MGRS + * coordinate is a possible result of a conversion in the other direction. + * (The leading 0 may be dropped from an input MGRS coordinate for UTM + * zones 1--9.) In addition, MGRS coordinates with a neighboring + * latitude band letter are permitted provided that some portion of the + * 100 km block is within the given latitude band. Thus + * - 38VLS and 38WLS are allowed (latitude 64N intersects the square + * 38[VW]LS); but 38VMS is not permitted (all of 38VMS is north of 64N) + * - 38MPE and 38NPF are permitted (they straddle the equator); but 38NPE + * and 38MPF are not permitted (the equator does not intersect either + * block). + * - Similarly ZAB and YZB are permitted (they straddle the prime + * meridian); but YAB and ZZB are not (the prime meridian does not + * intersect either block). + * + * The UTM/UPS selection and the UTM zone is preserved in the conversion + * from MGRS coordinate. The conversion is exact for prec in [0, 5]. With + * centerp = true the conversion from MGRS to geographic and back is + * stable. This is not assured if \e centerp = false. + * + * If the first 3 characters of \e mgrs are "INV", then \e x and \e y are + * set to NaN and \e zone is set to UTMUPS::INVALID. + * + * If an exception is thrown, then the arguments are unchanged. + **********************************************************************/ + static void Reverse(const std::string& mgrs, + int& zone, bool& northp, real& x, real& y, + int& prec, bool centerp = true); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the WGS84 ellipsoid (meters). + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + static Math::real MajorRadius() throw() { return UTMUPS::MajorRadius(); } + + /** + * @return \e f the flattening of the WGS84 ellipsoid. + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + static Math::real Flattening() throw() { return UTMUPS::Flattening(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the WGS84 ellipsoid. + **********************************************************************/ + static Math::real InverseFlattening() throw() + { return UTMUPS::InverseFlattening(); } + /// \endcond + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_MGRS_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/MagneticCircle.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/MagneticCircle.hpp new file mode 100644 index 000000000..fd43043f9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/MagneticCircle.hpp @@ -0,0 +1,156 @@ +/** + * \file MagneticCircle.hpp + * \brief Header for GeographicLib::MagneticCircle class + * + * Copyright (c) Charles Karney (2011) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_MAGNETICCIRCLE_HPP) +#define GEOGRAPHICLIB_MAGNETICCIRCLE_HPP 1 + +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief Geomagnetic field on a circle of latitude + * + * Evaluate the earth's magnetic field on a circle of constant height and + * latitude. This uses a CircularEngine to pre-evaluate the inner sum of the + * spherical harmonic sum, allowing the values of the field at several + * different longitudes to be evaluated rapidly. + * + * Use MagneticModel::Circle to create a MagneticCircle object. (The + * constructor for this class is private.) + * + * Example of use: + * \include example-MagneticCircle.cpp + * + * MagneticField is a command-line utility + * providing access to the functionality of MagneticModel and MagneticCircle. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT MagneticCircle { + private: + typedef Math::real real; + + real _a, _f, _lat, _h, _t, _cphi, _sphi, _t1, _dt0; + bool _interpolate; + CircularEngine _circ0, _circ1; + + MagneticCircle(real a, real f, real lat, real h, real t, + real cphi, real sphi, real t1, real dt0, + bool interpolate, + const CircularEngine& circ0, const CircularEngine& circ1) + : _a(a) + , _f(f) + , _lat(lat) + , _h(h) + , _t(t) + , _cphi(cphi) + , _sphi(sphi) + , _t1(t1) + , _dt0(dt0) + , _interpolate(interpolate) + , _circ0(circ0) + , _circ1(circ1) + {} + + void Field(real lon, bool diffp, + real& Bx, real& By, real& Bz, + real& Bxt, real& Byt, real& Bzt) const throw(); + + friend class MagneticModel; // MagneticModel calls the private constructor + + public: + + /** + * A default constructor for the normal gravity. This sets up an + * uninitialized object which can be later replaced by the + * MagneticModel::Circle. + **********************************************************************/ + MagneticCircle() : _a(-1) {} + + /** \name Compute the magnetic field + **********************************************************************/ + ///@{ + /** + * Evaluate the components of the geomagnetic field at a particular + * longitude. + * + * @param[in] lon longitude of the point (degrees). + * @param[out] Bx the easterly component of the magnetic field (nanotesla). + * @param[out] By the northerly component of the magnetic field (nanotesla). + * @param[out] Bz the vertical (up) component of the magnetic field + * (nanotesla). + **********************************************************************/ + void operator()(real lon, real& Bx, real& By, real& Bz) const throw() { + real dummy; + Field(lon, false, Bx, By, Bz, dummy, dummy, dummy); + } + + /** + * Evaluate the components of the geomagnetic field and their time + * derivatives at a particular longitude. + * + * @param[in] lon longitude of the point (degrees). + * @param[out] Bx the easterly component of the magnetic field (nanotesla). + * @param[out] By the northerly component of the magnetic field (nanotesla). + * @param[out] Bz the vertical (up) component of the magnetic field + * (nanotesla). + * @param[out] Bxt the rate of change of \e Bx (nT/yr). + * @param[out] Byt the rate of change of \e By (nT/yr). + * @param[out] Bzt the rate of change of \e Bz (nT/yr). + **********************************************************************/ + void operator()(real lon, real& Bx, real& By, real& Bz, + real& Bxt, real& Byt, real& Bzt) const throw() { + Field(lon, true, Bx, By, Bz, Bxt, Byt, Bzt); + } + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return true if the object has been initialized. + **********************************************************************/ + bool Init() const throw() { return _a > 0; } + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the MagneticModel object used in the + * constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() + { return Init() ? _a : Math::NaN(); } + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the MagneticModel object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() + { return Init() ? _f : Math::NaN(); } + /** + * @return the latitude of the circle (degrees). + **********************************************************************/ + Math::real Latitude() const throw() + { return Init() ? _lat : Math::NaN(); } + /** + * @return the height of the circle (meters). + **********************************************************************/ + Math::real Height() const throw() + { return Init() ? _h : Math::NaN(); } + /** + * @return the time (fractional years). + **********************************************************************/ + Math::real Time() const throw() + { return Init() ? _t : Math::NaN(); } + + ///@} + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_MAGNETICCIRCLE_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/MagneticModel.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/MagneticModel.hpp new file mode 100644 index 000000000..b0e0aaf7f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/MagneticModel.hpp @@ -0,0 +1,343 @@ +/** + * \file MagneticModel.hpp + * \brief Header for GeographicLib::MagneticModel class + * + * Copyright (c) Charles Karney (2011) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_MAGNETICMODEL_HPP) +#define GEOGRAPHICLIB_MAGNETICMODEL_HPP 1 + +#include +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs vector +# pragma warning (push) +# pragma warning (disable: 4251) +#endif + +namespace GeographicLib { + + class MagneticCircle; + + /** + * \brief Model of the earth's magnetic field + * + * Evaluate the earth's magnetic field according to a model. At present only + * internal magnetic fields are handled. These are due to the earth's code + * and crust; these vary slowly (over many years). Excluded are the effects + * of currents in the ionosphere and magnetosphere which have daily and + * annual variations. + * + * See \ref magnetic for details of how to install the magnetic model and the + * data format. + * + * See + * - General information: + * - http://geomag.org/models/index.html + * - WMM2010: + * - http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml + * - http://ngdc.noaa.gov/geomag/WMM/data/WMM2010/WMM2010COF.zip + * - IGRF11: + * - http://ngdc.noaa.gov/IAGA/vmod/igrf.html + * - http://ngdc.noaa.gov/IAGA/vmod/igrf11coeffs.txt + * - http://ngdc.noaa.gov/IAGA/vmod/geomag70_linux.tar.gz + * - EMM2010: + * - http://ngdc.noaa.gov/geomag/EMM/index.html + * - http://ngdc.noaa.gov/geomag/EMM/data/geomag/EMM2010_Sph_Windows_Linux.zip + * + * Example of use: + * \include example-MagneticModel.cpp + * + * MagneticField is a command-line utility + * providing access to the functionality of MagneticModel and MagneticCircle. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT MagneticModel { + private: + typedef Math::real real; + static const int idlength_ = 8; + std::string _name, _dir, _description, _date, _filename, _id; + real _t0, _dt0, _tmin, _tmax, _a, _hmin, _hmax; + int _Nmodels; + SphericalHarmonic::normalization _norm; + Geocentric _earth; + std::vector< std::vector > _G; + std::vector< std::vector > _H; + std::vector _harm; + void Field(real t, real lat, real lon, real h, bool diffp, + real& Bx, real& By, real& Bz, + real& Bxt, real& Byt, real& Bzt) const throw(); + void ReadMetadata(const std::string& name); + MagneticModel(const MagneticModel&); // copy constructor not allowed + MagneticModel& operator=(const MagneticModel&); // nor copy assignment + public: + + /** \name Setting up the magnetic model + **********************************************************************/ + ///@{ + /** + * Construct a magnetic model. + * + * @param[in] name the name of the model. + * @param[in] path (optional) directory for data file. + * @param[in] earth (optional) Geocentric object for converting + * coordinates; default Geocentric::WGS84. + * @exception GeographicErr if the data file cannot be found, is + * unreadable, or is corrupt. + * @exception std::bad_alloc if the memory necessary for storing the model + * can't be allocated. + * + * A filename is formed by appending ".wmm" (World Magnetic Model) to the + * name. If \e path is specified (and is non-empty), then the file is + * loaded from directory, \e path. Otherwise the path is given by the + * DefaultMagneticPath(). + * + * This file contains the metadata which specifies the properties of the + * model. The coefficients for the spherical harmonic sums are obtained + * from a file obtained by appending ".cof" to metadata file (so the + * filename ends in ".wwm.cof"). + * + * The model is not tied to a particular ellipsoidal model of the earth. + * The final earth argument to the constructor specifies an ellipsoid to + * allow geodetic coordinates to the transformed into the spherical + * coordinates used in the spherical harmonic sum. + **********************************************************************/ + explicit MagneticModel(const std::string& name, + const std::string& path = "", + const Geocentric& earth = Geocentric::WGS84); + ///@} + + /** \name Compute the magnetic field + **********************************************************************/ + ///@{ + /** + * Evaluate the components of the geomagnetic field. + * + * @param[in] t the time (years). + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @param[in] h the height of the point above the ellipsoid (meters). + * @param[out] Bx the easterly component of the magnetic field (nanotesla). + * @param[out] By the northerly component of the magnetic field (nanotesla). + * @param[out] Bz the vertical (up) component of the magnetic field + * (nanotesla). + **********************************************************************/ + void operator()(real t, real lat, real lon, real h, + real& Bx, real& By, real& Bz) const throw() { + real dummy; + Field(t, lat, lon, h, false, Bx, By, Bz, dummy, dummy, dummy); + } + + /** + * Evaluate the components of the geomagnetic field and their time + * derivatives + * + * @param[in] t the time (years). + * @param[in] lat latitude of the point (degrees). + * @param[in] lon longitude of the point (degrees). + * @param[in] h the height of the point above the ellipsoid (meters). + * @param[out] Bx the easterly component of the magnetic field (nanotesla). + * @param[out] By the northerly component of the magnetic field (nanotesla). + * @param[out] Bz the vertical (up) component of the magnetic field + * (nanotesla). + * @param[out] Bxt the rate of change of \e Bx (nT/yr). + * @param[out] Byt the rate of change of \e By (nT/yr). + * @param[out] Bzt the rate of change of \e Bz (nT/yr). + **********************************************************************/ + void operator()(real t, real lat, real lon, real h, + real& Bx, real& By, real& Bz, + real& Bxt, real& Byt, real& Bzt) const throw() { + Field(t, lat, lon, h, true, Bx, By, Bz, Bxt, Byt, Bzt); + } + + /** + * Create a MagneticCircle object to allow the geomagnetic field at many + * points with constant \e lat, \e h, and \e t and varying \e lon to be + * computed efficiently. + * + * @param[in] t the time (years). + * @param[in] lat latitude of the point (degrees). + * @param[in] h the height of the point above the ellipsoid (meters). + * @exception std::bad_alloc if the memory necessary for creating a + * MagneticCircle can't be allocated. + * @return a MagneticCircle object whose MagneticCircle::operator()(real + * lon) member function computes the field at particular values of \e + * lon. + * + * If the field at several points on a circle of latitude need to be + * calculated then creating a MagneticCircle and using its member functions + * will be substantially faster, especially for high-degree models. + **********************************************************************/ + MagneticCircle Circle(real t, real lat, real h) const; + + /** + * Compute various quantities dependent on the magnetic field. + * + * @param[in] Bx the \e x (easterly) component of the magnetic field (nT). + * @param[in] By the \e y (northerly) component of the magnetic field (nT). + * @param[in] Bz the \e z (vertical, up positive) component of the magnetic + * field (nT). + * @param[out] H the horizontal magnetic field (nT). + * @param[out] F the total magnetic field (nT). + * @param[out] D the declination of the field (degrees east of north). + * @param[out] I the inclination of the field (degrees down from + * horizontal). + **********************************************************************/ + static void FieldComponents(real Bx, real By, real Bz, + real& H, real& F, real& D, real& I) throw() { + real Ht, Ft, Dt, It; + FieldComponents(Bx, By, Bz, real(0), real(1), real(0), + H, F, D, I, Ht, Ft, Dt, It); + } + + /** + * Compute various quantities dependent on the magnetic field and its rate + * of change. + * + * @param[in] Bx the \e x (easterly) component of the magnetic field (nT). + * @param[in] By the \e y (northerly) component of the magnetic field (nT). + * @param[in] Bz the \e z (vertical, up positive) component of the magnetic + * field (nT). + * @param[in] Bxt the rate of change of \e Bx (nT/yr). + * @param[in] Byt the rate of change of \e By (nT/yr). + * @param[in] Bzt the rate of change of \e Bz (nT/yr). + * @param[out] H the horizontal magnetic field (nT). + * @param[out] F the total magnetic field (nT). + * @param[out] D the declination of the field (degrees east of north). + * @param[out] I the inclination of the field (degrees down from + * horizontal). + * @param[out] Ht the rate of change of \e H (nT/yr). + * @param[out] Ft the rate of change of \e F (nT/yr). + * @param[out] Dt the rate of change of \e D (degrees/yr). + * @param[out] It the rate of change of \e I (degrees/yr). + **********************************************************************/ + static void FieldComponents(real Bx, real By, real Bz, + real Bxt, real Byt, real Bzt, + real& H, real& F, real& D, real& I, + real& Ht, real& Ft, real& Dt, real& It) throw(); + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return the description of the magnetic model, if available, from the + * Description file in the data file; if absent, return "NONE". + **********************************************************************/ + const std::string& Description() const throw() { return _description; } + + /** + * @return date of the model, if available, from the ReleaseDate field in + * the data file; if absent, return "UNKNOWN". + **********************************************************************/ + const std::string& DateTime() const throw() { return _date; } + + /** + * @return full file name used to load the magnetic model. + **********************************************************************/ + const std::string& MagneticFile() const throw() { return _filename; } + + /** + * @return "name" used to load the magnetic model (from the first argument + * of the constructor, but this may be overridden by the model file). + **********************************************************************/ + const std::string& MagneticModelName() const throw() { return _name; } + + /** + * @return directory used to load the magnetic model. + **********************************************************************/ + const std::string& MagneticModelDirectory() const throw() { return _dir; } + + /** + * @return the minimum height above the ellipsoid (in meters) for which + * this MagneticModel should be used. + * + * Because the model will typically provide useful results + * slightly outside the range of allowed heights, no check of \e t + * argument is made by MagneticModel::operator()() or + * MagneticModel::Circle. + **********************************************************************/ + Math::real MinHeight() const throw() { return _hmin; } + + /** + * @return the maximum height above the ellipsoid (in meters) for which + * this MagneticModel should be used. + * + * Because the model will typically provide useful results + * slightly outside the range of allowed heights, no check of \e t + * argument is made by MagneticModel::operator()() or + * MagneticModel::Circle. + **********************************************************************/ + Math::real MaxHeight() const throw() { return _hmax; } + + /** + * @return the minimum time (in years) for which this MagneticModel should + * be used. + * + * Because the model will typically provide useful results + * slightly outside the range of allowed times, no check of \e t + * argument is made by MagneticModel::operator()() or + * MagneticModel::Circle. + **********************************************************************/ + Math::real MinTime() const throw() { return _tmin; } + + /** + * @return the maximum time (in years) for which this MagneticModel should + * be used. + * + * Because the model will typically provide useful results + * slightly outside the range of allowed times, no check of \e t + * argument is made by MagneticModel::operator()() or + * MagneticModel::Circle. + **********************************************************************/ + Math::real MaxTime() const throw() { return _tmax; } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value of \e a inherited from the Geocentric object used in the + * constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geocentric object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _earth.Flattening(); } + ///@} + + /** + * @return the default path for magnetic model data files. + * + * This is the value of the environment variable MAGNETIC_PATH, if set; + * otherwise, it is $GEOGRAPHICLIB_DATA/magnetic if the environment + * variable GEOGRAPHICLIB_DATA is set; otherwise, it is a compile-time + * default (/usr/local/share/GeographicLib/magnetic on non-Windows systems + * and C:/Documents and Settings/All Users/Application + * Data/GeographicLib/magnetic on Windows systems). + **********************************************************************/ + static std::string DefaultMagneticPath(); + + /** + * @return the default name for the magnetic model. + * + * This is the value of the environment variable MAGNETIC_NAME, if set, + * otherwise, it is "wmm2010". The MagneticModel class does not use this + * function; it is just provided as a convenience for a calling program + * when constructing a MagneticModel object. + **********************************************************************/ + static std::string DefaultMagneticName(); + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_MAGNETICMODEL_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Math.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Math.hpp new file mode 100644 index 000000000..9971ebdf0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Math.hpp @@ -0,0 +1,528 @@ +/** + * \file Math.hpp + * \brief Header for GeographicLib::Math class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +// Constants.hpp includes Math.hpp. Place this include outside Math.hpp's +// include guard to enforce this ordering. +#include + +#if !defined(GEOGRAPHICLIB_MATH_HPP) +#define GEOGRAPHICLIB_MATH_HPP 1 + +/** + * Are C++11 math functions available? + **********************************************************************/ +#if !defined(GEOGRAPHICLIB_CPLUSPLUS11_MATH) +# if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 8 \ + && __cplusplus >= 201103 +# define GEOGRAPHICLIB_CPLUSPLUS11_MATH 1 +# elif defined(_MSC_VER) && _MSC_VER >= 1800 +# define GEOGRAPHICLIB_CPLUSPLUS11_MATH 1 +# else +# define GEOGRAPHICLIB_CPLUSPLUS11_MATH 0 +# endif +#endif + +#if !defined(WORDS_BIGENDIAN) +# define WORDS_BIGENDIAN 0 +#endif + +#if !defined(HAVE_LONG_DOUBLE) +# define HAVE_LONG_DOUBLE 0 +#endif + +#if !defined(GEOGRAPHICLIB_PRECISION) +/** + * The precision of floating point numbers used in %GeographicLib. 1 means + * float (single precision); 2 (the default) means double; 3 means long double; + * 4 is reserved for quadruple precision. Nearly all the testing has been + * carried out with doubles and that's the recommended configuration. In order + * for long double to be used, HAVE_LONG_DOUBLE needs to be defined. Note that + * with Microsoft Visual Studio, long double is the same as double. + **********************************************************************/ +# define GEOGRAPHICLIB_PRECISION 2 +#endif + +#include +#include +#include +#if defined(_LIBCPP_VERSION) +#include +#endif + +namespace GeographicLib { + + /** + * \brief Mathematical functions needed by %GeographicLib + * + * Define mathematical functions in order to localize system dependencies and + * to provide generic versions of the functions. In addition define a real + * type to be used by %GeographicLib. + * + * Example of use: + * \include example-Math.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT Math { + private: + void dummy() { + STATIC_ASSERT(GEOGRAPHICLIB_PRECISION >= 1 && + GEOGRAPHICLIB_PRECISION <= 3, + "Bad value of precision"); + } + Math(); // Disable constructor + public: + +#if HAVE_LONG_DOUBLE + /** + * The extended precision type for real numbers, used for some testing. + * This is long double on computers with this type; otherwise it is double. + **********************************************************************/ + typedef long double extended; +#else + typedef double extended; +#endif + +#if GEOGRAPHICLIB_PRECISION == 2 + /** + * The real type for %GeographicLib. Nearly all the testing has been done + * with \e real = double. However, the algorithms should also work with + * float and long double (where available). (CAUTION: reasonable + * accuracy typically cannot be obtained using floats.) + **********************************************************************/ + typedef double real; +#elif GEOGRAPHICLIB_PRECISION == 1 + typedef float real; +#elif GEOGRAPHICLIB_PRECISION == 3 + typedef extended real; +#else + typedef double real; +#endif + + /** + * Number of additional decimal digits of precision of real relative to + * double (0 for float). + **********************************************************************/ + static const int extradigits = + std::numeric_limits::digits10 > + std::numeric_limits::digits10 ? + std::numeric_limits::digits10 - + std::numeric_limits::digits10 : 0; + + /** + * true if the machine is big-endian. + **********************************************************************/ + static const bool bigendian = WORDS_BIGENDIAN; + + /** + * @tparam T the type of the returned value. + * @return π. + **********************************************************************/ + template static inline T pi() throw() + { return std::atan2(T(0), -T(1)); } + /** + * A synonym for pi(). + **********************************************************************/ + static inline real pi() throw() { return pi(); } + + /** + * @tparam T the type of the returned value. + * @return the number of radians in a degree. + **********************************************************************/ + template static inline T degree() throw() + { return pi() / T(180); } + /** + * A synonym for degree(). + **********************************************************************/ + static inline real degree() throw() { return degree(); } + + /** + * Square a number. + * + * @tparam T the type of the argument and the returned value. + * @param[in] x + * @return x2. + **********************************************************************/ + template static inline T sq(T x) throw() + { return x * x; } + +#if defined(DOXYGEN) + /** + * The hypotenuse function avoiding underflow and overflow. + * + * @tparam T the type of the arguments and the returned value. + * @param[in] x + * @param[in] y + * @return sqrt(x2 + y2). + **********************************************************************/ + template static inline T hypot(T x, T y) throw() { + x = std::abs(x); y = std::abs(y); + T a = (std::max)(x, y), b = (std::min)(x, y) / (a ? a : 1); + return a * std::sqrt(1 + b * b); + // For an alternative (square-root free) method see + // C. Moler and D. Morrision (1983) http://dx.doi.org/10.1147/rd.276.0577 + // and A. A. Dubrulle (1983) http://dx.doi.org/10.1147/rd.276.0582 + } +#elif GEOGRAPHICLIB_CPLUSPLUS11_MATH || (defined(_MSC_VER) && _MSC_VER >= 1700) + template static inline T hypot(T x, T y) throw() + { return std::hypot(x, y); } +# if HAVE_LONG_DOUBLE && defined(_MSC_VER) && _MSC_VER == 1700 + // Visual C++ 11 doesn't have a long double overload for std::hypot -- + // reported to MS on 2013-07-18 + // http://connect.microsoft.com/VisualStudio/feedback/details/794416 + // suppress the resulting "loss of data warning" with + static inline long double hypot(long double x, long double y) throw() + { return std::hypot(double(x), double(y)); } +# endif +#elif defined(_MSC_VER) + static inline double hypot(double x, double y) throw() + { return _hypot(x, y); } +# if _MSC_VER < 1400 + // Visual C++ 7.1/VS .NET 2003 does not have _hypotf() + static inline float hypot(float x, float y) throw() + { return float(_hypot(x, y)); } +# else + static inline float hypot(float x, float y) throw() + { return _hypotf(x, y); } +# endif +# if HAVE_LONG_DOUBLE + static inline long double hypot(long double x, long double y) throw() + { return _hypot(double(x), double(y)); } // Suppress loss of data warning +# endif +#else + // Use overloading to define generic versions + static inline double hypot(double x, double y) throw() + { return ::hypot(x, y); } + static inline float hypot(float x, float y) throw() + { return ::hypotf(x, y); } +# if HAVE_LONG_DOUBLE + static inline long double hypot(long double x, long double y) throw() + { return ::hypotl(x, y); } +# endif +#endif + +#if defined(DOXYGEN) || (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH) + /** + * exp(\e x) − 1 accurate near \e x = 0. This is taken from + * N. J. Higham, Accuracy and Stability of Numerical Algorithms, 2nd + * Edition (SIAM, 2002), Sec 1.14.1, p 19. + * + * @tparam T the type of the argument and the returned value. + * @param[in] x + * @return exp(\e x) − 1. + **********************************************************************/ + template static inline T expm1(T x) throw() { + volatile T + y = std::exp(x), + z = y - 1; + // The reasoning here is similar to that for log1p. The expression + // mathematically reduces to exp(x) - 1, and the factor z/log(y) = (y - + // 1)/log(y) is a slowly varying quantity near y = 1 and is accurately + // computed. + return std::abs(x) > 1 ? z : (z == 0 ? x : x * z / std::log(y)); + } +#elif GEOGRAPHICLIB_CPLUSPLUS11_MATH + template static inline T expm1(T x) throw() + { return std::expm1(x); } +#else + static inline double expm1(double x) throw() { return ::expm1(x); } + static inline float expm1(float x) throw() { return ::expm1f(x); } +# if HAVE_LONG_DOUBLE + static inline long double expm1(long double x) throw() + { return ::expm1l(x); } +# endif +#endif + +#if defined(DOXYGEN) || (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH) + /** + * log(1 + \e x) accurate near \e x = 0. + * + * This is taken from D. Goldberg, + * What every computer + * scientist should know about floating-point arithmetic (1991), + * Theorem 4. See also, Higham (op. cit.), Answer to Problem 1.5, p 528. + * + * @tparam T the type of the argument and the returned value. + * @param[in] x + * @return log(1 + \e x). + **********************************************************************/ + template static inline T log1p(T x) throw() { + volatile T + y = 1 + x, + z = y - 1; + // Here's the explanation for this magic: y = 1 + z, exactly, and z + // approx x, thus log(y)/z (which is nearly constant near z = 0) returns + // a good approximation to the true log(1 + x)/x. The multiplication x * + // (log(y)/z) introduces little additional error. + return z == 0 ? x : x * std::log(y) / z; + } +#elif GEOGRAPHICLIB_CPLUSPLUS11_MATH + template static inline T log1p(T x) throw() + { return std::log1p(x); } +#else + static inline double log1p(double x) throw() { return ::log1p(x); } + static inline float log1p(float x) throw() { return ::log1pf(x); } +# if HAVE_LONG_DOUBLE + static inline long double log1p(long double x) throw() + { return ::log1pl(x); } +# endif +#endif + +#if defined(DOXYGEN) || (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH) + /** + * The inverse hyperbolic sine function. This is defined in terms of + * Math::log1p(\e x) in order to maintain accuracy near \e x = 0. In + * addition, the odd parity of the function is enforced. + * + * @tparam T the type of the argument and the returned value. + * @param[in] x + * @return asinh(\e x). + **********************************************************************/ + template static inline T asinh(T x) throw() { + T y = std::abs(x); // Enforce odd parity + y = log1p(y * (1 + y/(hypot(T(1), y) + 1))); + return x < 0 ? -y : y; + } +#elif GEOGRAPHICLIB_CPLUSPLUS11_MATH + template static inline T asinh(T x) throw() + { return std::asinh(x); } +#else + static inline double asinh(double x) throw() { return ::asinh(x); } + static inline float asinh(float x) throw() { return ::asinhf(x); } +# if HAVE_LONG_DOUBLE + static inline long double asinh(long double x) throw() + { return ::asinhl(x); } +# endif +#endif + +#if defined(DOXYGEN) || (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH) + /** + * The inverse hyperbolic tangent function. This is defined in terms of + * Math::log1p(\e x) in order to maintain accuracy near \e x = 0. In + * addition, the odd parity of the function is enforced. + * + * @tparam T the type of the argument and the returned value. + * @param[in] x + * @return atanh(\e x). + **********************************************************************/ + template static inline T atanh(T x) throw() { + T y = std::abs(x); // Enforce odd parity + y = log1p(2 * y/(1 - y))/2; + return x < 0 ? -y : y; + } +#elif GEOGRAPHICLIB_CPLUSPLUS11_MATH + template static inline T atanh(T x) throw() + { return std::atanh(x); } +#else + static inline double atanh(double x) throw() { return ::atanh(x); } + static inline float atanh(float x) throw() { return ::atanhf(x); } +# if HAVE_LONG_DOUBLE + static inline long double atanh(long double x) throw() + { return ::atanhl(x); } +# endif +#endif + +#if defined(DOXYGEN) || (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH) + /** + * The cube root function. + * + * @tparam T the type of the argument and the returned value. + * @param[in] x + * @return the real cube root of \e x. + **********************************************************************/ + template static inline T cbrt(T x) throw() { + T y = std::pow(std::abs(x), 1/T(3)); // Return the real cube root + return x < 0 ? -y : y; + } +#elif GEOGRAPHICLIB_CPLUSPLUS11_MATH + template static inline T cbrt(T x) throw() + { return std::cbrt(x); } +#else + static inline double cbrt(double x) throw() { return ::cbrt(x); } + static inline float cbrt(float x) throw() { return ::cbrtf(x); } +# if HAVE_LONG_DOUBLE + static inline long double cbrt(long double x) throw() { return ::cbrtl(x); } +# endif +#endif + + /** + * The error-free sum of two numbers. + * + * @tparam T the type of the argument and the returned value. + * @param[in] u + * @param[in] v + * @param[out] t the exact error given by (\e u + \e v) - \e s. + * @return \e s = round(\e u + \e v). + * + * See D. E. Knuth, TAOCP, Vol 2, 4.2.2, Theorem B. (Note that \e t can be + * the same as one of the first two arguments.) + **********************************************************************/ + template static inline T sum(T u, T v, T& t) throw() { + volatile T s = u + v; + volatile T up = s - v; + volatile T vpp = s - up; + up -= u; + vpp -= v; + t = -(up + vpp); + // u + v = s + t + // = round(u + v) + t + return s; + } + + /** + * Normalize an angle (restricted input range). + * + * @tparam T the type of the argument and returned value. + * @param[in] x the angle in degrees. + * @return the angle reduced to the range [−180°, 180°). + * + * \e x must lie in [−540°, 540°). + **********************************************************************/ + template static inline T AngNormalize(T x) throw() + { return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); } + + /** + * Normalize an arbitrary angle. + * + * @tparam T the type of the argument and returned value. + * @param[in] x the angle in degrees. + * @return the angle reduced to the range [−180°, 180°). + * + * The range of \e x is unrestricted. + **********************************************************************/ + template static inline T AngNormalize2(T x) throw() + { return AngNormalize(std::fmod(x, T(360))); } + + /** + * Difference of two angles reduced to [−180°, 180°] + * + * @tparam T the type of the arguments and returned value. + * @param[in] x the first angle in degrees. + * @param[in] y the second angle in degrees. + * @return \e y − \e x, reduced to the range [−180°, + * 180°]. + * + * \e x and \e y must both lie in [−180°, 180°]. The result + * is equivalent to computing the difference exactly, reducing it to + * (−180°, 180°] and rounding the result. Note that this + * prescription allows −180° to be returned (e.g., if \e x is + * tiny and negative and \e y = 180°). + **********************************************************************/ + template static inline T AngDiff(T x, T y) throw() { + T t, d = sum(-x, y, t); + if ((d - T(180)) + t > T(0)) // y - x > 180 + d -= T(360); // exact + else if ((d + T(180)) + t <= T(0)) // y - x <= -180 + d += T(360); // exact + return d + t; + } + +#if defined(DOXYGEN) + /** + * Test for finiteness. + * + * @tparam T the type of the argument. + * @param[in] x + * @return true if number is finite, false if NaN or infinite. + **********************************************************************/ + template static inline bool isfinite(T x) throw() { + return std::abs(x) <= (std::numeric_limits::max)(); + } +#elif (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH) + template static inline bool isfinite(T x) throw() { + return _finite(double(x)) != 0; + } +#elif defined(_LIBCPP_VERSION) + // libc++ implements std::isfinite() as a template that only allows + // floating-point types. isfinite is invoked by Utility::str to format + // numbers conveniently and this allows integer arguments, so we need to + // allow Math::isfinite to work on integers. + template static inline + typename std::enable_if::value, bool>::type + isfinite(T x) throw() { + return std::isfinite(x); + } + template static inline + typename std::enable_if::value, bool>::type + isfinite(T /*x*/) throw() { + return true; + } +#else + template static inline bool isfinite(T x) throw() { + return std::isfinite(x); + } +#endif + + /** + * The NaN (not a number) + * + * @tparam T the type of the returned value. + * @return NaN if available, otherwise return the max real of type T. + **********************************************************************/ + template static inline T NaN() throw() { + return std::numeric_limits::has_quiet_NaN ? + std::numeric_limits::quiet_NaN() : + (std::numeric_limits::max)(); + } + /** + * A synonym for NaN(). + **********************************************************************/ + static inline real NaN() throw() { return NaN(); } + + /** + * Test for NaN. + * + * @tparam T the type of the argument. + * @param[in] x + * @return true if argument is a NaN. + **********************************************************************/ + template static inline bool isnan(T x) throw() { +#if defined(DOXYGEN) || (defined(_MSC_VER) && !GEOGRAPHICLIB_CPLUSPLUS11_MATH) + return x != x; +#else + return std::isnan(x); +#endif + } + + /** + * Infinity + * + * @tparam T the type of the returned value. + * @return infinity if available, otherwise return the max real. + **********************************************************************/ + template static inline T infinity() throw() { + return std::numeric_limits::has_infinity ? + std::numeric_limits::infinity() : + (std::numeric_limits::max)(); + } + /** + * A synonym for infinity(). + **********************************************************************/ + static inline real infinity() throw() { return infinity(); } + + /** + * Swap the bytes of a quantity + * + * @tparam T the type of the argument and the returned value. + * @param[in] x + * @return x with its bytes swapped. + **********************************************************************/ + template static inline T swab(T x) { + union { + T r; + unsigned char c[sizeof(T)]; + } b; + b.r = x; + for (int i = sizeof(T)/2; i--; ) + std::swap(b.c[i], b.c[sizeof(T) - 1 - i]); + return b.r; + } + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_MATH_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/NormalGravity.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/NormalGravity.hpp new file mode 100644 index 000000000..538422ce8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/NormalGravity.hpp @@ -0,0 +1,313 @@ +/** + * \file NormalGravity.hpp + * \brief Header for GeographicLib::NormalGravity class + * + * Copyright (c) Charles Karney (2011) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_NORMALGRAVITY_HPP) +#define GEOGRAPHICLIB_NORMALGRAVITY_HPP 1 + +#include +#include + +namespace GeographicLib { + + /** + * \brief The normal gravity of the earth + * + * "Normal" gravity refers to an idealization of the earth which is modeled + * as an rotating ellipsoid. The eccentricity of the ellipsoid, the rotation + * speed, and the distribution of mass within the ellipsoid are such that the + * surface of the ellipsoid is a surface of constant potential (gravitational + * plus centrifugal). The acceleration due to gravity is therefore + * perpendicular to the surface of the ellipsoid. + * + * There is a closed solution to this problem which is implemented here. + * Series "approximations" are only used to evaluate certain combinations of + * elementary functions where use of the closed expression results in a loss + * of accuracy for small arguments due to cancellation of the two leading + * terms. However these series include sufficient terms to give full machine + * precision. + * + * Definitions: + * - V0, the gravitational contribution to the normal + * potential; + * - Φ, the rotational contribution to the normal potential; + * - \e U = V0 + Φ, the total + * potential; + * - Γ = ∇V0, the acceleration due to + * mass of the earth; + * - f = ∇Φ, the centrifugal acceleration; + * - γ = ∇\e U = Γ + f, the normal + * acceleration; + * - \e X, \e Y, \e Z, geocentric coordinates; + * - \e x, \e y, \e z, local cartesian coordinates used to denote the east, + * north and up directions. + * + * References: + * - W. A. Heiskanen and H. Moritz, Physical Geodesy (Freeman, San + * Francisco, 1967), Secs. 1-19, 2-7, 2-8 (2-9, 2-10), 6-2 (6-3). + * - H. Moritz, Geodetic Reference System 1980, J. Geodesy 54(3), 395-405 + * (1980) http://dx.doi.org/10.1007/BF02521480 + * + * Example of use: + * \include example-NormalGravity.cpp + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT NormalGravity { + private: + static const int maxit_ = 10; + typedef Math::real real; + friend class GravityModel; + real _a, _GM, _omega, _f, _J2, _omega2, _aomega2; + real _e2, _ep2, _b, _E, _U0, _gammae, _gammap, _q0, _m, _k, _fstar; + Geocentric _earth; + static Math::real qf(real ep2) throw(); + static Math::real qpf(real ep2) throw(); + Math::real Jn(int n) const throw(); + public: + + /** \name Setting up the normal gravity + **********************************************************************/ + ///@{ + /** + * Constructor for the normal gravity. + * + * @param[in] a equatorial radius (meters). + * @param[in] GM mass constant of the ellipsoid + * (meters3/seconds2); this is the product of \e G + * the gravitational constant and \e M the mass of the earth (usually + * including the mass of the earth's atmosphere). + * @param[in] omega the angular velocity (rad s−1). + * @param[in] f the flattening of the ellipsoid. + * @param[in] J2 dynamical form factor. + * @exception if \e a is not positive or the other constants are + * inconsistent (see below). + * + * Exactly one of \e f and \e J2 should be positive and this will be used + * to define the ellipsoid. The shape of the ellipsoid can be given in one + * of two ways: + * - geometrically, the ellipsoid is defined by the flattening \e f = (\e a + * − \e b) / \e a, where \e a and \e b are the equatorial radius + * and the polar semi-axis. + * - physically, the ellipsoid is defined by the dynamical form factor + * J2 = (\e C − \e A) / Ma2, + * where \e A and \e C are the equatorial and polar moments of inertia + * and \e M is the mass of the earth. + **********************************************************************/ + NormalGravity(real a, real GM, real omega, real f, real J2); + + /** + * A default constructor for the normal gravity. This sets up an + * uninitialized object and is used by GravityModel which constructs this + * object before it has read in the parameters for the reference ellipsoid. + **********************************************************************/ + NormalGravity() : _a(-1) {} + ///@} + + /** \name Compute the gravity + **********************************************************************/ + ///@{ + /** + * Evaluate the gravity on the surface of the ellipsoid. + * + * @param[in] lat the geographic latitude (degrees). + * @return γ the acceleration due to gravity, positive downwards + * (m s−2). + * + * Due to the axial symmetry of the ellipsoid, the result is independent of + * the value of the longitude. This acceleration is perpendicular to the + * surface of the ellipsoid. It includes the effects of the earth's + * rotation. + **********************************************************************/ + Math::real SurfaceGravity(real lat) const throw(); + + /** + * Evaluate the gravity at an arbitrary point above (or below) the + * ellipsoid. + * + * @param[in] lat the geographic latitude (degrees). + * @param[in] h the height above the ellipsoid (meters). + * @param[out] gammay the northerly component of the acceleration + * (m s−2). + * @param[out] gammaz the upward component of the acceleration + * (m s−2); this is usually negative. + * @return \e U the corresponding normal potential. + * + * Due to the axial symmetry of the ellipsoid, the result is independent of + * the value of the longitude and the easterly component of the + * acceleration vanishes, \e gammax = 0. The function includes the effects + * of the earth's rotation. When \e h = 0, this function gives \e gammay = + * 0 and the returned value matches that of NormalGravity::SurfaceGravity. + **********************************************************************/ + Math::real Gravity(real lat, real h, real& gammay, real& gammaz) + const throw(); + + /** + * Evaluate the components of the acceleration due to gravity and the + * centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] gammaX the \e X component of the acceleration + * (m s−2). + * @param[out] gammaY the \e Y component of the acceleration + * (m s−2). + * @param[out] gammaZ the \e Z component of the acceleration + * (m s−2). + * @return \e U = V0 + Φ the sum of the + * gravitational and centrifugal potentials + * (m2 s−2). + * + * The acceleration given by γ = ∇\e U = + * ∇V0 + ∇Φ = Γ + f. + **********************************************************************/ + Math::real U(real X, real Y, real Z, + real& gammaX, real& gammaY, real& gammaZ) const throw(); + + /** + * Evaluate the components of the acceleration due to gravity alone in + * geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[in] Z geocentric coordinate of point (meters). + * @param[out] GammaX the \e X component of the acceleration due to gravity + * (m s−2). + * @param[out] GammaY the \e Y component of the acceleration due to gravity + * (m s−2). + * @param[out] GammaZ the \e Z component of the acceleration due to gravity + * (m s−2). + * @return V0 the gravitational potential + * (m2 s−2). + * + * This function excludes the centrifugal acceleration and is appropriate + * to use for space applications. In terrestrial applications, the + * function NormalGravity::U (which includes this effect) should usually be + * used. + **********************************************************************/ + Math::real V0(real X, real Y, real Z, + real& GammaX, real& GammaY, real& GammaZ) const throw(); + + /** + * Evaluate the centrifugal acceleration in geocentric coordinates. + * + * @param[in] X geocentric coordinate of point (meters). + * @param[in] Y geocentric coordinate of point (meters). + * @param[out] fX the \e X component of the centrifugal acceleration + * (m s−2). + * @param[out] fY the \e Y component of the centrifugal acceleration + * (m s−2). + * @return Φ the centrifugal potential (m2 + * s−2). + * + * Φ is independent of \e Z, thus \e fZ = 0. This function + * NormalGravity::U sums the results of NormalGravity::V0 and + * NormalGravity::Phi. + **********************************************************************/ + Math::real Phi(real X, real Y, real& fX, real& fY) const throw(); + ///@} + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return true if the object has been initialized. + **********************************************************************/ + bool Init() const throw() { return _a > 0; } + + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() + { return Init() ? _a : Math::NaN(); } + + /** + * @return \e GM the mass constant of the ellipsoid + * (m3 s−2). This is the value used in the + * constructor. + **********************************************************************/ + Math::real MassConstant() const throw() + { return Init() ? _GM : Math::NaN(); } + + /** + * @return \e Jn the dynamical form factors of the ellipsoid. + * + * If \e n = 2 (the default), this is the value of J2 + * used in the constructor. Otherwise it is the zonal coefficient of the + * Legendre harmonic sum of the normal gravitational potential. Note that + * \e Jn = 0 if \e n is odd. In most gravity applications, + * fully normalized Legendre functions are used and the corresponding + * coefficient is Cn0 = −\e Jn / + * sqrt(2 \e n + 1). + **********************************************************************/ + Math::real DynamicalFormFactor(int n = 2) const throw() + { return Init() ? ( n == 2 ? _J2 : Jn(n)) : Math::NaN(); } + + /** + * @return ω the angular velocity of the ellipsoid (rad + * s−1). This is the value used in the constructor. + **********************************************************************/ + Math::real AngularVelocity() const throw() + { return Init() ? _omega : Math::NaN(); } + + /** + * @return f the flattening of the ellipsoid (\e a − \e b)/\e + * a. + **********************************************************************/ + Math::real Flattening() const throw() + { return Init() ? _f : Math::NaN(); } + + /** + * @return γe the normal gravity at equator (m + * s−2). + **********************************************************************/ + Math::real EquatorialGravity() const throw() + { return Init() ? _gammae : Math::NaN(); } + + /** + * @return γp the normal gravity at poles (m + * s−2). + **********************************************************************/ + Math::real PolarGravity() const throw() + { return Init() ? _gammap : Math::NaN(); } + + /** + * @return f* the gravity flattening (γp − + * γe) / γe. + **********************************************************************/ + Math::real GravityFlattening() const throw() + { return Init() ? _fstar : Math::NaN(); } + + /** + * @return U0 the constant normal potential for the + * surface of the ellipsoid (m2 s−2). + **********************************************************************/ + Math::real SurfacePotential() const throw() + { return Init() ? _U0 : Math::NaN(); } + + /** + * @return the Geocentric object used by this instance. + **********************************************************************/ + const Geocentric& Earth() const throw() { return _earth; } + ///@} + + /** + * A global instantiation of NormalGravity for the WGS84 ellipsoid. + **********************************************************************/ + static const NormalGravity WGS84; + + /** + * A global instantiation of NormalGravity for the GRS80 ellipsoid. + **********************************************************************/ + static const NormalGravity GRS80; + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_NORMALGRAVITY_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/OSGB.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/OSGB.hpp new file mode 100644 index 000000000..c055dd877 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/OSGB.hpp @@ -0,0 +1,247 @@ +/** + * \file OSGB.hpp + * \brief Header for GeographicLib::OSGB class + * + * Copyright (c) Charles Karney (2010-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_OSGB_HPP) +#define GEOGRAPHICLIB_OSGB_HPP 1 + +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs string +# pragma warning (push) +# pragma warning (disable: 4251) +#endif + +namespace GeographicLib { + + /** + * \brief Ordnance Survey grid system for Great Britain + * + * The class implements the coordinate system used by the Ordnance Survey for + * maps of Great Britain and conversions to the grid reference system. + * + * See + * - + * A guide to coordinate systems in Great Britain + * - + * Guide to the National Grid + * + * \b WARNING: the latitudes and longitudes for the Ordnance Survey grid + * system do not use the WGS84 datum. Do not use the values returned by this + * class in the UTMUPS, MGRS, or Geoid classes without first converting the + * datum (and vice versa). + * + * Example of use: + * \include example-OSGB.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT OSGB { + private: + typedef Math::real real; + static const std::string letters_; + static const std::string digits_; + static const TransverseMercator OSGBTM_; + static real northoffset_; + static bool init_; + enum { + base_ = 10, + tile_ = 100000, + tilelevel_ = 5, + tilegrid_ = 5, + tileoffx_ = 2 * tilegrid_, + tileoffy_ = 1 * tilegrid_, + minx_ = - tileoffx_ * tile_, + miny_ = - tileoffy_ * tile_, + maxx_ = (tilegrid_*tilegrid_ - tileoffx_) * tile_, + maxy_ = (tilegrid_*tilegrid_ - tileoffy_) * tile_, + // Maximum precision is um + maxprec_ = 5 + 6, + }; + static real computenorthoffset() throw(); + static void CheckCoords(real x, real y); + OSGB(); // Disable constructor + public: + + /** + * Forward projection, from geographic to OSGB coordinates. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * \e lat should be in the range [−90°, 90°]; \e lon + * should be in the range [−540°, 540°). + **********************************************************************/ + static void Forward(real lat, real lon, + real& x, real& y, real& gamma, real& k) throw() { + OSGBTM_.Forward(OriginLongitude(), lat, lon, x, y, gamma, k); + x += FalseEasting(); + y += computenorthoffset(); + } + + /** + * Reverse projection, from OSGB coordinates to geographic. + * + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * The value of \e lon returned is in the range [−180°, + * 180°). + **********************************************************************/ + + static void Reverse(real x, real y, + real& lat, real& lon, real& gamma, real& k) throw() { + x -= FalseEasting(); + y -= computenorthoffset(); + OSGBTM_.Reverse(OriginLongitude(), x, y, lat, lon, gamma, k); + } + + /** + * OSGB::Forward without returning the convergence and scale. + **********************************************************************/ + static void Forward(real lat, real lon, real& x, real& y) throw() { + real gamma, k; + Forward(lat, lon, x, y, gamma, k); + } + + /** + * OSGB::Reverse without returning the convergence and scale. + **********************************************************************/ + static void Reverse(real x, real y, real& lat, real& lon) throw() { + real gamma, k; + Reverse(x, y, lat, lon, gamma, k); + } + + /** + * Convert OSGB coordinates to a grid reference. + * + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[in] prec precision relative to 100 km. + * @param[out] gridref National Grid reference. + * @exception GeographicErr if \e prec, \e x, or \e y is outside its + * allowed range. + * @exception std::bad_alloc if the memory for \e gridref can't be + * allocatied. + * + * \e prec specifies the precision of the grid reference string as follows: + * - prec = 0 (min), 100km + * - prec = 1, 10km + * - prec = 2, 1km + * - prec = 3, 100m + * - prec = 4, 10m + * - prec = 5, 1m + * - prec = 6, 0.1m + * - prec = 11 (max), 1μm + * + * The easting must be in the range [−1000 km, 1500 km) and the + * northing must be in the range [−500 km, 2000 km). These bounds + * are consistent with rules for the letter designations for the grid + * system. + **********************************************************************/ + static void GridReference(real x, real y, int prec, std::string& gridref); + + /** + * Convert OSGB coordinates to a grid reference. + * + * @param[in] gridref National Grid reference. + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] prec precision relative to 100 km. + * @param[in] centerp if true (default), return center of the grid square, + * else return SW (lower left) corner. + * @exception GeographicErr if \e gridref is illegal. + * + * The grid reference must be of the form: two letters (not including I) + * followed by an even number of digits (up to 22). + **********************************************************************/ + static void GridReference(const std::string& gridref, + real& x, real& y, int& prec, + bool centerp = true); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the Airy 1830 ellipsoid (meters). + * + * This is 20923713 ft converted to meters using the rule 1 ft = + * 109.48401603−10 m. (The Airy 1830 value is returned + * because the OSGB projection is based on this ellipsoid.) + **********************************************************************/ + static Math::real MajorRadius() throw() + // result is about 6377563.3960320664406 m + { return real(20923713) * std::pow(real(10), real(0.48401603L) - 1); } + + /** + * @return \e f the inverse flattening of the Airy 1830 ellipsoid. + * + * For the Airy 1830 ellipsoid, \e a = 20923713 ft and \e b = 20853810 ft; + * thus the flattening = (20923713 − 20853810)/20923713 = + * 7767/2324857 = 1/299.32496459... (The Airy 1830 value is returned + * because the OSGB projection is based on this ellipsoid.) + **********************************************************************/ + static Math::real Flattening() throw() + { return real(20923713 - 20853810) / real(20923713); } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the Airy 1830 ellipsoid. + **********************************************************************/ + static Math::real InverseFlattening() throw() { return 1/Flattening(); } + /// \endcond + + /** + * @return \e k0 central scale for the OSGB projection (0.9996012717...). + * + * C. J. Mugnier, Grids & Datums, PE&RS, Oct. 2003, states that + * this is defined as 109.9998268−10. + **********************************************************************/ + static Math::real CentralScale() throw() + { return std::pow(real(10), real(9998268 - 10000000) / real(10000000)); } + + /** + * @return latitude of the origin for the OSGB projection (49 degrees). + **********************************************************************/ + static Math::real OriginLatitude() throw() { return real(49); } + + /** + * @return longitude of the origin for the OSGB projection (−2 + * degrees). + **********************************************************************/ + static Math::real OriginLongitude() throw() { return real(-2); } + + /** + * @return false northing the OSGB projection (−100000 meters). + **********************************************************************/ + static Math::real FalseNorthing() throw() { return real(-100000); } + + /** + * @return false easting the OSGB projection (400000 meters). + **********************************************************************/ + static Math::real FalseEasting() throw() { return real(400000); } + ///@} + + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_OSGB_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/PolarStereographic.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/PolarStereographic.hpp new file mode 100644 index 000000000..0ff0d732e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/PolarStereographic.hpp @@ -0,0 +1,174 @@ +/** + * \file PolarStereographic.hpp + * \brief Header for GeographicLib::PolarStereographic class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP) +#define GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP 1 + +#include + +namespace GeographicLib { + + /** + * \brief Polar stereographic projection + * + * Implementation taken from the report, + * - J. P. Snyder, + * Map Projections: A + * Working Manual, USGS Professional Paper 1395 (1987), + * pp. 160--163. + * + * This is a straightforward implementation of the equations in Snyder except + * that Newton's method is used to invert the projection. + * + * Example of use: + * \include example-PolarStereographic.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT PolarStereographic { + private: + typedef Math::real real; + // _Cx used to be _C but g++ 3.4 has a macro of that name + real _a, _f, _e2, _e, _e2m, _Cx, _c; + real _k0; + static const real tol_; + static const real overflow_; + static const int numit_ = 5; + // tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right + static inline real tanx(real x) throw() { + real t = std::tan(x); + // Write the tests this way to ensure that tanx(NaN()) is NaN() + return x >= 0 ? (!(t < 0) ? t : overflow_) : (!(t >= 0) ? t : -overflow_); + } + // Return e * atanh(e * x) for f >= 0, else return + // - sqrt(-e2) * atan( sqrt(-e2) * x) for f < 0 + inline real eatanhe(real x) const throw() + { return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); } + public: + + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] k0 central scale factor. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k0 is + * not positive. + **********************************************************************/ + PolarStereographic(real a, real f, real k0); + + /** + * Set the scale for the projection. + * + * @param[in] lat (degrees) assuming \e northp = true. + * @param[in] k scale at latitude \e lat (default 1). + * @exception GeographicErr \e k is not positive. + * @exception GeographicErr if \e lat is not in (−90°, + * 90°]. + **********************************************************************/ + void SetScale(real lat, real k = real(1)); + + /** + * Forward projection, from geographic to polar stereographic. + * + * @param[in] northp the pole which is the center of projection (true means + * north, false means south). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lat should be in the range + * (−90°, 90°] for \e northp = true and in the range + * [−90°, 90°) for \e northp = false; \e lon should + * be in the range [−540°, 540°). + **********************************************************************/ + void Forward(bool northp, real lat, real lon, + real& x, real& y, real& gamma, real& k) const throw(); + + /** + * Reverse projection, from polar stereographic to geographic. + * + * @param[in] northp the pole which is the center of projection (true means + * north, false means south). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. The value of \e lon returned is + * in the range [−180°, 180°). + **********************************************************************/ + void Reverse(bool northp, real x, real y, + real& lat, real& lon, real& gamma, real& k) const throw(); + + /** + * PolarStereographic::Forward without returning the convergence and scale. + **********************************************************************/ + void Forward(bool northp, real lat, real lon, + real& x, real& y) const throw() { + real gamma, k; + Forward(northp, lat, lon, x, y, gamma, k); + } + + /** + * PolarStereographic::Reverse without returning the convergence and scale. + **********************************************************************/ + void Reverse(bool northp, real x, real y, + real& lat, real& lon) const throw() { + real gamma, k; + Reverse(northp, x, y, lat, lon, gamma, k); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _a; } + + /** + * @return \e f the flattening of the ellipsoid. This is the value used in + * the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _f; } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() { return 1/_f; } + /// \endcond + + /** + * The central scale for the projection. This is the value of \e k0 used + * in the constructor and is the scale at the pole unless overridden by + * PolarStereographic::SetScale. + **********************************************************************/ + Math::real CentralScale() const throw() { return _k0; } + ///@} + + /** + * A global instantiation of PolarStereographic with the WGS84 ellipsoid + * and the UPS scale factor. However, unlike UPS, no false easting or + * northing is added. + **********************************************************************/ + static const PolarStereographic UPS; + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_POLARSTEREOGRAPHIC_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/PolygonArea.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/PolygonArea.hpp new file mode 100644 index 000000000..cc1edf17f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/PolygonArea.hpp @@ -0,0 +1,247 @@ +/** + * \file PolygonArea.hpp + * \brief Header for GeographicLib::PolygonArea class + * + * Copyright (c) Charles Karney (2010-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_POLYGONAREA_HPP) +#define GEOGRAPHICLIB_POLYGONAREA_HPP 1 + +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief Polygon areas + * + * This computes the area of a polygon whose edges are geodesics using the + * method given in Section 6 of + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * + * This class lets you add vertices and edges one at a time to the polygon. + * The sequence must start with a vertex and thereafter vertices and edges + * can be added in any order. Any vertex after the first creates a new edge + * which is the ''shortest'' geodesic from the previous vertex. In some + * cases there may be two or many such shortest geodesics and the area is + * then not uniquely defined. In this case, either add an intermediate + * vertex or add the edge ''as'' an edge (by defining its direction and + * length). + * + * The area and perimeter are accumulated in two times the standard floating + * point precision to guard against the loss of accuracy with many-sided + * polygons. At any point you can ask for the perimeter and area so far. + * There's an option to treat the points as defining a polyline instead of a + * polygon; in that case, only the perimeter is computed. + * + * Example of use: + * \include example-PolygonArea.cpp + * + * Planimeter is a command-line utility + * providing access to the functionality of PolygonArea. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT PolygonArea { + private: + typedef Math::real real; + Geodesic _earth; + real _area0; // Full ellipsoid area + bool _polyline; // Assume polyline (don't close and skip area) + unsigned _mask; + unsigned _num; + int _crossings; + Accumulator _areasum, _perimetersum; + real _lat0, _lon0, _lat1, _lon1; + static inline int transit(real lon1, real lon2) throw() { + // Return 1 or -1 if crossing prime meridian in east or west direction. + // Otherwise return zero. + // Compute lon12 the same way as Geodesic::Inverse. + lon1 = Math::AngNormalize(lon1); + lon2 = Math::AngNormalize(lon2); + real lon12 = Math::AngDiff(lon1, lon2); + int cross = + lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 : + (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0); + return cross; + } + public: + + /** + * Constructor for PolygonArea. + * + * @param[in] earth the Geodesic object to use for geodesic calculations. + * By default this uses the WGS84 ellipsoid. + * @param[in] polyline if true that treat the points as defining a polyline + * instead of a polygon (default = false). + **********************************************************************/ + PolygonArea(const Geodesic& earth, bool polyline = false) throw() + : _earth(earth) + , _area0(_earth.EllipsoidArea()) + , _polyline(polyline) + , _mask(Geodesic::LATITUDE | Geodesic::LONGITUDE | Geodesic::DISTANCE | + (_polyline ? Geodesic::NONE : Geodesic::AREA)) + { Clear(); } + + /** + * Clear PolygonArea, allowing a new polygon to be started. + **********************************************************************/ + void Clear() throw() { + _num = 0; + _crossings = 0; + _areasum = 0; + _perimetersum = 0; + _lat0 = _lon0 = _lat1 = _lon1 = Math::NaN(); + } + + /** + * Add a point to the polygon or polyline. + * + * @param[in] lat the latitude of the point (degrees). + * @param[in] lon the longitude of the point (degrees). + * + * \e lat should be in the range [−90°, 90°] and \e + * lon should be in the range [−540°, 540°). + **********************************************************************/ + void AddPoint(real lat, real lon) throw(); + + /** + * Add an edge to the polygon or polyline. + * + * @param[in] azi azimuth at current point (degrees). + * @param[in] s distance from current point to next point (meters). + * + * \e azi should be in the range [−540°, 540°). This does + * nothing if no points have been added yet. Use PolygonArea::CurrentPoint + * to determine the position of the new vertex. + **********************************************************************/ + void AddEdge(real azi, real s) throw(); + + /** + * Return the results so far. + * + * @param[in] reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param[in] sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] perimeter the perimeter of the polygon or length of the + * polyline (meters). + * @param[out] area the area of the polygon (meters2); only set + * if \e polyline is false in the constructor. + * @return the number of points. + **********************************************************************/ + unsigned Compute(bool reverse, bool sign, + real& perimeter, real& area) const throw(); + + /** + * Return the results assuming a tentative final test point is added; + * however, the data for the test point is not saved. This lets you report + * a running result for the perimeter and area as the user moves the mouse + * cursor. Ordinary floating point arithmetic is used to accumulate the + * data for the test point; thus the area and perimeter returned are less + * accurate than if PolygonArea::AddPoint and PolygonArea::Compute are + * used. + * + * @param[in] lat the latitude of the test point (degrees). + * @param[in] lon the longitude of the test point (degrees). + * @param[in] reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param[in] sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] perimeter the approximate perimeter of the polygon or length + * of the polyline (meters). + * @param[out] area the approximate area of the polygon + * (meters2); only set if polyline is false in the + * constructor. + * @return the number of points. + * + * \e lat should be in the range [−90°, 90°] and \e + * lon should be in the range [−540°, 540°). + **********************************************************************/ + unsigned TestPoint(real lat, real lon, bool reverse, bool sign, + real& perimeter, real& area) const throw(); + + /** + * Return the results assuming a tentative final test point is added via an + * azimuth and distance; however, the data for the test point is not saved. + * This lets you report a running result for the perimeter and area as the + * user moves the mouse cursor. Ordinary floating point arithmetic is used + * to accumulate the data for the test point; thus the area and perimeter + * returned are less accurate than if PolygonArea::AddEdge and + * PolygonArea::Compute are used. + * + * @param[in] azi azimuth at current point (degrees). + * @param[in] s distance from current point to final test point (meters). + * @param[in] reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param[in] sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] perimeter the approximate perimeter of the polygon or length + * of the polyline (meters). + * @param[out] area the approximate area of the polygon + * (meters2); only set if polyline is false in the + * constructor. + * @return the number of points. + * + * \e azi should be in the range [−540°, 540°). + **********************************************************************/ + unsigned TestEdge(real azi, real s, bool reverse, bool sign, + real& perimeter, real& area) const throw(); + + /// \cond SKIP + /** + * DEPRECATED + * The old name for PolygonArea::TestPoint. + **********************************************************************/ + unsigned TestCompute(real lat, real lon, bool reverse, bool sign, + real& perimeter, real& area) const throw() { + return TestPoint(lat, lon, reverse, sign, perimeter, area); + } + /// \endcond + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + + Math::real MajorRadius() const throw() { return _earth.MajorRadius(); } + + /** + * @return \e f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _earth.Flattening(); } + + /** + * Report the previous vertex added to the polygon or polyline. + * + * @param[out] lat the latitude of the point (degrees). + * @param[out] lon the longitude of the point (degrees). + * + * If no points have been added, then NaNs are returned. Otherwise, \e lon + * will be in the range [−180°, 180°). + **********************************************************************/ + void CurrentPoint(real& lat, real& lon) const throw() + { lat = _lat1; lon = _lon1; } + ///@} + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_POLYGONAREA_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalEngine.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalEngine.hpp new file mode 100644 index 000000000..62b53c496 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalEngine.hpp @@ -0,0 +1,372 @@ +/** + * \file SphericalEngine.hpp + * \brief Header for GeographicLib::SphericalEngine class + * + * Copyright (c) Charles Karney (2011-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_SPHERICALENGINE_HPP) +#define GEOGRAPHICLIB_SPHERICALENGINE_HPP 1 + +#include +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about dll vs vector +# pragma warning (push) +# pragma warning (disable: 4251) +#endif + +namespace GeographicLib { + + class CircularEngine; + + /** + * \brief The evaluation engine for SphericalHarmonic + * + * This serves as the backend to SphericalHarmonic, SphericalHarmonic1, and + * SphericalHarmonic2. Typically end-users will not have to access this + * class directly. + * + * See SphericalEngine.cpp for more information on the implementation. + * + * Example of use: + * \include example-SphericalEngine.cpp + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT SphericalEngine { + private: + typedef Math::real real; + // A table of the square roots of integers + static std::vector root_; + friend class CircularEngine; // CircularEngine needs access to root_, scale_ + // An internal scaling of the coefficients to avoid overflow in + // intermediate calculations. + static const real scale_; + // Move latitudes near the pole off the axis by this amount. + static const real eps_; + static const std::vector Z_; + SphericalEngine(); // Disable constructor + public: + /** + * Supported normalizations for associated Legendre polynomials. + **********************************************************************/ + enum normalization { + /** + * Fully normalized associated Legendre polynomials. See + * SphericalHarmonic::FULL for documentation. + * + * @hideinitializer + **********************************************************************/ + FULL = 0, + /** + * Schmidt semi-normalized associated Legendre polynomials. See + * SphericalHarmonic::SCHMIDT for documentation. + * + * @hideinitializer + **********************************************************************/ + SCHMIDT = 1, + /// \cond SKIP + // These are deprecated... + full = FULL, + schmidt = SCHMIDT, + /// \endcond + }; + + /** + * \brief Package up coefficients for SphericalEngine + * + * This packages up the \e C, \e S coefficients and information about how + * the coefficients are stored into a single structure. This allows a + * vector of type SphericalEngine::coeff to be passed to + * SphericalEngine::Value. This class also includes functions to aid + * indexing into \e C and \e S. + * + * The storage layout of the coefficients is documented in + * SphericalHarmonic and SphericalHarmonic::SphericalHarmonic. + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT coeff { + private: + int _Nx, _nmx, _mmx; + std::vector::const_iterator _Cnm; + std::vector::const_iterator _Snm; + public: + /** + * A default constructor + **********************************************************************/ + coeff() + : _Nx(-1) + , _nmx(-1) + , _mmx(-1) + , _Cnm(Z_.begin()) + , _Snm(Z_.begin()) {} + /** + * The general constructor. + * + * @param[in] C a vector of coefficients for the cosine terms. + * @param[in] S a vector of coefficients for the sine terms. + * @param[in] N the degree giving storage layout for \e C and \e S. + * @param[in] nmx the maximum degree to be used. + * @param[in] mmx the maximum order to be used. + * @exception GeographicErr if \e N, \e nmx, and \e mmx do not satisfy + * \e N ≥ \e nmx ≥ \e mmx ≥ −1. + * @exception GeographicErr if \e C or \e S is not big enough to hold the + * coefficients. + * @exception std::bad_alloc if the memory for the square root table + * can't be allocated. + **********************************************************************/ + coeff(const std::vector& C, + const std::vector& S, + int N, int nmx, int mmx) + : _Nx(N) + , _nmx(nmx) + , _mmx(mmx) + , _Cnm(C.begin()) + , _Snm(S.begin()) + { + if (!(_Nx >= _nmx && _nmx >= _mmx && _mmx >= -1)) + throw GeographicErr("Bad indices for coeff"); + if (!(index(_nmx, _mmx) < int(C.size()) && + index(_nmx, _mmx) < int(S.size()) + (_Nx + 1))) + throw GeographicErr("Arrays too small in coeff"); + SphericalEngine::RootTable(_nmx); + } + /** + * The constructor for full coefficient vectors. + * + * @param[in] C a vector of coefficients for the cosine terms. + * @param[in] S a vector of coefficients for the sine terms. + * @param[in] N the maximum degree and order. + * @exception GeographicErr if \e N does not satisfy \e N ≥ −1. + * @exception GeographicErr if \e C or \e S is not big enough to hold the + * coefficients. + * @exception std::bad_alloc if the memory for the square root table + * can't be allocated. + **********************************************************************/ + coeff(const std::vector& C, + const std::vector& S, + int N) + : _Nx(N) + , _nmx(N) + , _mmx(N) + , _Cnm(C.begin()) + , _Snm(S.begin()) + { + if (!(_Nx >= -1)) + throw GeographicErr("Bad indices for coeff"); + if (!(index(_nmx, _mmx) < int(C.size()) && + index(_nmx, _mmx) < int(S.size()) + (_Nx + 1))) + throw GeographicErr("Arrays too small in coeff"); + SphericalEngine::RootTable(_nmx); + } + /** + * @return \e N the degree giving storage layout for \e C and \e S. + **********************************************************************/ + inline int N() const throw() { return _Nx; } + /** + * @return \e nmx the maximum degree to be used. + **********************************************************************/ + inline int nmx() const throw() { return _nmx; } + /** + * @return \e mmx the maximum order to be used. + **********************************************************************/ + inline int mmx() const throw() { return _mmx; } + /** + * The one-dimensional index into \e C and \e S. + * + * @param[in] n the degree. + * @param[in] m the order. + * @return the one-dimensional index. + **********************************************************************/ + inline int index(int n, int m) const throw() + { return m * _Nx - m * (m - 1) / 2 + n; } + /** + * An element of \e C. + * + * @param[in] k the one-dimensional index. + * @return the value of the \e C coefficient. + **********************************************************************/ + inline Math::real Cv(int k) const { return *(_Cnm + k); } + /** + * An element of \e S. + * + * @param[in] k the one-dimensional index. + * @return the value of the \e S coefficient. + **********************************************************************/ + inline Math::real Sv(int k) const { return *(_Snm + (k - (_Nx + 1))); } + /** + * An element of \e C with checking. + * + * @param[in] k the one-dimensional index. + * @param[in] n the requested degree. + * @param[in] m the requested order. + * @param[in] f a multiplier. + * @return the value of the \e C coefficient multiplied by \e f in \e n + * and \e m are in range else 0. + **********************************************************************/ + inline Math::real Cv(int k, int n, int m, real f) const + { return m > _mmx || n > _nmx ? 0 : *(_Cnm + k) * f; } + /** + * An element of \e S with checking. + * + * @param[in] k the one-dimensional index. + * @param[in] n the requested degree. + * @param[in] m the requested order. + * @param[in] f a multiplier. + * @return the value of the \e S coefficient multiplied by \e f in \e n + * and \e m are in range else 0. + **********************************************************************/ + inline Math::real Sv(int k, int n, int m, real f) const + { return m > _mmx || n > _nmx ? 0 : *(_Snm + (k - (_Nx + 1))) * f; } + + /** + * The size of the coefficient vector for the cosine terms. + * + * @param[in] N the maximum degree. + * @param[in] M the maximum order. + * @return the size of the vector of cosine terms as stored in column + * major order. + **********************************************************************/ + static inline int Csize(int N, int M) throw() + { return (M + 1) * (2 * N - M + 2) / 2; } + + /** + * The size of the coefficient vector for the sine terms. + * + * @param[in] N the maximum degree. + * @param[in] M the maximum order. + * @return the size of the vector of cosine terms as stored in column + * major order. + **********************************************************************/ + static inline int Ssize(int N, int M) throw () + { return Csize(N, M) - (N + 1); } + + /** + * Load coefficients from a binary stream. + * + * @param[in] stream the input stream. + * @param[out] N The maximum degree of the coefficients. + * @param[out] M The maximum order of the coefficients. + * @param[out] C The vector of cosine coefficients. + * @param[out] S The vector of sine coefficients. + * @exception GeographicErr if \e N and \e M do not satisfy \e N ≥ + * \e M ≥ −1. + * @exception GeographicErr if there's an error reading the data. + * @exception std::bad_alloc if the memory for \e C or \e S can't be + * allocated. + * + * \e N and \e M are read as 4-byte ints. \e C and \e S are resized to + * accommodate all the coefficients (with the \e m = 0 coefficients for + * \e S excluded) and the data for these coefficients read as 8-byte + * doubles. The coefficients are stored in column major order. The + * bytes in the stream should use little-endian ordering. IEEE floating + * point is assumed for the coefficients. + **********************************************************************/ + static void readcoeffs(std::istream& stream, int& N, int& M, + std::vector& C, std::vector& S); + }; + + /** + * Evaluate a spherical harmonic sum and its gradient. + * + * @tparam gradp should the gradient be calculated. + * @tparam norm the normalization for the associated Legendre polynomials. + * @tparam L the number of terms in the coefficients. + * @param[in] c an array of coeff objects. + * @param[in] f array of coefficient multipliers. f[0] should be 1. + * @param[in] x the \e x component of the cartesian position. + * @param[in] y the \e y component of the cartesian position. + * @param[in] z the \e z component of the cartesian position. + * @param[in] a the normalizing radius. + * @param[out] gradx the \e x component of the gradient. + * @param[out] grady the \e y component of the gradient. + * @param[out] gradz the \e z component of the gradient. + * @result the spherical harmonic sum. + * + * See the SphericalHarmonic class for the definition of the sum. The + * coefficients used by this function are, for example, c[0].Cv + f[1] * + * c[1].Cv + ... + f[L−1] * c[L−1].Cv. (Note that f[0] is \e + * not used.) The upper limits on the sum are determined by c[0].nmx() and + * c[0].mmx(); these limits apply to \e all the components of the + * coefficients. The parameters \e gradp, \e norm, and \e L are template + * parameters, to allow more optimization to be done at compile time. + * + * Clenshaw summation is used which permits the evaluation of the sum + * without the need to allocate temporary arrays. Thus this function never + * throws an exception. + **********************************************************************/ + template + static Math::real Value(const coeff c[], const real f[], + real x, real y, real z, real a, + real& gradx, real& grady, real& gradz) throw(); + + /** + * Create a CircularEngine object + * + * @tparam gradp should the gradient be calculated. + * @tparam norm the normalization for the associated Legendre polynomials. + * @tparam L the number of terms in the coefficients. + * @param[in] c an array of coeff objects. + * @param[in] f array of coefficient multipliers. f[0] should be 1. + * @param[in] p the radius of the circle = sqrt(x2 + + * y2). + * @param[in] z the height of the circle. + * @param[in] a the normalizing radius. + * @exception std::bad_alloc if the memory for the CircularEngine can't be + * allocated. + * @result the CircularEngine object. + * + * If you need to evaluate the spherical harmonic sum for several points + * with constant \e f, \e p = sqrt(x2 + + * y2), \e z, and \e a, it is more efficient to construct + * call SphericalEngine::Circle to give a CircularEngine object and then + * call CircularEngine::operator()() with arguments x/\e p and + * y/\e p. + **********************************************************************/ + template + static CircularEngine Circle(const coeff c[], const real f[], + real p, real z, real a); + /** + * Check that the static table of square roots is big enough and enlarge it + * if necessary. + * + * @param[in] N the maximum degree to be used in SphericalEngine. + * @exception std::bad_alloc if the memory for the square root table can't + * be allocated. + * + * Typically, there's no need for an end-user to call this routine, because + * the constructors for SphericalEngine::coeff do so. However, since this + * updates a static table, there's a possible race condition in a + * multi-threaded environment. Because this routine does nothing if the + * table is already large enough, one way to avoid race conditions is to + * call this routine at program start up (when it's still single threaded), + * supplying the largest degree that your program will use. E.g., \code + GeographicLib::SphericalEngine::RootTable(2190); + \endcode + * suffices to accommodate extant magnetic and gravity models. + **********************************************************************/ + static void RootTable(int N); + + /** + * Clear the static table of square roots and release the memory. Call + * this only when you are sure you no longer will be using SphericalEngine. + * Your program will crash if you call SphericalEngine after calling this + * routine. It's safest not to call this routine at all. (The space + * used by the table is modest.) + **********************************************************************/ + static void ClearRootTable() { + std::vector temp(0); + root_.swap(temp); + } + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_SPHERICALENGINE_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic.hpp new file mode 100644 index 000000000..a030c6927 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic.hpp @@ -0,0 +1,350 @@ +/** + * \file SphericalHarmonic.hpp + * \brief Header for GeographicLib::SphericalHarmonic class + * + * Copyright (c) Charles Karney (2011) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC_HPP) +#define GEOGRAPHICLIB_SPHERICALHARMONIC_HPP 1 + +#include +#include +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief Spherical harmonic series + * + * This class evaluates the spherical harmonic sum \verbatim + V(x, y, z) = sum(n = 0..N)[ q^(n+1) * sum(m = 0..n)[ + (C[n,m] * cos(m*lambda) + S[n,m] * sin(m*lambda)) * + P[n,m](cos(theta)) ] ] + \endverbatim + * where + * - p2 = x2 + y2, + * - r2 = p2 + z2, + * - \e q = a/r, + * - θ = atan2(\e p, \e z) = the spherical \e colatitude, + * - λ = atan2(\e y, \e x) = the longitude. + * - P\e nm(\e t) is the associated Legendre polynomial of degree + * \e n and order \e m. + * + * Two normalizations are supported for P\e nm + * - fully normalized denoted by SphericalHarmonic::FULL. + * - Schmidt semi-normalized denoted by SphericalHarmonic::SCHMIDT. + * + * Clenshaw summation is used for the sums over both \e n and \e m. This + * allows the computation to be carried out without the need for any + * temporary arrays. See SphericalEngine.cpp for more information on the + * implementation. + * + * References: + * - C. W. Clenshaw, A note on the summation of Chebyshev series, + * %Math. Tables Aids Comput. 9(51), 118--120 (1955). + * - R. E. Deakin, Derivatives of the earth's potentials, Geomatics + * Research Australasia 68, 31--60, (June 1998). + * - W. A. Heiskanen and H. Moritz, Physical Geodesy, (Freeman, San + * Francisco, 1967). (See Sec. 1-14, for a definition of Pbar.) + * - S. A. Holmes and W. E. Featherstone, A unified approach to the Clenshaw + * summation and the recursive computation of very high degree and order + * normalised associated Legendre functions, J. Geodesy 76(5), + * 279--299 (2002). + * - C. C. Tscherning and K. Poder, Some geodetic applications of Clenshaw + * summation, Boll. Geod. Sci. Aff. 41(4), 349--375 (1982). + * + * Example of use: + * \include example-SphericalHarmonic.cpp + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT SphericalHarmonic { + public: + /** + * Supported normalizations for the associated Legendre polynomials. + **********************************************************************/ + enum normalization { + /** + * Fully normalized associated Legendre polynomials. + * + * These are defined by Pnmfull(\e z) + * = (−1)m sqrt(\e k (2\e n + 1) (\e n − \e + * m)! / (\e n + \e m)!) + * Pnm(\e z), where + * Pnm(\e z) is Ferrers + * function (also known as the Legendre function on the cut or the + * associated Legendre polynomial) http://dlmf.nist.gov/14.7.E10 and \e k + * = 1 for \e m = 0 and \e k = 2 otherwise. + * + * The mean squared value of + * Pnmfull(cosθ) + * cos(mλ) and + * Pnmfull(cosθ) + * sin(mλ) over the sphere is 1. + * + * @hideinitializer + **********************************************************************/ + FULL = SphericalEngine::FULL, + /** + * Schmidt semi-normalized associated Legendre polynomials. + * + * These are defined by Pnmschmidt(\e + * z) = (−1)m sqrt(\e k (\e n − \e m)! / + * (\e n + \e m)!) Pnm(\e z), + * where Pnm(\e z) is Ferrers + * function (also known as the Legendre function on the cut or the + * associated Legendre polynomial) http://dlmf.nist.gov/14.7.E10 and \e k + * = 1 for \e m = 0 and \e k = 2 otherwise. + * + * The mean squared value of + * Pnmschmidt(cosθ) + * cos(mλ) and + * Pnmschmidt(cosθ) + * sin(mλ) over the sphere is 1/(2\e n + 1). + * + * @hideinitializer + **********************************************************************/ + SCHMIDT = SphericalEngine::SCHMIDT, + /// \cond SKIP + // These are deprecated... + full = FULL, + schmidt = SCHMIDT, + /// \endcond + }; + + private: + typedef Math::real real; + SphericalEngine::coeff _c[1]; + real _a; + unsigned _norm; + + public: + /** + * Constructor with a full set of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the maximum degree and order of the sum + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic::full (the default) or + * SphericalHarmonic::schmidt. + * @exception GeographicErr if \e N does not satisfy \e N ≥ −1. + * @exception GeographicErr if \e C or \e S is not big enough to hold the + * coefficients. + * + * The coefficients \e C\e nm and \e S\e nm are + * stored in the one-dimensional vectors \e C and \e S which must contain + * (\e N + 1)(\e N + 2)/2 and N (\e N + 1)/2 elements, respectively, stored + * in "column-major" order. Thus for \e N = 3, the order would be: + * C00, + * C10, + * C20, + * C30, + * C11, + * C21, + * C31, + * C22, + * C32, + * C33. + * In general the (\e n,\e m) element is at index \e m \e N − \e m + * (\e m − 1)/2 + \e n. The layout of \e S is the same except that + * the first column is omitted (since the \e m = 0 terms never contribute + * to the sum) and the 0th element is S11 + * + * The class stores pointers to the first elements of \e C and \e S. + * These arrays should not be altered or destroyed during the lifetime of a + * SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic(const std::vector& C, + const std::vector& S, + int N, real a, unsigned norm = FULL) + : _a(a) + , _norm(norm) + { _c[0] = SphericalEngine::coeff(C, S, N); } + + /** + * Constructor with a subset of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the degree used to determine the layout of \e C and \e S. + * @param[in] nmx the maximum degree used in the sum. The sum over \e n is + * from 0 thru \e nmx. + * @param[in] mmx the maximum order used in the sum. The sum over \e m is + * from 0 thru min(\e n, \e mmx). + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic::FULL (the default) or + * SphericalHarmonic::SCHMIDT. + * @exception GeographicErr if \e N, \e nmx, and \e mmx do not satisfy + * \e N ≥ \e nmx ≥ \e mmx ≥ −1. + * @exception GeographicErr if \e C or \e S is not big enough to hold the + * coefficients. + * + * The class stores pointers to the first elements of \e C and \e S. + * These arrays should not be altered or destroyed during the lifetime of a + * SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic(const std::vector& C, + const std::vector& S, + int N, int nmx, int mmx, + real a, unsigned norm = FULL) + : _a(a) + , _norm(norm) + { _c[0] = SphericalEngine::coeff(C, S, N, nmx, mmx); } + + /** + * A default constructor so that the object can be created when the + * constructor for another object is initialized. This default object can + * then be reset with the default copy assignment operator. + **********************************************************************/ + SphericalHarmonic() {} + + /** + * Compute the spherical harmonic sum. + * + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @return \e V the spherical harmonic sum. + * + * This routine requires constant memory and thus never throws an + * exception. + **********************************************************************/ + Math::real operator()(real x, real y, real z) const throw() { + real f[] = {1}; + real v = 0; + real dummy; + switch (_norm) { + case FULL: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, dummy, dummy, dummy); + break; + case SCHMIDT: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, dummy, dummy, dummy); + break; + } + return v; + } + + /** + * Compute a spherical harmonic sum and its gradient. + * + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @param[out] gradx \e x component of the gradient + * @param[out] grady \e y component of the gradient + * @param[out] gradz \e z component of the gradient + * @return \e V the spherical harmonic sum. + * + * This is the same as the previous function, except that the components of + * the gradients of the sum in the \e x, \e y, and \e z directions are + * computed. This routine requires constant memory and thus never throws + * an exception. + **********************************************************************/ + Math::real operator()(real x, real y, real z, + real& gradx, real& grady, real& gradz) const throw() { + real f[] = {1}; + real v = 0; + switch (_norm) { + case FULL: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, gradx, grady, gradz); + break; + case SCHMIDT: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, gradx, grady, gradz); + break; + } + return v; + } + + /** + * Create a CircularEngine to allow the efficient evaluation of several + * points on a circle of latitude. + * + * @param[in] p the radius of the circle. + * @param[in] z the height of the circle above the equatorial plane. + * @param[in] gradp if true the returned object will be able to compute the + * gradient of the sum. + * @exception std::bad_alloc if the memory for the CircularEngine can't be + * allocated. + * @return the CircularEngine object. + * + * SphericalHarmonic::operator()() exchanges the order of the sums in the + * definition, i.e., ∑n = 0..Nm = 0..n + * becomes ∑m = 0..Nn = m..N. + * SphericalHarmonic::Circle performs the inner sum over degree \e n (which + * entails about N2 operations). Calling + * CircularEngine::operator()() on the returned object performs the outer + * sum over the order \e m (about \e N operations). + * + * Here's an example of computing the spherical sum at a sequence of + * longitudes without using a CircularEngine object \code + SphericalHarmonic h(...); // Create the SphericalHarmonic object + double r = 2, lat = 33, lon0 = 44, dlon = 0.01; + double + phi = lat * Math::degree(), + z = r * sin(phi), p = r * cos(phi); + for (int i = 0; i <= 100; ++i) { + real + lon = lon0 + i * dlon, + lam = lon * Math::degree(); + std::cout << lon << " " << h(p * cos(lam), p * sin(lam), z) << "\n"; + } + \endcode + * Here is the same calculation done using a CircularEngine object. This + * will be about N/2 times faster. \code + SphericalHarmonic h(...); // Create the SphericalHarmonic object + double r = 2, lat = 33, lon0 = 44, dlon = 0.01; + double + phi = lat * Math::degree(), + z = r * sin(phi), p = r * cos(phi); + CircularEngine c(h(p, z, false)); // Create the CircularEngine object + for (int i = 0; i <= 100; ++i) { + real + lon = lon0 + i * dlon; + std::cout << lon << " " << c(lon) << "\n"; + } + \endcode + **********************************************************************/ + CircularEngine Circle(real p, real z, bool gradp) const { + real f[] = {1}; + switch (_norm) { + case FULL: + return gradp ? + SphericalEngine::Circle + (_c, f, p, z, _a) : + SphericalEngine::Circle + (_c, f, p, z, _a); + break; + case SCHMIDT: + default: // To avoid compiler warnings + return gradp ? + SphericalEngine::Circle + (_c, f, p, z, _a) : + SphericalEngine::Circle + (_c, f, p, z, _a); + break; + } + } + + /** + * @return the zeroth SphericalEngine::coeff object. + **********************************************************************/ + const SphericalEngine::coeff& Coefficients() const throw() + { return _c[0]; } + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_SPHERICALHARMONIC_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic1.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic1.hpp new file mode 100644 index 000000000..d46741bfe --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic1.hpp @@ -0,0 +1,283 @@ +/** + * \file SphericalHarmonic1.hpp + * \brief Header for GeographicLib::SphericalHarmonic1 class + * + * Copyright (c) Charles Karney (2011) and licensed under + * the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC1_HPP) +#define GEOGRAPHICLIB_SPHERICALHARMONIC1_HPP 1 + +#include +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief Spherical harmonic series with a correction to the coefficients + * + * This classes is similar to SphericalHarmonic, except that the coefficients + * \e C\e nm are replaced by \e C\e nm + \e tau + * C'\e nm (and similarly for \e S\e nm). + * + * Example of use: + * \include example-SphericalHarmonic1.cpp + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT SphericalHarmonic1 { + public: + /** + * Supported normalizations for associate Legendre polynomials. + **********************************************************************/ + enum normalization { + /** + * Fully normalized associated Legendre polynomials. See + * SphericalHarmonic::FULL for documentation. + * + * @hideinitializer + **********************************************************************/ + FULL = SphericalEngine::FULL, + /** + * Schmidt semi-normalized associated Legendre polynomials. See + * SphericalHarmonic::SCHMIDT for documentation. + * + * @hideinitializer + **********************************************************************/ + SCHMIDT = SphericalEngine::SCHMIDT, + /// \cond SKIP + // These are deprecated... + full = FULL, + schmidt = SCHMIDT, + /// \endcond + }; + + private: + typedef Math::real real; + SphericalEngine::coeff _c[2]; + real _a; + unsigned _norm; + + public: + /** + * Constructor with a full set of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the maximum degree and order of the sum + * @param[in] C1 the coefficients \e C'\e nm. + * @param[in] S1 the coefficients \e S'\e nm. + * @param[in] N1 the maximum degree and order of the correction + * coefficients \e C'\e nm and \e S'\e nm. + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic1::FULL (the default) or + * SphericalHarmonic1::SCHMIDT. + * @exception GeographicErr if \e N and \e N1 do not satisfy \e N ≥ + * \e N1 ≥ −1. + * @exception GeographicErr if any of the vectors of coefficients is not + * large enough. + * + * See SphericalHarmonic for the way the coefficients should be stored. + * + * The class stores pointers to the first elements of \e C, \e S, \e + * C', and \e S'. These arrays should not be altered or destroyed during + * the lifetime of a SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic1(const std::vector& C, + const std::vector& S, + int N, + const std::vector& C1, + const std::vector& S1, + int N1, + real a, unsigned norm = FULL) + : _a(a) + , _norm(norm) { + if (!(N1 <= N)) + throw GeographicErr("N1 cannot be larger that N"); + _c[0] = SphericalEngine::coeff(C, S, N); + _c[1] = SphericalEngine::coeff(C1, S1, N1); + } + + /** + * Constructor with a subset of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the degree used to determine the layout of \e C and \e S. + * @param[in] nmx the maximum degree used in the sum. The sum over \e n is + * from 0 thru \e nmx. + * @param[in] mmx the maximum order used in the sum. The sum over \e m is + * from 0 thru min(\e n, \e mmx). + * @param[in] C1 the coefficients \e C'\e nm. + * @param[in] S1 the coefficients \e S'\e nm. + * @param[in] N1 the degree used to determine the layout of \e C' and \e + * S'. + * @param[in] nmx1 the maximum degree used for \e C' and \e S'. + * @param[in] mmx1 the maximum order used for \e C' and \e S'. + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic1::FULL (the default) or + * SphericalHarmonic1::SCHMIDT. + * @exception GeographicErr if the parameters do not satisfy \e N ≥ \e + * nmx ≥ \e mmx ≥ −1; \e N1 ≥ \e nmx1 ≥ \e mmx1 ≥ + * −1; \e N ≥ \e N1; \e nmx ≥ \e nmx1; \e mmx ≥ \e mmx1. + * @exception GeographicErr if any of the vectors of coefficients is not + * large enough. + * + * The class stores pointers to the first elements of \e C, \e S, \e + * C', and \e S'. These arrays should not be altered or destroyed during + * the lifetime of a SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic1(const std::vector& C, + const std::vector& S, + int N, int nmx, int mmx, + const std::vector& C1, + const std::vector& S1, + int N1, int nmx1, int mmx1, + real a, unsigned norm = FULL) + : _a(a) + , _norm(norm) { + if (!(nmx1 <= nmx)) + throw GeographicErr("nmx1 cannot be larger that nmx"); + if (!(mmx1 <= mmx)) + throw GeographicErr("mmx1 cannot be larger that mmx"); + _c[0] = SphericalEngine::coeff(C, S, N, nmx, mmx); + _c[1] = SphericalEngine::coeff(C1, S1, N1, nmx1, mmx1); + } + + /** + * A default constructor so that the object can be created when the + * constructor for another object is initialized. This default object can + * then be reset with the default copy assignment operator. + **********************************************************************/ + SphericalHarmonic1() {} + + /** + * Compute a spherical harmonic sum with a correction term. + * + * @param[in] tau multiplier for correction coefficients \e C' and \e S'. + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @return \e V the spherical harmonic sum. + * + * This routine requires constant memory and thus never throws + * an exception. + **********************************************************************/ + Math::real operator()(real tau, real x, real y, real z) const throw() { + real f[] = {1, tau}; + real v = 0; + real dummy; + switch (_norm) { + case FULL: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, dummy, dummy, dummy); + break; + case SCHMIDT: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, dummy, dummy, dummy); + break; + } + return v; + } + + /** + * Compute a spherical harmonic sum with a correction term and its + * gradient. + * + * @param[in] tau multiplier for correction coefficients \e C' and \e S'. + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @param[out] gradx \e x component of the gradient + * @param[out] grady \e y component of the gradient + * @param[out] gradz \e z component of the gradient + * @return \e V the spherical harmonic sum. + * + * This is the same as the previous function, except that the components of + * the gradients of the sum in the \e x, \e y, and \e z directions are + * computed. This routine requires constant memory and thus never throws + * an exception. + **********************************************************************/ + Math::real operator()(real tau, real x, real y, real z, + real& gradx, real& grady, real& gradz) const throw() { + real f[] = {1, tau}; + real v = 0; + switch (_norm) { + case FULL: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, gradx, grady, gradz); + break; + case SCHMIDT: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, gradx, grady, gradz); + break; + } + return v; + } + + /** + * Create a CircularEngine to allow the efficient evaluation of several + * points on a circle of latitude at a fixed value of \e tau. + * + * @param[in] tau the multiplier for the correction coefficients. + * @param[in] p the radius of the circle. + * @param[in] z the height of the circle above the equatorial plane. + * @param[in] gradp if true the returned object will be able to compute the + * gradient of the sum. + * @exception std::bad_alloc if the memory for the CircularEngine can't be + * allocated. + * @return the CircularEngine object. + * + * SphericalHarmonic1::operator()() exchanges the order of the sums in the + * definition, i.e., ∑n = 0..Nm = 0..n + * becomes ∑m = 0..Nn = m..N. + * SphericalHarmonic1::Circle performs the inner sum over degree \e n + * (which entails about N2 operations). Calling + * CircularEngine::operator()() on the returned object performs the outer + * sum over the order \e m (about \e N operations). + * + * See SphericalHarmonic::Circle for an example of its use. + **********************************************************************/ + CircularEngine Circle(real tau, real p, real z, bool gradp) const { + real f[] = {1, tau}; + switch (_norm) { + case FULL: + return gradp ? + SphericalEngine::Circle + (_c, f, p, z, _a) : + SphericalEngine::Circle + (_c, f, p, z, _a); + break; + case SCHMIDT: + default: // To avoid compiler warnings + return gradp ? + SphericalEngine::Circle + (_c, f, p, z, _a) : + SphericalEngine::Circle + (_c, f, p, z, _a); + break; + } + } + + /** + * @return the zeroth SphericalEngine::coeff object. + **********************************************************************/ + const SphericalEngine::coeff& Coefficients() const throw() + { return _c[0]; } + /** + * @return the first SphericalEngine::coeff object. + **********************************************************************/ + const SphericalEngine::coeff& Coefficients1() const throw() + { return _c[1]; } + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_SPHERICALHARMONIC1_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic2.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic2.hpp new file mode 100644 index 000000000..7da1c53fe --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/SphericalHarmonic2.hpp @@ -0,0 +1,316 @@ +/** + * \file SphericalHarmonic2.hpp + * \brief Header for GeographicLib::SphericalHarmonic2 class + * + * Copyright (c) Charles Karney (2011-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_SPHERICALHARMONIC2_HPP) +#define GEOGRAPHICLIB_SPHERICALHARMONIC2_HPP 1 + +#include +#include +#include +#include + +namespace GeographicLib { + + /** + * \brief Spherical harmonic series with two corrections to the coefficients + * + * This classes is similar to SphericalHarmonic, except that the coefficients + * \e C\e nm are replaced by \e C\e nm + \e tau' + * C'\e nm + \e tau'' C''\e nm (and similarly for \e + * S\e nm). + * + * Example of use: + * \include example-SphericalHarmonic2.cpp + **********************************************************************/ + + // Don't include the GEOGRPAHIC_EXPORT because this header-only class isn't + // used by any other classes in the library. + class /*GEOGRAPHICLIB_EXPORT*/ SphericalHarmonic2 { + public: + /** + * Supported normalizations for associate Legendre polynomials. + **********************************************************************/ + enum normalization { + /** + * Fully normalized associated Legendre polynomials. See + * SphericalHarmonic::FULL for documentation. + * + * @hideinitializer + **********************************************************************/ + FULL = SphericalEngine::FULL, + /** + * Schmidt semi-normalized associated Legendre polynomials. See + * SphericalHarmonic::SCHMIDT for documentation. + * + * @hideinitializer + **********************************************************************/ + SCHMIDT = SphericalEngine::SCHMIDT, + /// \cond SKIP + // These are deprecated... + full = FULL, + schmidt = SCHMIDT, + /// \endcond + }; + + private: + typedef Math::real real; + SphericalEngine::coeff _c[3]; + real _a; + unsigned _norm; + + public: + /** + * Constructor with a full set of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the maximum degree and order of the sum + * @param[in] C1 the coefficients \e C'\e nm. + * @param[in] S1 the coefficients \e S'\e nm. + * @param[in] N1 the maximum degree and order of the first correction + * coefficients \e C'\e nm and \e S'\e nm. + * @param[in] C2 the coefficients \e C''\e nm. + * @param[in] S2 the coefficients \e S''\e nm. + * @param[in] N2 the maximum degree and order of the second correction + * coefficients \e C'\e nm and \e S'\e nm. + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic2::FULL (the default) or + * SphericalHarmonic2::SCHMIDT. + * @exception GeographicErr if \e N and \e N1 do not satisfy \e N ≥ + * \e N1 ≥ −1, and similarly for \e N2. + * @exception GeographicErr if any of the vectors of coefficients is not + * large enough. + * + * See SphericalHarmonic for the way the coefficients should be stored. \e + * N1 and \e N2 should satisfy \e N1 ≤ \e N and \e N2 ≤ \e N. + * + * The class stores pointers to the first elements of \e C, \e S, \e + * C', \e S', \e C'', and \e S''. These arrays should not be altered or + * destroyed during the lifetime of a SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic2(const std::vector& C, + const std::vector& S, + int N, + const std::vector& C1, + const std::vector& S1, + int N1, + const std::vector& C2, + const std::vector& S2, + int N2, + real a, unsigned norm = FULL) + : _a(a) + , _norm(norm) { + if (!(N1 <= N && N2 <= N)) + throw GeographicErr("N1 and N2 cannot be larger that N"); + _c[0] = SphericalEngine::coeff(C, S, N); + _c[1] = SphericalEngine::coeff(C1, S1, N1); + _c[2] = SphericalEngine::coeff(C2, S2, N2); + } + + /** + * Constructor with a subset of coefficients specified. + * + * @param[in] C the coefficients \e C\e nm. + * @param[in] S the coefficients \e S\e nm. + * @param[in] N the degree used to determine the layout of \e C and \e S. + * @param[in] nmx the maximum degree used in the sum. The sum over \e n is + * from 0 thru \e nmx. + * @param[in] mmx the maximum order used in the sum. The sum over \e m is + * from 0 thru min(\e n, \e mmx). + * @param[in] C1 the coefficients \e C'\e nm. + * @param[in] S1 the coefficients \e S'\e nm. + * @param[in] N1 the degree used to determine the layout of \e C' and \e + * S'. + * @param[in] nmx1 the maximum degree used for \e C' and \e S'. + * @param[in] mmx1 the maximum order used for \e C' and \e S'. + * @param[in] C2 the coefficients \e C''\e nm. + * @param[in] S2 the coefficients \e S''\e nm. + * @param[in] N2 the degree used to determine the layout of \e C'' and \e + * S''. + * @param[in] nmx2 the maximum degree used for \e C'' and \e S''. + * @param[in] mmx2 the maximum order used for \e C'' and \e S''. + * @param[in] a the reference radius appearing in the definition of the + * sum. + * @param[in] norm the normalization for the associated Legendre + * polynomials, either SphericalHarmonic2::FULL (the default) or + * SphericalHarmonic2::SCHMIDT. + * @exception GeographicErr if the parameters do not satisfy \e N ≥ \e + * nmx ≥ \e mmx ≥ −1; \e N1 ≥ \e nmx1 ≥ \e mmx1 ≥ + * −1; \e N ≥ \e N1; \e nmx ≥ \e nmx1; \e mmx ≥ \e mmx1; + * and similarly for \e N2, \e nmx2, and \e mmx2. + * @exception GeographicErr if any of the vectors of coefficients is not + * large enough. + * + * The class stores pointers to the first elements of \e C, \e S, \e + * C', \e S', \e C'', and \e S''. These arrays should not be altered or + * destroyed during the lifetime of a SphericalHarmonic object. + **********************************************************************/ + SphericalHarmonic2(const std::vector& C, + const std::vector& S, + int N, int nmx, int mmx, + const std::vector& C1, + const std::vector& S1, + int N1, int nmx1, int mmx1, + const std::vector& C2, + const std::vector& S2, + int N2, int nmx2, int mmx2, + real a, unsigned norm = FULL) + : _a(a) + , _norm(norm) { + if (!(nmx1 <= nmx && nmx2 <= nmx)) + throw GeographicErr("nmx1 and nmx2 cannot be larger that nmx"); + if (!(mmx1 <= mmx && mmx2 <= mmx)) + throw GeographicErr("mmx1 and mmx2 cannot be larger that mmx"); + _c[0] = SphericalEngine::coeff(C, S, N, nmx, mmx); + _c[1] = SphericalEngine::coeff(C1, S1, N1, nmx1, mmx1); + _c[2] = SphericalEngine::coeff(C2, S2, N2, nmx2, mmx2); + } + + /** + * A default constructor so that the object can be created when the + * constructor for another object is initialized. This default object can + * then be reset with the default copy assignment operator. + **********************************************************************/ + SphericalHarmonic2() {} + + /** + * Compute a spherical harmonic sum with two correction terms. + * + * @param[in] tau1 multiplier for correction coefficients \e C' and \e S'. + * @param[in] tau2 multiplier for correction coefficients \e C'' and \e S''. + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @return \e V the spherical harmonic sum. + * + * This routine requires constant memory and thus never throws an + * exception. + **********************************************************************/ + Math::real operator()(real tau1, real tau2, real x, real y, real z) + const throw() { + real f[] = {1, tau1, tau2}; + real v = 0; + real dummy; + switch (_norm) { + case FULL: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, dummy, dummy, dummy); + break; + case SCHMIDT: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, dummy, dummy, dummy); + break; + } + return v; + } + + /** + * Compute a spherical harmonic sum with two correction terms and its + * gradient. + * + * @param[in] tau1 multiplier for correction coefficients \e C' and \e S'. + * @param[in] tau2 multiplier for correction coefficients \e C'' and \e S''. + * @param[in] x cartesian coordinate. + * @param[in] y cartesian coordinate. + * @param[in] z cartesian coordinate. + * @param[out] gradx \e x component of the gradient + * @param[out] grady \e y component of the gradient + * @param[out] gradz \e z component of the gradient + * @return \e V the spherical harmonic sum. + * + * This is the same as the previous function, except that the components of + * the gradients of the sum in the \e x, \e y, and \e z directions are + * computed. This routine requires constant memory and thus never throws + * an exception. + **********************************************************************/ + Math::real operator()(real tau1, real tau2, real x, real y, real z, + real& gradx, real& grady, real& gradz) const throw() { + real f[] = {1, tau1, tau2}; + real v = 0; + switch (_norm) { + case FULL: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, gradx, grady, gradz); + break; + case SCHMIDT: + v = SphericalEngine::Value + (_c, f, x, y, z, _a, gradx, grady, gradz); + break; + } + return v; + } + + /** + * Create a CircularEngine to allow the efficient evaluation of several + * points on a circle of latitude at fixed values of \e tau1 and \e tau2. + * + * @param[in] tau1 multiplier for correction coefficients \e C' and \e S'. + * @param[in] tau2 multiplier for correction coefficients \e C'' and \e S''. + * @param[in] p the radius of the circle. + * @param[in] z the height of the circle above the equatorial plane. + * @param[in] gradp if true the returned object will be able to compute the + * gradient of the sum. + * @exception std::bad_alloc if the memory for the CircularEngine can't be + * allocated. + * @return the CircularEngine object. + * + * SphericalHarmonic2::operator()() exchanges the order of the sums in the + * definition, i.e., ∑n = 0..Nm = 0..n + * becomes ∑m = 0..Nn = m..N.. + * SphericalHarmonic2::Circle performs the inner sum over degree \e n + * (which entails about N2 operations). Calling + * CircularEngine::operator()() on the returned object performs the outer + * sum over the order \e m (about \e N operations). + * + * See SphericalHarmonic::Circle for an example of its use. + **********************************************************************/ + CircularEngine Circle(real tau1, real tau2, real p, real z, bool gradp) + const { + real f[] = {1, tau1, tau2}; + switch (_norm) { + case FULL: + return gradp ? + SphericalEngine::Circle + (_c, f, p, z, _a) : + SphericalEngine::Circle + (_c, f, p, z, _a); + break; + case SCHMIDT: + default: // To avoid compiler warnings + return gradp ? + SphericalEngine::Circle + (_c, f, p, z, _a) : + SphericalEngine::Circle + (_c, f, p, z, _a); + break; + } + } + + /** + * @return the zeroth SphericalEngine::coeff object. + **********************************************************************/ + const SphericalEngine::coeff& Coefficients() const throw() + { return _c[0]; } + /** + * @return the first SphericalEngine::coeff object. + **********************************************************************/ + const SphericalEngine::coeff& Coefficients1() const throw() + { return _c[1]; } + /** + * @return the second SphericalEngine::coeff object. + **********************************************************************/ + const SphericalEngine::coeff& Coefficients2() const throw() + { return _c[2]; } + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_SPHERICALHARMONIC2_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/TransverseMercator.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/TransverseMercator.hpp new file mode 100644 index 000000000..7d8876d78 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/TransverseMercator.hpp @@ -0,0 +1,212 @@ +/** + * \file TransverseMercator.hpp + * \brief Header for GeographicLib::TransverseMercator class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP) +#define GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP 1 + +#include + +#if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER) +/** + * The order of the series approximation used in TransverseMercator. + * GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER can be set to any integer in [4, 8]. + **********************************************************************/ +# define GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER \ + (GEOGRAPHICLIB_PRECISION == 2 ? 6 : (GEOGRAPHICLIB_PRECISION == 1 ? 4 : 8)) +#endif + +namespace GeographicLib { + + /** + * \brief Transverse Mercator projection + * + * This uses Krüger's method which evaluates the projection and its + * inverse in terms of a series. See + * - L. Krüger, + * Konforme + * Abbildung des Erdellipsoids in der Ebene (Conformal mapping of the + * ellipsoidal earth to the plane), Royal Prussian Geodetic Institute, New + * Series 52, 172 pp. (1912). + * - C. F. F. Karney, + * + * Transverse Mercator with an accuracy of a few nanometers, + * J. Geodesy 85(8), 475--485 (Aug. 2011); + * preprint + * arXiv:1002.1417. + * + * Krüger's method has been extended from 4th to 6th order. The maximum + * error is 5 nm (5 nanometers), ground distance, for all positions within 35 + * degrees of the central meridian. The error in the convergence is 2 + * × 10−15" and the relative error in the scale + * is 6 − 10−12%%. See Sec. 4 of + * arXiv:1002.1417 for details. + * The speed penalty in going to 6th order is only about 1%. + * TransverseMercatorExact is an alternative implementation of the projection + * using exact formulas which yield accurate (to 8 nm) results over the + * entire ellipsoid. + * + * The ellipsoid parameters and the central scale are set in the constructor. + * The central meridian (which is a trivial shift of the longitude) is + * specified as the \e lon0 argument of the TransverseMercator::Forward and + * TransverseMercator::Reverse functions. The latitude of origin is taken to + * be the equator. There is no provision in this class for specifying a + * false easting or false northing or a different latitude of origin. + * However these are can be simply included by the calling function. For + * example, the UTMUPS class applies the false easting and false northing for + * the UTM projections. A more complicated example is the British National + * Grid ( + * EPSG:7405) which requires the use of a latitude of origin. This is + * implemented by the GeographicLib::OSGB class. + * + * See TransverseMercator.cpp for more information on the implementation. + * + * See \ref transversemercator for a discussion of this projection. + * + * Example of use: + * \include example-TransverseMercator.cpp + * + * TransverseMercatorProj is a + * command-line utility providing access to the functionality of + * TransverseMercator and TransverseMercatorExact. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT TransverseMercator { + private: + typedef Math::real real; + static const int maxpow_ = GEOGRAPHICLIB_TRANSVERSEMERCATOR_ORDER; + static const real tol_; + static const real overflow_; + static const int numit_ = 5; + real _a, _f, _k0, _e2, _e, _e2m, _c, _n; + // _alp[0] and _bet[0] unused + real _a1, _b1, _alp[maxpow_ + 1], _bet[maxpow_ + 1]; + // tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right + static inline real tanx(real x) throw() { + real t = std::tan(x); + // Write the tests this way to ensure that tanx(NaN()) is NaN() + return x >= 0 ? (!(t < 0) ? t : overflow_) : (!(t >= 0) ? t : -overflow_); + } + // Return e * atanh(e * x) for f >= 0, else return + // - sqrt(-e2) * atan( sqrt(-e2) * x) for f < 0 + inline real eatanhe(real x) const throw() + { return _f >= 0 ? _e * Math::atanh(_e * x) : - _e * std::atan(_e * x); } + real taupf(real tau) const throw(); + real tauf(real taup) const throw(); + + friend class Ellipsoid; // For access to taupf, tauf. + public: + + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. Setting \e f = 0 gives a sphere. + * Negative \e f gives a prolate ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] k0 central scale factor. + * @exception GeographicErr if \e a, (1 − \e f ) \e a, or \e k0 is + * not positive. + **********************************************************************/ + TransverseMercator(real a, real f, real k0); + + /** + * Forward projection, from geographic to transverse Mercator. + * + * @param[in] lon0 central meridian of the projection (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lat should be in the range + * [−90°, 90°]; \e lon and \e lon0 should be in the + * range [−540°, 540°). + **********************************************************************/ + void Forward(real lon0, real lat, real lon, + real& x, real& y, real& gamma, real& k) const throw(); + + /** + * Reverse projection, from transverse Mercator to geographic. + * + * @param[in] lon0 central meridian of the projection (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lon0 should be in the range + * [−540°, 540°). The value of \e lon returned is in + * the range [−180°, 180°). + **********************************************************************/ + void Reverse(real lon0, real x, real y, + real& lat, real& lon, real& gamma, real& k) const throw(); + + /** + * TransverseMercator::Forward without returning the convergence and scale. + **********************************************************************/ + void Forward(real lon0, real lat, real lon, + real& x, real& y) const throw() { + real gamma, k; + Forward(lon0, lat, lon, x, y, gamma, k); + } + + /** + * TransverseMercator::Reverse without returning the convergence and scale. + **********************************************************************/ + void Reverse(real lon0, real x, real y, + real& lat, real& lon) const throw() { + real gamma, k; + Reverse(lon0, x, y, lat, lon, gamma, k); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _a; } + + /** + * @return \e f the flattening of the ellipsoid. This is the value used in + * the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _f; } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() { return 1/_f; } + /// \endcond + + /** + * @return \e k0 central scale for the projection. This is the value of \e + * k0 used in the constructor and is the scale on the central meridian. + **********************************************************************/ + Math::real CentralScale() const throw() { return _k0; } + ///@} + + /** + * A global instantiation of TransverseMercator with the WGS84 ellipsoid + * and the UTM scale factor. However, unlike UTM, no false easting or + * northing is added. + **********************************************************************/ + static const TransverseMercator UTM; + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_TRANSVERSEMERCATOR_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/TransverseMercatorExact.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/TransverseMercatorExact.hpp new file mode 100644 index 000000000..2db9c412a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/TransverseMercatorExact.hpp @@ -0,0 +1,278 @@ +/** + * \file TransverseMercatorExact.hpp + * \brief Header for GeographicLib::TransverseMercatorExact class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP) +#define GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP 1 + +#include +#include + +namespace GeographicLib { + + /** + * \brief An exact implementation of the transverse Mercator projection + * + * Implementation of the Transverse Mercator Projection given in + * - L. P. Lee, + * Conformal + * Projections Based On Jacobian Elliptic Functions, Part V of + * Conformal Projections Based on Elliptic Functions, + * (B. V. Gutsell, Toronto, 1976), 128pp., + * ISBN: 0919870163 + * (also appeared as: + * Monograph 16, Suppl. No. 1 to Canadian Cartographer, Vol 13). + * - C. F. F. Karney, + * + * Transverse Mercator with an accuracy of a few nanometers, + * J. Geodesy 85(8), 475--485 (Aug. 2011); + * preprint + * arXiv:1002.1417. + * + * Lee gives the correct results for forward and reverse transformations + * subject to the branch cut rules (see the description of the \e extendp + * argument to the constructor). The maximum error is about 8 nm (8 + * nanometers), ground distance, for the forward and reverse transformations. + * The error in the convergence is 2 × 10−15", + * the relative error in the scale is 7 × 10−12%%. + * See Sec. 3 of + * arXiv:1002.1417 for details. + * The method is "exact" in the sense that the errors are close to the + * round-off limit and that no changes are needed in the algorithms for them + * to be used with reals of a higher precision. Thus the errors using long + * double (with a 64-bit fraction) are about 2000 times smaller than using + * double (with a 53-bit fraction). + * + * This algorithm is about 4.5 times slower than the 6th-order Krüger + * method, TransverseMercator, taking about 11 us for a combined forward and + * reverse projection on a 2.66 GHz Intel machine (g++, version 4.3.0, -O3). + * + * The ellipsoid parameters and the central scale are set in the constructor. + * The central meridian (which is a trivial shift of the longitude) is + * specified as the \e lon0 argument of the TransverseMercatorExact::Forward + * and TransverseMercatorExact::Reverse functions. The latitude of origin is + * taken to be the equator. See the documentation on TransverseMercator for + * how to include a false easting, false northing, or a latitude of origin. + * + * See tm-grid.kmz, for an + * illustration of the transverse Mercator grid in Google Earth. + * + * See TransverseMercatorExact.cpp for more information on the + * implementation. + * + * See \ref transversemercator for a discussion of this projection. + * + * Example of use: + * \include example-TransverseMercatorExact.cpp + * + * TransverseMercatorProj is a + * command-line utility providing access to the functionality of + * TransverseMercator and TransverseMercatorExact. + **********************************************************************/ + + class GEOGRAPHICLIB_EXPORT TransverseMercatorExact { + private: + typedef Math::real real; + static const real tol_; + static const real tol1_; + static const real tol2_; + static const real taytol_; + static const real overflow_; + static const int numit_ = 10; + real _a, _f, _k0, _mu, _mv, _e; + bool _extendp; + EllipticFunction _Eu, _Ev; + // tan(x) for x in [-pi/2, pi/2] ensuring that the sign is right + static inline real tanx(real x) throw() { + real t = std::tan(x); + // Write the tests this way to ensure that tanx(NaN()) is NaN() + return x >= 0 ? (!(t < 0) ? t : overflow_) : (!(t >= 0) ? t : -overflow_); + } + + real taup(real tau) const throw(); + real taupinv(real taup) const throw(); + + void zeta(real u, real snu, real cnu, real dnu, + real v, real snv, real cnv, real dnv, + real& taup, real& lam) const throw(); + + void dwdzeta(real u, real snu, real cnu, real dnu, + real v, real snv, real cnv, real dnv, + real& du, real& dv) const throw(); + + bool zetainv0(real psi, real lam, real& u, real& v) const throw(); + void zetainv(real taup, real lam, real& u, real& v) const throw(); + + void sigma(real u, real snu, real cnu, real dnu, + real v, real snv, real cnv, real dnv, + real& xi, real& eta) const throw(); + + void dwdsigma(real u, real snu, real cnu, real dnu, + real v, real snv, real cnv, real dnv, + real& du, real& dv) const throw(); + + bool sigmainv0(real xi, real eta, real& u, real& v) const throw(); + void sigmainv(real xi, real eta, real& u, real& v) const throw(); + + void Scale(real tau, real lam, + real snu, real cnu, real dnu, + real snv, real cnv, real dnv, + real& gamma, real& k) const throw(); + + public: + + /** + * Constructor for a ellipsoid with + * + * @param[in] a equatorial radius (meters). + * @param[in] f flattening of ellipsoid. If \e f > 1, set flattening + * to 1/\e f. + * @param[in] k0 central scale factor. + * @param[in] extendp use extended domain. + * @exception GeographicErr if \e a, \e f, or \e k0 is not positive. + * + * The transverse Mercator projection has a branch point singularity at \e + * lat = 0 and \e lon − \e lon0 = 90 (1 − \e e) or (for + * TransverseMercatorExact::UTM) x = 18381 km, y = 0m. The \e extendp + * argument governs where the branch cut is placed. With \e extendp = + * false, the "standard" convention is followed, namely the cut is placed + * along \e x > 18381 km, \e y = 0m. Forward can be called with any \e lat + * and \e lon then produces the transformation shown in Lee, Fig 46. + * Reverse analytically continues this in the ± \e x direction. As + * a consequence, Reverse may map multiple points to the same geographic + * location; for example, for TransverseMercatorExact::UTM, \e x = + * 22051449.037349 m, \e y = −7131237.022729 m and \e x = + * 29735142.378357 m, \e y = 4235043.607933 m both map to \e lat = + * −2°, \e lon = 88°. + * + * With \e extendp = true, the branch cut is moved to the lower left + * quadrant. The various symmetries of the transverse Mercator projection + * can be used to explore the projection on any sheet. In this mode the + * domains of \e lat, \e lon, \e x, and \e y are restricted to + * - the union of + * - \e lat in [0, 90] and \e lon − \e lon0 in [0, 90] + * - \e lat in (-90, 0] and \e lon − \e lon0 in [90 (1 − \e + e), 90] + * - the union of + * - x/(\e k0 \e a) in [0, ∞) and + * y/(\e k0 \e a) in [0, E(e2)] + * - x/(\e k0 \e a) in [K(1 − e2) − + * E(1 − e2), ∞) and y/(\e k0 \e + * a) in (−∞, 0] + * . + * See Sec. 5 of + * arXiv:1002.1417 for a full + * discussion of the treatment of the branch cut. + * + * The method will work for all ellipsoids used in terrestrial geodesy. + * The method cannot be applied directly to the case of a sphere (\e f = 0) + * because some the constants characterizing this method diverge in that + * limit, and in practice, \e f should be larger than about + * numeric_limits::epsilon(). However, TransverseMercator treats the + * sphere exactly. + **********************************************************************/ + TransverseMercatorExact(real a, real f, real k0, bool extendp = false); + + /** + * Forward projection, from geographic to transverse Mercator. + * + * @param[in] lon0 central meridian of the projection (degrees). + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lat should be in the range + * [−90°, 90°]; \e lon and \e lon0 should be in the + * range [−540°, 540°). + **********************************************************************/ + void Forward(real lon0, real lat, real lon, + real& x, real& y, real& gamma, real& k) const throw(); + + /** + * Reverse projection, from transverse Mercator to geographic. + * + * @param[in] lon0 central meridian of the projection (degrees). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * + * No false easting or northing is added. \e lon0 should be in the range + * [−540°, 540°). The value of \e lon returned is in + * the range [−180°, 180°). + **********************************************************************/ + void Reverse(real lon0, real x, real y, + real& lat, real& lon, real& gamma, real& k) const throw(); + + /** + * TransverseMercatorExact::Forward without returning the convergence and + * scale. + **********************************************************************/ + void Forward(real lon0, real lat, real lon, + real& x, real& y) const throw() { + real gamma, k; + Forward(lon0, lat, lon, x, y, gamma, k); + } + + /** + * TransverseMercatorExact::Reverse without returning the convergence and + * scale. + **********************************************************************/ + void Reverse(real lon0, real x, real y, + real& lat, real& lon) const throw() { + real gamma, k; + Reverse(lon0, x, y, lat, lon, gamma, k); + } + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + Math::real MajorRadius() const throw() { return _a; } + + /** + * @return \e f the flattening of the ellipsoid. This is the value used in + * the constructor. + **********************************************************************/ + Math::real Flattening() const throw() { return _f; } + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the ellipsoid. + **********************************************************************/ + Math::real InverseFlattening() const throw() { return 1/_f; } + /// \endcond + + /** + * @return \e k0 central scale for the projection. This is the value of \e + * k0 used in the constructor and is the scale on the central meridian. + **********************************************************************/ + Math::real CentralScale() const throw() { return _k0; } + ///@} + + /** + * A global instantiation of TransverseMercatorExact with the WGS84 + * ellipsoid and the UTM scale factor. However, unlike UTM, no false + * easting or northing is added. + **********************************************************************/ + static const TransverseMercatorExact UTM; + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_TRANSVERSEMERCATOREXACT_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/UTMUPS.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/UTMUPS.hpp new file mode 100644 index 000000000..512ba5c43 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/UTMUPS.hpp @@ -0,0 +1,415 @@ +/** + * \file UTMUPS.hpp + * \brief Header for GeographicLib::UTMUPS class + * + * Copyright (c) Charles Karney (2008-2011) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_UTMUPS_HPP) +#define GEOGRAPHICLIB_UTMUPS_HPP 1 + +#include + +namespace GeographicLib { + + /** + * \brief Convert between geographic coordinates and UTM/UPS + * + * UTM and UPS are defined + * - J. W. Hager, J. F. Behensky, and B. W. Drew, + * + * The Universal Grids: Universal Transverse Mercator (UTM) and Universal + * Polar Stereographic (UPS), Defense Mapping Agency, Technical Manual + * TM8358.2 (1989). + * . + * Section 2-3 defines UTM and section 3-2.4 defines UPS. This document also + * includes approximate algorithms for the computation of the underlying + * transverse Mercator and polar stereographic projections. Here we + * substitute much more accurate algorithms given by + * GeographicLib:TransverseMercator and GeographicLib:PolarStereographic. + * + * In this implementation, the conversions are closed, i.e., output from + * Forward is legal input for Reverse and vice versa. The error is about 5nm + * in each direction. However, the conversion from legal UTM/UPS coordinates + * to geographic coordinates and back might throw an error if the initial + * point is within 5nm of the edge of the allowed range for the UTM/UPS + * coordinates. + * + * The simplest way to guarantee the closed property is to define allowed + * ranges for the eastings and northings for UTM and UPS coordinates. The + * UTM boundaries are the same for all zones. (The only place the + * exceptional nature of the zone boundaries is evident is when converting to + * UTM/UPS coordinates requesting the standard zone.) The MGRS lettering + * scheme imposes natural limits on UTM/UPS coordinates which may be + * converted into MGRS coordinates. For the conversion to/from geographic + * coordinates these ranges have been extended by 100km in order to provide a + * generous overlap between UTM and UPS and between UTM zones. + * + * The NGA software package + * geotrans + * also provides conversions to and from UTM and UPS. Version 2.4.2 (and + * earlier) suffers from some drawbacks: + * - Inconsistent rules are used to determine the whether a particular UTM or + * UPS coordinate is legal. A more systematic approach is taken here. + * - The underlying projections are not very accurately implemented. + * + * Example of use: + * \include example-UTMUPS.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT UTMUPS { + private: + typedef Math::real real; + static const real falseeasting_[4]; + static const real falsenorthing_[4]; + static const real mineasting_[4]; + static const real maxeasting_[4]; + static const real minnorthing_[4]; + static const real maxnorthing_[4]; + static const int epsg01N = 32601; // EPSG code for UTM 01N + static const int epsg60N = 32660; // EPSG code for UTM 60N + static const int epsgN = 32661; // EPSG code for UPS N + static const int epsg01S = 32701; // EPSG code for UTM 01N + static const int epsg60S = 32760; // EPSG code for UTM 60S + static const int epsgS = 32761; // EPSG code for UPS S + static real CentralMeridian(int zone) throw() + { return real(6 * zone - 183); } + static void CheckLatLon(real lat, real lon); + // Throw an error if easting or northing are outside standard ranges. If + // throwp = false, return bool instead. + static bool CheckCoords(bool utmp, bool northp, real x, real y, + bool msgrlimits = false, bool throwp = true); + UTMUPS(); // Disable constructor + + public: + + /** + * In this class we bring together the UTM and UPS coordinates systems. + * The UTM divides the earth between latitudes −80° and 84° + * into 60 zones numbered 1 thru 60. Zone assign zone number 0 to the UPS + * regions, covering the two poles. Within UTMUPS, non-negative zone + * numbers refer to one of the "physical" zones, 0 for UPS and [1, 60] for + * UTM. Negative "pseudo-zone" numbers are used to select one of the + * physical zones. + **********************************************************************/ + enum zonespec { + /** + * The smallest pseudo-zone number. + **********************************************************************/ + MINPSEUDOZONE = -4, + /** + * A marker for an undefined or invalid zone. Equivalent to NaN. + **********************************************************************/ + INVALID = -4, + /** + * If a coordinate already include zone information (e.g., it is an MGRS + * coordinate), use that, otherwise apply the UTMUPS::STANDARD rules. + **********************************************************************/ + MATCH = -3, + /** + * Apply the standard rules for UTM zone assigment extending the UTM zone + * to each pole to give a zone number in [1, 60]. For example, use UTM + * zone 38 for longitude in [42°, 48°). The rules include the + * Norway and Svalbard exceptions. + **********************************************************************/ + UTM = -2, + /** + * Apply the standard rules for zone assignment to give a zone number in + * [0, 60]. If the latitude is not in [−80°, 84°), then + * use UTMUPS::UPS = 0, otherwise apply the rules for UTMUPS::UTM. The + * tests on latitudes and longitudes are all closed on the lower end open + * on the upper. Thus for UTM zone 38, latitude is in [−80°, + * 84°) and longitude is in [42°, 48°). + **********************************************************************/ + STANDARD = -1, + /** + * The largest pseudo-zone number. + **********************************************************************/ + MAXPSEUDOZONE = -1, + /** + * The smallest physical zone number. + **********************************************************************/ + MINZONE = 0, + /** + * The zone number used for UPS + **********************************************************************/ + UPS = 0, + /** + * The smallest UTM zone number. + **********************************************************************/ + MINUTMZONE = 1, + /** + * The largest UTM zone number. + **********************************************************************/ + MAXUTMZONE = 60, + /** + * The largest physical zone number. + **********************************************************************/ + MAXZONE = 60, + }; + + /** + * The standard zone. + * + * @param[in] lat latitude (degrees). + * @param[in] lon longitude (degrees). + * @param[in] setzone zone override (optional). If omitted, use the + * standard rules for picking the zone. If \e setzone is given then use + * that zone if it is non-negative, otherwise apply the rules given in + * UTMUPS::zonespec. + * @exception GeographicErr if \e setzone is outside the range + * [UTMUPS::MINPSEUDOZONE, UTMUPS::MAXZONE] = [−4, 60]. + * + * This is exact. + **********************************************************************/ + static int StandardZone(real lat, real lon, int setzone = STANDARD); + + /** + * Forward projection, from geographic to UTM/UPS. + * + * @param[in] lat latitude of point (degrees). + * @param[in] lon longitude of point (degrees). + * @param[out] zone the UTM zone (zero means UPS). + * @param[out] northp hemisphere (true means north, false means south). + * @param[out] x easting of point (meters). + * @param[out] y northing of point (meters). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * @param[in] setzone zone override (optional). + * @param[in] mgrslimits if true enforce the stricter MGRS limits on the + * coordinates (default = false). + * @exception GeographicErr if \e lat is not in [−90°, + * 90°]. + * @exception GeographicErr if \e lon is not in [−540°, + * 540°). + * @exception GeographicErr if the resulting \e x or \e y is out of allowed + * range (see Reverse); in this case, these arguments are unchanged. + * + * If \e setzone is omitted, use the standard rules for picking the zone. + * If \e setzone is given then use that zone if it is non-negative, + * otherwise apply the rules given in UTMUPS::zonespec. The accuracy of + * the conversion is about 5nm. + * + * The northing \e y jumps by UTMUPS::UTMShift() when crossing the equator + * in the southerly direction. Sometimes it is useful to remove this + * discontinuity in \e y by extending the "northern" hemisphere using + * UTMUPS::Transfer: + * \code + double lat = -1, lon = 123; + int zone; + bool northp; + double x, y, gamma, k; + GeographicLib::UTMUPS::Forward(lat, lon, zone, northp, x, y, gamma, k); + GeographicLib::UTMUPS::Transfer(zone, northp, x, y, + zone, true, x, y, zone); + northp = true; + \endcode + **********************************************************************/ + static void Forward(real lat, real lon, + int& zone, bool& northp, real& x, real& y, + real& gamma, real& k, + int setzone = STANDARD, bool mgrslimits = false); + + /** + * Reverse projection, from UTM/UPS to geographic. + * + * @param[in] zone the UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @param[in] x easting of point (meters). + * @param[in] y northing of point (meters). + * @param[out] lat latitude of point (degrees). + * @param[out] lon longitude of point (degrees). + * @param[out] gamma meridian convergence at point (degrees). + * @param[out] k scale of projection at point. + * @param[in] mgrslimits if true enforce the stricter MGRS limits on the + * coordinates (default = false). + * @exception GeographicErr if \e zone, \e x, or \e y is out of allowed + * range; this this case the arguments are unchanged. + * + * The accuracy of the conversion is about 5nm. + * + * UTM eastings are allowed to be in the range [0km, 1000km], northings are + * allowed to be in in [0km, 9600km] for the northern hemisphere and in + * [900km, 10000km] for the southern hemisphere. However UTM northings + * can be continued across the equator. So the actual limits on the + * northings are [-9100km, 9600km] for the "northern" hemisphere and + * [900km, 19600km] for the "southern" hemisphere. + * + * UPS eastings and northings are allowed to be in the range [1200km, + * 2800km] in the northern hemisphere and in [700km, 3100km] in the + * southern hemisphere. + * + * These ranges are 100km larger than allowed for the conversions to MGRS. + * (100km is the maximum extra padding consistent with eastings remaining + * non-negative.) This allows generous overlaps between zones and UTM and + * UPS. If \e mgrslimits = true, then all the ranges are shrunk by 100km + * so that they agree with the stricter MGRS ranges. No checks are + * performed besides these (e.g., to limit the distance outside the + * standard zone boundaries). + **********************************************************************/ + static void Reverse(int zone, bool northp, real x, real y, + real& lat, real& lon, real& gamma, real& k, + bool mgrslimits = false); + + /** + * UTMUPS::Forward without returning convergence and scale. + **********************************************************************/ + static void Forward(real lat, real lon, + int& zone, bool& northp, real& x, real& y, + int setzone = STANDARD, bool mgrslimits = false) { + real gamma, k; + Forward(lat, lon, zone, northp, x, y, gamma, k, setzone, mgrslimits); + } + + /** + * UTMUPS::Reverse without returning convergence and scale. + **********************************************************************/ + static void Reverse(int zone, bool northp, real x, real y, + real& lat, real& lon, bool mgrslimits = false) { + real gamma, k; + Reverse(zone, northp, x, y, lat, lon, gamma, k, mgrslimits); + } + + /** + * Transfer UTM/UPS coordinated from one zone to another. + * + * @param[in] zonein the UTM zone for \e xin and \e yin (or zero for UPS). + * @param[in] northpin hemisphere for \e xin and \e yin (true means north, + * false means south). + * @param[in] xin easting of point (meters) in \e zonein. + * @param[in] yin northing of point (meters) in \e zonein. + * @param[in] zoneout the requested UTM zone for \e xout and \e yout (or + * zero for UPS). + * @param[in] northpout hemisphere for \e xout output and \e yout. + * @param[out] xout easting of point (meters) in \e zoneout. + * @param[out] yout northing of point (meters) in \e zoneout. + * @param[out] zone the actual UTM zone for \e xout and \e yout (or zero + * for UPS); this equals \e zoneout if \e zoneout ≥ 0. + * @exception GeographicErr if \e zonein is out of range (see below). + * @exception GeographicErr if \e zoneout is out of range (see below). + * @exception GeographicErr if \e xin or \e yin fall outside their allowed + * ranges (see UTMUPS::Reverse). + * @exception GeographicErr if \e xout or \e yout fall outside their + * allowed ranges (see UTMUPS::Reverse). + * + * \e zonein must be in the range [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, + * 60] with \e zonein = UTMUPS::UPS, 0, indicating UPS. \e zonein may + * also be UTMUPS::INVALID. + * + * \e zoneout must be in the range [UTMUPS::MINPSEUDOZONE, UTMUPS::MAXZONE] + * = [-4, 60]. If \e zoneout < UTMUPS::MINZONE then the rules give in + * the documentation of UTMUPS::zonespec are applied, and \e zone is set to + * the actual zone used for output. + * + * (\e xout, \e yout) can overlap with (\e xin, \e yin). + **********************************************************************/ + static void Transfer(int zonein, bool northpin, real xin, real yin, + int zoneout, bool northpout, real& xout, real& yout, + int& zone); + + /** + * Decode a UTM/UPS zone string. + * + * @param[in] zonestr string representation of zone and hemisphere. + * @param[out] zone the UTM zone (zero means UPS). + * @param[out] northp hemisphere (true means north, false means south). + * @exception GeographicErr if \e zonestr is malformed. + * + * For UTM, \e zonestr has the form of a zone number in the range + * [UTMUPS::MINUTMZONE, UTMUPS::MAXUTMZONE] = [1, 60] followed by a + * hemisphere letter, N or S. For UPS, it consists just of the hemisphere + * letter. The returned value of \e zone is UTMUPS::UPS = 0 for UPS. Note + * well that "38S" indicates the southern hemisphere of zone 38 and not + * latitude band S, [32, 40]. N, 01S, 2N, 38S are legal. 0N, 001S, 61N, + * 38P are illegal. INV is a special value for which the returned value of + * \e is UTMUPS::INVALID. + **********************************************************************/ + static void DecodeZone(const std::string& zonestr, int& zone, bool& northp); + + /** + * Encode a UTM/UPS zone string. + * + * @param[in] zone the UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @exception GeographicErr if \e zone is out of range (see below). + * @exception std::bad_alloc if memoy for the string can't be allocated. + * @return string representation of zone and hemisphere. + * + * \e zone must be in the range [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, + * 60] with \e zone = UTMUPS::UPS, 0, indicating UPS (but the resulting + * string does not contain "0"). \e zone may also be UTMUPS::INVALID, in + * which case the returned string is "INV". This reverses + * UTMUPS::DecodeZone. + **********************************************************************/ + static std::string EncodeZone(int zone, bool northp); + + /** + * Decode EPSG. + * + * @param[in] epsg the EPSG code. + * @param[out] zone the UTM zone (zero means UPS). + * @param[out] northp hemisphere (true means north, false means south). + * + * EPSG (European Petroleum Survery Group) codes are a way to refer to many + * different projections. DecodeEPSG decodes those refering to UTM or UPS + * projections for the WGS84 ellipsoid. If the code does not refer to one + * of these projections, \e zone is set to UTMUPS::INVALID. See + * http://spatialreference.org/ref/epsg/ + **********************************************************************/ + static void DecodeEPSG(int epsg, int& zone, bool& northp) throw(); + + /** + * Encode zone as EPSG. + * + * @param[in] zone the UTM zone (zero means UPS). + * @param[in] northp hemisphere (true means north, false means south). + * @return EPSG code (or -1 if \e zone is not in the range + * [UTMUPS::MINZONE, UTMUPS::MAXZONE] = [0, 60]) + * + * Convert \e zone and \e northp to the corresponding EPSG (European + * Petroleum Survery Group) codes + **********************************************************************/ + static int EncodeEPSG(int zone, bool northp) throw(); + + /** + * @return shift (meters) necessary to align N and S halves of a UTM zone + * (107). + **********************************************************************/ + static Math::real UTMShift() throw(); + + /** \name Inspector functions + **********************************************************************/ + ///@{ + /** + * @return \e a the equatorial radius of the WGS84 ellipsoid (meters). + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + static Math::real MajorRadius() throw() + { return Constants::WGS84_a(); } + + /** + * @return \e f the flattening of the WGS84 ellipsoid. + * + * (The WGS84 value is returned because the UTM and UPS projections are + * based on this ellipsoid.) + **********************************************************************/ + static Math::real Flattening() throw() + { return Constants::WGS84_f(); } + ///@} + + /// \cond SKIP + /** + * DEPRECATED + * @return \e r the inverse flattening of the WGS84 ellipsoid. + **********************************************************************/ + static Math::real InverseFlattening() throw() + { return 1/Constants::WGS84_f(); } + /// \endcond + }; + +} // namespace GeographicLib + +#endif // GEOGRAPHICLIB_UTMUPS_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Utility.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Utility.hpp new file mode 100644 index 000000000..dfe3e5e01 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Utility.hpp @@ -0,0 +1,521 @@ +/** + * \file Utility.hpp + * \brief Header for GeographicLib::Utility class + * + * Copyright (c) Charles Karney (2011-2012) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ + +#if !defined(GEOGRAPHICLIB_UTILITY_HPP) +#define GEOGRAPHICLIB_UTILITY_HPP 1 + +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) +// Squelch warnings about constant conditional expressions +# pragma warning (push) +# pragma warning (disable: 4127) +#endif + +namespace GeographicLib { + + /** + * \brief Some utility routines for %GeographicLib + * + * Example of use: + * \include example-Utility.cpp + **********************************************************************/ + class GEOGRAPHICLIB_EXPORT Utility { + private: + static bool gregorian(int y, int m, int d) { + // The original cut over to the Gregorian calendar in Pope Gregory XIII's + // time had 1582-10-04 followed by 1582-10-15. Here we implement the + // switch over used by the English-speaking world where 1752-09-02 was + // followed by 1752-09-14. We also assume that the year always begins + // with January 1, whereas in reality it often was reckoned to begin in + // March. + return 100 * (100 * y + m) + d >= 17520914; // or 15821004 + } + static bool gregorian(int s) { + return s >= 639799; // 1752-09-14 + } + public: + + /** + * Convert a date to the day numbering sequentially starting with + * 0001-01-01 as day 1. + * + * @param[in] y the year (must be positive). + * @param[in] m the month, Jan = 1, etc. (must be positive). Default = 1. + * @param[in] d the day of the month (must be positive). Default = 1. + * @return the sequential day number. + **********************************************************************/ + static int day(int y, int m = 1, int d = 1) throw() { + // Convert from date to sequential day and vice versa + // + // Here is some code to convert a date to sequential day and vice + // versa. The sequential day is numbered so that January 1, 1 AD is day 1 + // (a Saturday). So this is offset from the "Julian" day which starts the + // numbering with 4713 BC. + // + // This is inspired by a talk by John Conway at the John von Neumann + // National Supercomputer Center when he described his Doomsday algorithm + // for figuring the day of the week. The code avoids explicitly doing ifs + // (except for the decision of whether to use the Julian or Gregorian + // calendar). Instead the equivalent result is achieved using integer + // arithmetic. I got this idea from the routine for the day of the week + // in MACLisp (I believe that that routine was written by Guy Steele). + // + // There are three issues to take care of + // + // 1. the rules for leap years, + // 2. the inconvenient placement of leap days at the end of February, + // 3. the irregular pattern of month lengths. + // + // We deal with these as follows: + // + // 1. Leap years are given by simple rules which are straightforward to + // accommodate. + // + // 2. We simplify the calculations by moving January and February to the + // previous year. Here we internally number the months March–December, + // January, February as 0–9, 10, 11. + // + // 3. The pattern of month lengths from March through January is regular + // with a 5-month period—31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31. The + // 5-month period is 153 days long. Since February is now at the end of + // the year, we don't need to include its length in this part of the + // calculation. + bool greg = gregorian(y, m, d); + y += (m + 9) / 12 - 1; // Move Jan and Feb to previous year, + m = (m + 9) % 12; // making March month 0. + return + (1461 * y) / 4 // Julian years converted to days. Julian year is 365 + + // 1/4 = 1461/4 days. + // Gregorian leap year corrections. The 2 offset with respect to the + // Julian calendar synchronizes the vernal equinox with that at the time + // of the Council of Nicea (325 AD). + + (greg ? (y / 100) / 4 - (y / 100) + 2 : 0) + + (153 * m + 2) / 5 // The zero-based start of the m'th month + + d - 1 // The zero-based day + - 305; // The number of days between March 1 and December 31. + // This makes 0001-01-01 day 1 + } + + /** + * Convert a date to the day numbering sequentially starting with + * 0001-01-01 as day 1. + * + * @param[in] y the year (must be positive). + * @param[in] m the month, Jan = 1, etc. (must be positive). Default = 1. + * @param[in] d the day of the month (must be positive). Default = 1. + * @param[in] check whether to check the date. + * @exception GeographicErr if the date is invalid and \e check is true. + * @return the sequential day number. + **********************************************************************/ + static int day(int y, int m, int d, bool check) { + int s = day(y, m, d); + if (!check) + return s; + int y1, m1, d1; + date(s, y1, m1, d1); + if (!(s > 0 && y == y1 && m == m1 && d == d1)) + throw GeographicErr("Invalid date " + + str(y) + "-" + str(m) + "-" + str(d) + + (s > 0 ? "; use " + + str(y1) + "-" + str(m1) + "-" + str(d1) : + " before 0001-01-01")); + return s; + } + + /** + * Given a day (counting from 0001-01-01 as day 1), return the date. + * + * @param[in] s the sequential day number (must be positive) + * @param[out] y the year. + * @param[out] m the month, Jan = 1, etc. + * @param[out] d the day of the month. + **********************************************************************/ + static void date(int s, int& y, int& m, int& d) throw() { + int c = 0; + bool greg = gregorian(s); + s += 305; // s = 0 on March 1, 1BC + if (greg) { + s -= 2; // The 2 day Gregorian offset + // Determine century with the Gregorian rules for leap years. The + // Gregorian year is 365 + 1/4 - 1/100 + 1/400 = 146097/400 days. + c = (4 * s + 3) / 146097; + s -= (c * 146097) / 4; // s = 0 at beginning of century + } + y = (4 * s + 3) / 1461; // Determine the year using Julian rules. + s -= (1461 * y) / 4; // s = 0 at start of year, i.e., March 1 + y += c * 100; // Assemble full year + m = (5 * s + 2) / 153; // Determine the month + s -= (153 * m + 2) / 5; // s = 0 at beginning of month + d = s + 1; // Determine day of month + y += (m + 2) / 12; // Move Jan and Feb back to original year + m = (m + 2) % 12 + 1; // Renumber the months so January = 1 + } + + /** + * Given a date as a string in the format yyyy, yyyy-mm, or yyyy-mm-dd, + * return the numeric values for the year, month, and day. No checking is + * done on these values. + * + * @param[in] s the date in string format. + * @param[out] y the year. + * @param[out] m the month, Jan = 1, etc. + * @param[out] d the day of the month. + * @exception GeographicErr is \e s is malformed. + **********************************************************************/ + static void date(const std::string& s, int& y, int& m, int& d) { + int y1, m1 = 1, d1 = 1; + const char* digits = "0123456789"; + std::string::size_type p1 = s.find_first_not_of(digits); + if (p1 == std::string::npos) + y1 = num(s); + else if (s[p1] != '-') + throw GeographicErr("Delimiter not hyphen in date " + s); + else if (p1 == 0) + throw GeographicErr("Empty year field in date " + s); + else { + y1 = num(s.substr(0, p1)); + if (++p1 == s.size()) + throw GeographicErr("Empty month field in date " + s); + std::string::size_type p2 = s.find_first_not_of(digits, p1); + if (p2 == std::string::npos) + m1 = num(s.substr(p1)); + else if (s[p2] != '-') + throw GeographicErr("Delimiter not hyphen in date " + s); + else if (p2 == p1) + throw GeographicErr("Empty month field in date " + s); + else { + m1 = num(s.substr(p1, p2 - p1)); + if (++p2 == s.size()) + throw GeographicErr("Empty day field in date " + s); + d1 = num(s.substr(p2)); + } + } + y = y1; m = m1; d = d1; + } + + /** + * Given the date, return the day of the week. + * + * @param[in] y the year (must be positive). + * @param[in] m the month, Jan = 1, etc. (must be positive). + * @param[in] d the day of the month (must be positive). + * @return the day of the week with Sunday, Monday--Saturday = 0, + * 1--6. + **********************************************************************/ + static int dow(int y, int m, int d) throw() { return dow(day(y, m, d)); } + + /** + * Given the sequential day, return the day of the week. + * + * @param[in] s the sequential day (must be positive). + * @return the day of the week with Sunday, Monday--Saturday = 0, + * 1--6. + **********************************************************************/ + static int dow(int s) throw() { + return (s + 5) % 7; // The 5 offset makes day 1 (0001-01-01) a Saturday. + } + + /** + * Convert a string representing a date to a fractional year. + * + * @tparam T the type of the argument. + * @param[in] s the string to be converted. + * @exception GeographicErr if \e s can't be interpreted as a date. + * @return the fractional year. + * + * The string is first read as an ordinary number (e.g., 2010 or 2012.5); + * if this is successful, the value is returned. Otherwise the string + * should be of the form yyyy-mm or yyyy-mm-dd and this is converted to a + * number with 2010-01-01 giving 2010.0 and 2012-07-03 giving 2012.5. + **********************************************************************/ + template static T fractionalyear(const std::string& s) { + try { + return num(s); + } + catch (const std::exception&) { + } + int y, m, d; + date(s, y, m, d); + int t = day(y, m, d, true); + return T(y) + T(t - day(y)) / T(day(y + 1) - day(y)); + } + + /** + * Convert a object of type T to a string. + * + * @tparam T the type of the argument. + * @param[in] x the value to be converted. + * @param[in] p the precision used (default −1). + * @exception std::bad_alloc if memory for the string can't be allocated. + * @return the string representation. + * + * If \e p ≥ 0, then the number fixed format is used with p bits of + * precision. With p < 0, there is no manipulation of the format. + **********************************************************************/ + template static std::string str(T x, int p = -1) { + if (!std::numeric_limits::is_integer && !Math::isfinite(x)) + return x < 0 ? std::string("-inf") : + (x > 0 ? std::string("inf") : std::string("nan")); + std::ostringstream s; + if (p >= 0) s << std::fixed << std::setprecision(p); + s << x; return s.str(); + } + + /** + * Convert a string to an object of type T. + * + * @tparam T the type of the return value. + * @param[in] s the string to be converted. + * @exception GeographicErr is \e s is not readable as a T. + * @return object of type T + **********************************************************************/ + template static T num(const std::string& s) { + T x; + std::string errmsg; + do { // Executed once (provides the ability to break) + std::istringstream is(s); + if (!(is >> x)) { + errmsg = "Cannot decode " + s; + break; + } + int pos = int(is.tellg()); // Returns -1 at end of string? + if (!(pos < 0 || pos == int(s.size()))) { + errmsg = "Extra text " + s.substr(pos) + " at end of " + s; + break; + } + return x; + } while (false); + x = std::numeric_limits::is_integer ? 0 : nummatch(s); + if (x == 0) + throw GeographicErr(errmsg); + return x; + } + + /** + * Match "nan" and "inf" (and variants thereof) in a string. + * + * @tparam T the type of the return value. + * @param[in] s the string to be matched. + * @return appropriate special value (±∞, nan) or 0 if none is + * found. + **********************************************************************/ + template static T nummatch(const std::string& s) { + if (s.length() < 3) + return 0; + std::string t; + t.resize(s.length()); + std::transform(s.begin(), s.end(), t.begin(), (int(*)(int))std::toupper); + for (size_t i = s.length(); i--;) + t[i] = char(std::toupper(s[i])); + int sign = t[0] == '-' ? -1 : 1; + std::string::size_type p0 = t[0] == '-' || t[0] == '+' ? 1 : 0; + std::string::size_type p1 = t.find_last_not_of('0'); + if (p1 == std::string::npos || p1 + 1 < p0 + 3) + return 0; + // Strip off sign and trailing 0s + t = t.substr(p0, p1 + 1 - p0); // Length at least 3 + if (t == "NAN" || t == "1.#QNAN" || t == "1.#SNAN" || t == "1.#IND" || + t == "1.#R") + return Math::NaN(); + else if (t == "INF" || t == "1.#INF") + return sign * Math::infinity(); + return 0; + } + + /** + * Read a simple fraction, e.g., 3/4, from a string to an object of type T. + * + * @tparam T the type of the return value. + * @param[in] s the string to be converted. + * @exception GeographicErr is \e s is not readable as a fraction of type T. + * @return object of type T + **********************************************************************/ + template static T fract(const std::string& s) { + std::string::size_type delim = s.find('/'); + return + !(delim != std::string::npos && delim >= 1 && delim + 2 <= s.size()) ? + num(s) : + // delim in [1, size() - 2] + num(s.substr(0, delim)) / num(s.substr(delim + 1)); + } + + /** + * Lookup up a character in a string. + * + * @param[in] s the string to be searched. + * @param[in] c the character to look for. + * @return the index of the first occurrence character in the string or + * −1 is the character is not present. + * + * \e c is converted to upper case before search \e s. Therefore, it is + * intended that \e s should not contain any lower case letters. + **********************************************************************/ + static int lookup(const std::string& s, char c) throw() { + std::string::size_type r = s.find(char(toupper(c))); + return r == std::string::npos ? -1 : int(r); + } + + /** + * Read data of type ExtT from a binary stream to an array of type IntT. + * The data in the file is in (bigendp ? big : little)-endian format. + * + * @tparam ExtT the type of the objects in the binary stream (external). + * @tparam IntT the type of the objects in the array (internal). + * @tparam bigendp true if the external storage format is big-endian. + * @param[in] str the input stream containing the data of type ExtT + * (external). + * @param[out] array the output array of type IntT (internal). + * @param[in] num the size of the array. + * @exception GeographicErr if the data cannot be read. + **********************************************************************/ + template + static inline void readarray(std::istream& str, + IntT array[], size_t num) { + if (sizeof(IntT) == sizeof(ExtT) && + std::numeric_limits::is_integer == + std::numeric_limits::is_integer) { + // Data is compatible (aside from the issue of endian-ness). + str.read(reinterpret_cast(array), num * sizeof(ExtT)); + if (!str.good()) + throw GeographicErr("Failure reading data"); + if (bigendp != Math::bigendian) { // endian mismatch -> swap bytes + for (size_t i = num; i--;) + array[i] = Math::swab(array[i]); + } + } else { + const int bufsize = 1024; // read this many values at a time + ExtT buffer[bufsize]; // temporary buffer + int k = int(num); // data values left to read + int i = 0; // index into output array + while (k) { + int n = (std::min)(k, bufsize); + str.read(reinterpret_cast(buffer), n * sizeof(ExtT)); + if (!str.good()) + throw GeographicErr("Failure reading data"); + for (int j = 0; j < n; ++j) + // fix endian-ness and cast to IntT + array[i++] = IntT(bigendp == Math::bigendian ? buffer[j] : + Math::swab(buffer[j])); + k -= n; + } + } + return; + } + + /** + * Read data of type ExtT from a binary stream to a vector array of type + * IntT. The data in the file is in (bigendp ? big : little)-endian + * format. + * + * @tparam ExtT the type of the objects in the binary stream (external). + * @tparam IntT the type of the objects in the array (internal). + * @tparam bigendp true if the external storage format is big-endian. + * @param[in] str the input stream containing the data of type ExtT + * (external). + * @param[out] array the output vector of type IntT (internal). + * @exception GeographicErr if the data cannot be read. + **********************************************************************/ + template + static inline void readarray(std::istream& str, + std::vector& array) { + readarray(str, &array[0], array.size()); + } + + /** + * Write data in an array of type IntT as type ExtT to a binary stream. + * The data in the file is in (bigendp ? big : little)-endian format. + * + * @tparam ExtT the type of the objects in the binary stream (external). + * @tparam IntT the type of the objects in the array (internal). + * @tparam bigendp true if the external storage format is big-endian. + * @param[out] str the output stream for the data of type ExtT (external). + * @param[in] array the input array of type IntT (internal). + * @param[in] num the size of the array. + * @exception GeographicErr if the data cannot be written. + **********************************************************************/ + template + static inline void writearray(std::ostream& str, + const IntT array[], size_t num) { + if (sizeof(IntT) == sizeof(ExtT) && + std::numeric_limits::is_integer == + std::numeric_limits::is_integer && + bigendp == Math::bigendian) { + // Data is compatible (including endian-ness). + str.write(reinterpret_cast(array), num * sizeof(ExtT)); + if (!str.good()) + throw GeographicErr("Failure writing data"); + } else { + const int bufsize = 1024; // write this many values at a time + ExtT buffer[bufsize]; // temporary buffer + int k = int(num); // data values left to write + int i = 0; // index into output array + while (k) { + int n = (std::min)(k, bufsize); + for (int j = 0; j < n; ++j) + // cast to ExtT and fix endian-ness + buffer[j] = bigendp == Math::bigendian ? ExtT(array[i++]) : + Math::swab(ExtT(array[i++])); + str.write(reinterpret_cast(buffer), n * sizeof(ExtT)); + if (!str.good()) + throw GeographicErr("Failure writing data"); + k -= n; + } + } + return; + } + + /** + * Write data in an array of type IntT as type ExtT to a binary stream. + * The data in the file is in (bigendp ? big : little)-endian format. + * + * @tparam ExtT the type of the objects in the binary stream (external). + * @tparam IntT the type of the objects in the array (internal). + * @tparam bigendp true if the external storage format is big-endian. + * @param[out] str the output stream for the data of type ExtT (external). + * @param[in] array the input vector of type IntT (internal). + * @exception GeographicErr if the data cannot be written. + **********************************************************************/ + template + static inline void writearray(std::ostream& str, + std::vector& array) { + writearray(str, &array[0], array.size()); + } + + /** + * Parse a KEY VALUE line. + * + * @param[in] line the input line. + * @param[out] key the key. + * @param[out] val the value. + * @exception std::bad_alloc if memory for the internal strings can't be + * allocated. + * @return whether a key was found. + * + * A # character and everything after it are discarded. If the results is + * just white space, the routine returns false (and \e key and \e val are + * not set). Otherwise the first token is taken to be the key and the rest + * of the line (trimmed of leading and trailing white space) is the value. + **********************************************************************/ + static bool ParseLine(const std::string& line, + std::string& key, std::string& val); + + }; + +} // namespace GeographicLib + +#if defined(_MSC_VER) +# pragma warning (pop) +#endif + +#endif // GEOGRAPHICLIB_UTILITY_HPP diff --git a/gtsam/3rdparty/GeographicLib/include/Makefile.am b/gtsam/3rdparty/GeographicLib/include/Makefile.am new file mode 100644 index 000000000..83988a446 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/Makefile.am @@ -0,0 +1,50 @@ +# +# Makefile.am +# +# Copyright (C) 2009, Francesco P. Lovergine + +nobase_include_HEADERS = GeographicLib/Accumulator.hpp \ + GeographicLib/AlbersEqualArea.hpp \ + GeographicLib/AzimuthalEquidistant.hpp \ + GeographicLib/CassiniSoldner.hpp \ + GeographicLib/CircularEngine.hpp \ + GeographicLib/Constants.hpp \ + GeographicLib/DMS.hpp \ + GeographicLib/Ellipsoid.hpp \ + GeographicLib/EllipticFunction.hpp \ + GeographicLib/GeoCoords.hpp \ + GeographicLib/Geocentric.hpp \ + GeographicLib/Geodesic.hpp \ + GeographicLib/GeodesicExact.hpp \ + GeographicLib/GeodesicLine.hpp \ + GeographicLib/GeodesicLineExact.hpp \ + GeographicLib/Geohash.hpp \ + GeographicLib/Geoid.hpp \ + GeographicLib/Gnomonic.hpp \ + GeographicLib/GravityCircle.hpp \ + GeographicLib/GravityModel.hpp \ + GeographicLib/LambertConformalConic.hpp \ + GeographicLib/LocalCartesian.hpp \ + GeographicLib/MGRS.hpp \ + GeographicLib/MagneticCircle.hpp \ + GeographicLib/MagneticModel.hpp \ + GeographicLib/Math.hpp \ + GeographicLib/NormalGravity.hpp \ + GeographicLib/OSGB.hpp \ + GeographicLib/PolarStereographic.hpp \ + GeographicLib/PolygonArea.hpp \ + GeographicLib/SphericalEngine.hpp \ + GeographicLib/SphericalHarmonic.hpp \ + GeographicLib/SphericalHarmonic1.hpp \ + GeographicLib/SphericalHarmonic2.hpp \ + GeographicLib/TransverseMercator.hpp \ + GeographicLib/TransverseMercatorExact.hpp \ + GeographicLib/UTMUPS.hpp \ + GeographicLib/Utility.hpp \ + GeographicLib/Config.h + +geographiclib_data=$(datadir)/GeographicLib + +DEFS=-DGEOGRAPHICLIB_DATA=\"$(geographiclib_data)\" @DEFS@ + +EXTRA_DIST = Makefile.mk GeographicLib/CMakeLists.txt GeographicLib/Config.h.in diff --git a/gtsam/3rdparty/GeographicLib/include/Makefile.in b/gtsam/3rdparty/GeographicLib/include/Makefile.in new file mode 100644 index 000000000..8a926b19b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/Makefile.in @@ -0,0 +1,569 @@ +# Makefile.in generated by automake 1.12.2 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2012 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Makefile.am +# +# Copyright (C) 2009, Francesco P. Lovergine + +VPATH = @srcdir@ +am__make_dryrun = \ + { \ + am__dry=no; \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ + | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ + *) \ + for am__flg in $$MAKEFLAGS; do \ + case $$am__flg in \ + *=*|--*) ;; \ + *n*) am__dry=yes; break;; \ + esac; \ + done;; \ + esac; \ + test $$am__dry = yes; \ + } +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = include +DIST_COMMON = $(nobase_include_HEADERS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/include/GeographicLib/Config-ac.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(includedir)" +HEADERS = $(nobase_include_HEADERS) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +COL = @COL@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = -DGEOGRAPHICLIB_DATA=\"$(geographiclib_data)\" @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GEOGRAPHICLIB_VERSION_MAJOR = @GEOGRAPHICLIB_VERSION_MAJOR@ +GEOGRAPHICLIB_VERSION_MINOR = @GEOGRAPHICLIB_VERSION_MINOR@ +GEOGRAPHICLIB_VERSION_PATCH = @GEOGRAPHICLIB_VERSION_PATCH@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +POD2HTML = @POD2HTML@ +POD2MAN = @POD2MAN@ +POW_LIB = @POW_LIB@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +nobase_include_HEADERS = GeographicLib/Accumulator.hpp \ + GeographicLib/AlbersEqualArea.hpp \ + GeographicLib/AzimuthalEquidistant.hpp \ + GeographicLib/CassiniSoldner.hpp \ + GeographicLib/CircularEngine.hpp \ + GeographicLib/Constants.hpp \ + GeographicLib/DMS.hpp \ + GeographicLib/Ellipsoid.hpp \ + GeographicLib/EllipticFunction.hpp \ + GeographicLib/GeoCoords.hpp \ + GeographicLib/Geocentric.hpp \ + GeographicLib/Geodesic.hpp \ + GeographicLib/GeodesicExact.hpp \ + GeographicLib/GeodesicLine.hpp \ + GeographicLib/GeodesicLineExact.hpp \ + GeographicLib/Geohash.hpp \ + GeographicLib/Geoid.hpp \ + GeographicLib/Gnomonic.hpp \ + GeographicLib/GravityCircle.hpp \ + GeographicLib/GravityModel.hpp \ + GeographicLib/LambertConformalConic.hpp \ + GeographicLib/LocalCartesian.hpp \ + GeographicLib/MGRS.hpp \ + GeographicLib/MagneticCircle.hpp \ + GeographicLib/MagneticModel.hpp \ + GeographicLib/Math.hpp \ + GeographicLib/NormalGravity.hpp \ + GeographicLib/OSGB.hpp \ + GeographicLib/PolarStereographic.hpp \ + GeographicLib/PolygonArea.hpp \ + GeographicLib/SphericalEngine.hpp \ + GeographicLib/SphericalHarmonic.hpp \ + GeographicLib/SphericalHarmonic1.hpp \ + GeographicLib/SphericalHarmonic2.hpp \ + GeographicLib/TransverseMercator.hpp \ + GeographicLib/TransverseMercatorExact.hpp \ + GeographicLib/UTMUPS.hpp \ + GeographicLib/Utility.hpp \ + GeographicLib/Config.h + +geographiclib_data = $(datadir)/GeographicLib +EXTRA_DIST = Makefile.mk GeographicLib/CMakeLists.txt GeographicLib/Config.h.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-nobase_includeHEADERS: $(nobase_include_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ + fi; \ + $(am__nobase_list) | while read dir files; do \ + xfiles=; for file in $$files; do \ + if test -f "$$file"; then xfiles="$$xfiles $$file"; \ + else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ + test -z "$$xfiles" || { \ + test "x$$dir" = x. || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ + $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ + echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ + $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ + done + +uninstall-nobase_includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ + $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ + dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +cscopelist: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(HEADERS) +installdirs: + for dir in "$(DESTDIR)$(includedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-nobase_includeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-nobase_includeHEADERS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool cscopelist ctags distclean distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-nobase_includeHEADERS \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-nobase_includeHEADERS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/gtsam/3rdparty/GeographicLib/include/Makefile.mk b/gtsam/3rdparty/GeographicLib/include/Makefile.mk new file mode 100644 index 000000000..fbb9036eb --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/include/Makefile.mk @@ -0,0 +1,57 @@ +MODULES = AlbersEqualArea \ + AzimuthalEquidistant \ + CassiniSoldner \ + CircularEngine \ + DMS \ + Ellipsoid \ + EllipticFunction \ + GeoCoords \ + Geocentric \ + Geodesic \ + GeodesicExact \ + GeodesicLine \ + GeodesicLineExact \ + Geohash \ + Geoid \ + Gnomonic \ + GravityCircle \ + GravityModel \ + LambertConformalConic \ + LocalCartesian \ + MGRS \ + MagneticCircle \ + MagneticModel \ + NormalGravity \ + OSGB \ + PolarStereographic \ + PolygonArea \ + SphericalEngine \ + TransverseMercator \ + TransverseMercatorExact \ + UTMUPS \ + Utility +EXTRAHEADERS = Accumulator \ + Constants \ + Math \ + SphericalHarmonic \ + SphericalHarmonic1 \ + SphericalHarmonic2 + +PREFIX = /usr/local +LIBNAME = GeographicLib +HEADERS = $(LIBNAME)/Config.h \ + $(patsubst %,$(LIBNAME)/%.hpp,$(EXTRAHEADERS) $(MODULES)) +DEST = $(PREFIX)/include/$(LIBNAME) + +INSTALL = install -b + +all: + @: + +install: + test -d $(DEST) || mkdir -p $(DEST) + $(INSTALL) -m 644 $(HEADERS) $(DEST)/ +clean: + @: + +.PHONY: all install clean diff --git a/gtsam/3rdparty/GeographicLib/install-sh b/gtsam/3rdparty/GeographicLib/install-sh new file mode 100755 index 000000000..377bb8687 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/install-sh @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/gtsam/3rdparty/GeographicLib/java/README.txt b/gtsam/3rdparty/GeographicLib/java/README.txt new file mode 100644 index 000000000..f58b00882 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/README.txt @@ -0,0 +1,21 @@ +This is a Java implementation of the geodesic algorithms described in + + C. F. F. Karney, + Algorithms for geodesics, + J. Geodesy 87, 43-55 (2013); + http://dx.doi.org/10.1007/s00190-012-0578-z + Addenda: http://geographiclib.sf.net/geod-addenda.html + +For documentation, see + + http://geographiclib.sourceforge.net/html/java/ + +The code in this directory is entirely self-contained. In particular, +it does not depend on the C++ classes. You can build the example +programs using, for example, + + cd inverse/src/main/java + javac -cp .:../../../../src/main/java Inverse.java + echo -30 0 29.5 179.5 | java -cp .:../../../../src/main/java Inverse + +Building with maven is also supported (see the documentation). diff --git a/gtsam/3rdparty/GeographicLib/java/direct/pom.xml b/gtsam/3rdparty/GeographicLib/java/direct/pom.xml new file mode 100644 index 000000000..0fd9053af --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/direct/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + + net.sf.geographiclib.example + Direct + Direct + 1.31 + + jar + + + . + 1.6 + 2.9 + UTF-8 + 2.3.2 + 2.4 + 2.8 + 3.0 + + + + + net.sf.geographiclib + GeographicLib + 1.31 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire-plugin.version} + + false + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc.version} + + public + true + + + + attach-javadocs + + jar + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + Direct + + + + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/java/direct/src/main/java/Direct.java b/gtsam/3rdparty/GeographicLib/java/direct/src/main/java/Direct.java new file mode 100644 index 000000000..a09968c39 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/direct/src/main/java/Direct.java @@ -0,0 +1,27 @@ +/** + * A test program for the GeographicLib.Geodesic.Direct method + **********************************************************************/ + +import java.util.*; +import net.sf.geographiclib.*; +public class Direct { +/** + * Solve the direct geodesic problem. + * + * This program reads in lines with lat1, lon1, azi1, s12 and prints out lines + * with lat2, lon2, azi2 (for the WGS84 ellipsoid). + **********************************************************************/ + public static void main(String[] args) { + try { + Scanner in = new Scanner(System.in); + double lat1, lon1, azi1, s12; + while (true) { + lat1 = in.nextDouble(); lon1 = in.nextDouble(); + azi1 = in.nextDouble(); s12 = in.nextDouble(); + GeodesicData g = Geodesic.WGS84.Direct(lat1, lon1, azi1, s12); + System.out.println(g.lat2 + " " + g.lon2 + " " + g.azi2); + } + } + catch (Exception e) {} + } +} diff --git a/gtsam/3rdparty/GeographicLib/java/inverse/pom.xml b/gtsam/3rdparty/GeographicLib/java/inverse/pom.xml new file mode 100644 index 000000000..a6e025cec --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/inverse/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + + net.sf.geographiclib.example + Inverse + Inverse + 1.31 + + jar + + + . + 1.6 + 2.9 + UTF-8 + 2.3.2 + 2.4 + 2.8 + 3.0 + + + + + net.sf.geographiclib + GeographicLib + 1.31 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire-plugin.version} + + false + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc.version} + + public + true + + + + attach-javadocs + + jar + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + Inverse + + + + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/java/inverse/src/main/java/Inverse.java b/gtsam/3rdparty/GeographicLib/java/inverse/src/main/java/Inverse.java new file mode 100644 index 000000000..b40580cac --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/inverse/src/main/java/Inverse.java @@ -0,0 +1,27 @@ +/** + * A test program for the GeographicLib.Geodesic.Inverse method + **********************************************************************/ + +import java.util.*; +import net.sf.geographiclib.*; +/** + * Solve the inverse geodesic problem. + * + * This program reads in lines with lat1, lon1, lat2, lon2 and prints out lines + * with azi1, azi2, s12 (for the WGS84 ellipsoid). + **********************************************************************/ +public class Inverse { + public static void main(String[] args) { + try { + Scanner in = new Scanner(System.in); + double lat1, lon1, lat2, lon2; + while (true) { + lat1 = in.nextDouble(); lon1 = in.nextDouble(); + lat2 = in.nextDouble(); lon2 = in.nextDouble(); + GeodesicData g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2); + System.out.println(g.azi1 + " " + g.azi2 + " " + g.s12); + } + } + catch (Exception e) {} + } +} diff --git a/gtsam/3rdparty/GeographicLib/java/planimeter/pom.xml b/gtsam/3rdparty/GeographicLib/java/planimeter/pom.xml new file mode 100644 index 000000000..fe50ea2d9 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/planimeter/pom.xml @@ -0,0 +1,87 @@ + + + 4.0.0 + + net.sf.geographiclib.example + Planimeter + Planimeter + 1.31 + + jar + + + . + 1.6 + 2.9 + UTF-8 + 2.3.2 + 2.4 + 2.8 + 3.0 + + + + + net.sf.geographiclib + GeographicLib + 1.31 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire-plugin.version} + + false + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc.version} + + public + true + + + + attach-javadocs + + jar + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + Planimeter + + + + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/java/planimeter/src/main/java/Planimeter.java b/gtsam/3rdparty/GeographicLib/java/planimeter/src/main/java/Planimeter.java new file mode 100644 index 000000000..5bf0aaf9f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/planimeter/src/main/java/Planimeter.java @@ -0,0 +1,28 @@ +/** + * A test program for the GeographicLib.PolygonArea class + **********************************************************************/ + +import java.util.*; +import net.sf.geographiclib.*; +/** + * Compute the area of a geodesic polygon. + * + * This program reads lines with lat, lon for each vertex of a polygon. At the + * end of input, the program prints the number of vertices, the perimeter of + * the polygon and its area (for the WGS84 ellipsoid). + **********************************************************************/ +public class Planimeter { + public static void main(String[] args) { + PolygonArea p = new PolygonArea(Geodesic.WGS84, false); + try { + Scanner in = new Scanner(System.in); + while (true) { + double lat = in.nextDouble(), lon = in.nextDouble(); + p.AddPoint(lat, lon); + } + } + catch (Exception e) {} + PolygonResult r = p.Compute(); + System.out.println(r.num + " " + r.perimeter + " " + r.area); + } +} diff --git a/gtsam/3rdparty/GeographicLib/java/pom.xml b/gtsam/3rdparty/GeographicLib/java/pom.xml new file mode 100644 index 000000000..e6af2e0e5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/pom.xml @@ -0,0 +1,90 @@ + + + 4.0.0 + + net.sf.geographiclib + GeographicLib + GeographicLib + 1.31 + + jar + + This is a Java implementation of the geodesic algorithms from GeographicLib. This is a self-contained library which makes it easy to do geodesic computations for an ellipsoid of revolution in a Java program. It requires Java version 1.1 or later. + + + + . + 1.6 + 2.9 + UTF-8 + 2.3.2 + 2.4 + 2.8 + 3.0 + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven-compiler-plugin.version} + + ${java.version} + ${java.version} + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${surefire-plugin.version} + + false + + + + + org.apache.maven.plugins + maven-javadoc-plugin + ${maven-javadoc.version} + + public + true + + + + attach-javadocs + + jar + + + + + + + + + + + + + + scm:git:http:// + + + scm:git:https:// + + devel + + http:// + + + + diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Accumulator.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Accumulator.java new file mode 100644 index 000000000..bcba4b7d6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Accumulator.java @@ -0,0 +1,113 @@ +/** + * Implementation of the net.sf.geographiclib.Accumulator class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * An accumulator for sums. + *

+ * This allow many double precision numbers to be added together with twice the + * normal precision. Thus the effective precision of the sum is 106 bits or + * about 32 decimal places. + *

+ * The implementation follows J. R. Shewchuk, + * Adaptive Precision + * Floating-Point Arithmetic and Fast Robust Geometric Predicates, + * Discrete & Computational Geometry 18(3) 305–363 (1997). + *

+ * In the documentation of the member functions, sum stands for the value + * currently held in the accumulator. + ***********************************************************************/ +public class Accumulator { + // _s + _t accumulators for the sum. + private double _s, _t; + /** + * Construct from a double. + *

+ * @param y set sum = y. + **********************************************************************/ + public Accumulator(double y) { _s = y; _t = 0; } + /** + * Construct from another Accumulator. + *

+ * @param a set sum = a. + **********************************************************************/ + public Accumulator(Accumulator a) { _s = a._s; _t = a._t; } + /** + * Set the value to a double. + *

+ * @param y set sum = y. + **********************************************************************/ + public void Set(double y) { _s = y; _t = 0; } + /** + * Return the value held in the accumulator. + *

+ * @return sum. + **********************************************************************/ + public double Sum() { return _s; } + /** + * Return the result of adding a number to sum (but don't change + * sum). + *

+ * @param y the number to be added to the sum. + * @return sum + y. + **********************************************************************/ + public double Sum(double y) { + Accumulator a = new Accumulator(this); + a.Add(y); + return a._s; + } + /** + * Add a number to the accumulator. + *

+ * @param y set sum += y. + **********************************************************************/ + public void Add(double y) { + // Here's Shewchuk's solution... + double u; // hold exact sum as [s, t, u] + // Accumulate starting at least significant end + { Pair r = GeoMath.sum(y, _t); y = r.first; u = r.second; } + { Pair r = GeoMath.sum(y, _s); _s = r.first; _t = r.second; } + // Start is _s, _t decreasing and non-adjacent. Sum is now (s + t + u) + // exactly with s, t, u non-adjacent and in decreasing order (except for + // possible zeros). The following code tries to normalize the result. + // Ideally, we want _s = round(s+t+u) and _u = round(s+t+u - _s). The + // following does an approximate job (and maintains the decreasing + // non-adjacent property). Here are two "failures" using 3-bit floats: + // + // Case 1: _s is not equal to round(s+t+u) -- off by 1 ulp + // [12, -1] - 8 -> [4, 0, -1] -> [4, -1] = 3 should be [3, 0] = 3 + // + // Case 2: _s+_t is not as close to s+t+u as it shold be + // [64, 5] + 4 -> [64, 8, 1] -> [64, 8] = 72 (off by 1) + // should be [80, -7] = 73 (exact) + // + // "Fixing" these problems is probably not worth the expense. The + // representation inevitably leads to small errors in the accumulated + // values. The additional errors illustrated here amount to 1 ulp of the + // less significant word during each addition to the Accumulator and an + // additional possible error of 1 ulp in the reported sum. + // + // Incidentally, the "ideal" representation described above is not + // canonical, because _s = round(_s + _t) may not be true. For example, + // with 3-bit floats: + // + // [128, 16] + 1 -> [160, -16] -- 160 = round(145). + // But [160, 0] - 16 -> [128, 16] -- 128 = round(144). + // + if (_s == 0) // This implies t == 0, + _s = u; // so result is u + else + _t += u; // otherwise just accumulate u to t. + } + /** + * Negate an accumulator. + *

+ * Set sum = −sum. + **********************************************************************/ + public void Negate() { _s = -_s; _t = -_t; } +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Constants.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Constants.java new file mode 100644 index 000000000..047667842 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Constants.java @@ -0,0 +1,26 @@ +/** + * Implementation of the net.sf.geographiclib.Constants class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * Constants needed by GeographicLib. + *

+ * Define constants specifying the WGS84 ellipsoid. + ***********************************************************************/ +public class Constants { + /** + * The equatorial radius of WGS84 ellipsoid (6378137 m). + **********************************************************************/ + public static final double WGS84_a = 6378137; + /** + * The flattening of WGS84 ellipsoid (1/298.257223563). + **********************************************************************/ + public static final double WGS84_f = 1/298.257223563; + + private Constants() {} +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeoMath.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeoMath.java new file mode 100644 index 000000000..80631eb95 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeoMath.java @@ -0,0 +1,191 @@ +/** + * Implementation of the net.sf.geographiclib.GeoMath class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * Mathematical functions needed by GeographicLib. + *

+ * Define mathematical functions and constants so that any version of Java + * can be used. + **********************************************************************/ +public class GeoMath { + /** + * The number of binary digits in the fraction of a double precision + * number (equivalent to C++'s {@code numeric_limits::digits}). + **********************************************************************/ + public static final int digits = 53; + /** + * Equivalent to C++'s {@code numeric_limits::epsilon()}. In Java + * version 1.5 and later, Math.ulp(1.0) can be used. + **********************************************************************/ + public static final double epsilon = Math.pow(0.5, digits - 1); + /** + * Equivalent to C++'s {@code numeric_limits::min()}. In Java + * version 1.6 and later, Double.MIN_NORMAL can be used. + **********************************************************************/ + public static final double min = Math.pow(0.5, 1022); + /** + * The number of radians in a degree. In Java version 1.2 and later, + * Math.toRadians and Math.toDegrees can be used. + **********************************************************************/ + public static final double degree = Math.PI / 180; + + /** + * Square a number. + *

+ * @param x the argument. + * @return x2. + **********************************************************************/ + public static double sq(double x) { return x * x; } + + /** + * The hypotenuse function avoiding underflow and overflow. In Java version + * 1.5 and later, Math.hypot can be used. + *

+ * @param x the first argument. + * @param y the second argument. + * @return sqrt(x2 + y2). + **********************************************************************/ + public static double hypot(double x, double y) { + x = Math.abs(x); y = Math.abs(y); + double a = Math.max(x, y), b = Math.min(x, y) / (a != 0 ? a : 1); + return a * Math.sqrt(1 + b * b); + // For an alternative method see + // C. Moler and D. Morrision (1983) http://dx.doi.org/10.1147/rd.276.0577 + // and A. A. Dubrulle (1983) http://dx.doi.org/10.1147/rd.276.0582 + } + + /** + * log(1 + x) accurate near x = 0. In Java version 1.5 and + * later, Math.log1p can be used. + *

+ * This is taken from D. Goldberg, + * What every computer + * scientist should know about floating-point arithmetic (1991), + * Theorem 4. See also, N. J. Higham, Accuracy and Stability of Numerical + * Algorithms, 2nd Edition (SIAM, 2002), Answer to Problem 1.5, p 528. + *

+ * @param x the argument. + * @return log(1 + x). + **********************************************************************/ + public static double log1p(double x) { + double + y = 1 + x, + z = y - 1; + // Here's the explanation for this magic: y = 1 + z, exactly, and z + // approx x, thus log(y)/z (which is nearly constant near z = 0) returns + // a good approximation to the true log(1 + x)/x. The multiplication x * + // (log(y)/z) introduces little additional error. + return z == 0 ? x : x * Math.log(y) / z; + } + + /** + * The inverse hyperbolic tangent function. This is defined in terms of + * GeoMath.log1p(x) in order to maintain accuracy near x = 0. + * In addition, the odd parity of the function is enforced. + *

+ * @param x the argument. + * @return atanh(x). + **********************************************************************/ + public static double atanh(double x) { + double y = Math.abs(x); // Enforce odd parity + y = Math.log1p(2 * y/(1 - y))/2; + return x < 0 ? -y : y; + } + + /** + * The cube root function. In Java version 1.5 and later, Math.cbrt can be + * used. + *

+ * @param x the argument. + * @return the real cube root of x. + **********************************************************************/ + public static double cbrt(double x) { + double y = Math.pow(Math.abs(x), 1/3.0); // Return the real cube root + return x < 0 ? -y : y; + } + + /** + * The error-free sum of two numbers. + *

+ * @param u the first number in the sum. + * @param v the second number in the sum. + * @return Pair(s, t) with s = round(u + + * v) and t = u + v - s. + *

+ * See D. E. Knuth, TAOCP, Vol 2, 4.2.2, Theorem B. + **********************************************************************/ + public static Pair sum(double u, double v) { + double s = u + v; + double up = s - v; + double vpp = s - up; + up -= u; + vpp -= v; + double t = -(up + vpp); + // u + v = s + t + // = round(u + v) + t + return new Pair(s, t); + } + + /** + * Normalize an angle (restricted input range). + *

+ * @param x the angle in degrees. + * @return the angle reduced to the range [−180°, 180°). + *

+ * x must lie in [−540°, 540°). + **********************************************************************/ + public static double AngNormalize(double x) + { return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); } + + /** + * Normalize an arbitrary angle. + *

+ * @param x the angle in degrees. + * @return the angle reduced to the range [−180°, 180°). + *

+ * The range of x is unrestricted. + **********************************************************************/ + public static double AngNormalize2(double x) + { return AngNormalize(x % 360.0); } + + /** + * Difference of two angles reduced to [−180°, 180°] + *

+ * @param x the first angle in degrees. + * @param y the second angle in degrees. + * @return yx, reduced to the range [−180°, + * 180°]. + *

+ * x and y must both lie in [−180°, 180°]. The + * result is equivalent to computing the difference exactly, reducing it to + * (−180°, 180°] and rounding the result. Note that this + * prescription allows −180° to be returned (e.g., if x is + * tiny and negative and y = 180°). + **********************************************************************/ + public static double AngDiff(double x, double y) { + double d, t; + { Pair r = sum(-x, y); d = r.first; t = r.second; } + if ((d - 180.0) + t > 0.0) // y - x > 180 + d -= 360.0; // exact + else if ((d + 180.0) + t <= 0.0) // y - x <= -180 + d += 360.0; // exact + return d + t; + } + /** + * Test for finiteness. + *

+ * @param x the argument. + * @return true if number is finite, false if NaN or infinite. + **********************************************************************/ + public static boolean isfinite(double x) { + return Math.abs(x) <= Double.MAX_VALUE; + } + + private GeoMath() {} +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Geodesic.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Geodesic.java new file mode 100644 index 000000000..4fe5a9694 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Geodesic.java @@ -0,0 +1,1563 @@ +/** + * Implementation of the net.sf.geographiclib.Geodesic class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * Geodesic calculations. + *

+ * The shortest path between two points on a ellipsoid at (lat1, + * lon1) and (lat2, lon2) is called the geodesic. Its + * length is s12 and the geodesic from point 1 to point 2 has azimuths + * azi1 and azi2 at the two end points. (The azimuth is the + * heading measured clockwise from north. azi2 is the "forward" + * azimuth, i.e., the heading that takes you beyond point 2 not back to point + * 1.) + *

+ * Given lat1, lon1, azi1, and s12, we can + * determine lat2, lon2, and azi2. This is the + * direct geodesic problem and its solution is given by the function + * {@link #Direct Direct}. (If s12 is sufficiently large that the + * geodesic wraps more than halfway around the earth, there will be another + * geodesic between the points with a smaller s12.) + *

+ * Given lat1, lon1, lat2, and lon2, we can + * determine azi1, azi2, and s12. This is the + * inverse geodesic problem, whose solution is given by {@link #Inverse + * Inverse}. Usually, the solution to the inverse problem is unique. In cases + * where there are multiple solutions (all with the same s12, of + * course), all the solutions can be easily generated once a particular + * solution is provided. + *

+ * The standard way of specifying the direct problem is the specify the + * distance s12 to the second point. However it is sometimes useful + * instead to specify the arc length a12 (in degrees) on the auxiliary + * sphere. This is a mathematical construct used in solving the geodesic + * problems. The solution of the direct problem in this form is provided by + * {@link #ArcDirect ArcDirect}. An arc length in excess of 180° indicates + * that the geodesic is not a shortest path. In addition, the arc length + * between an equatorial crossing and the next extremum of latitude for a + * geodesic is 90°. + *

+ * This class can also calculate several other quantities related to + * geodesics. These are: + *

    + *
  • + * reduced length. If we fix the first point and increase + * azi1 by dazi1 (radians), the second point is displaced + * m12 dazi1 in the direction azi2 + 90°. The + * quantity m12 is called the "reduced length" and is symmetric under + * interchange of the two points. On a curved surface the reduced length + * obeys a symmetry relation, m12 + m21 = 0. On a flat + * surface, we have m12 = s12. The ratio s12/m12 + * gives the azimuthal scale for an azimuthal equidistant projection. + *
  • + * geodesic scale. Consider a reference geodesic and a second + * geodesic parallel to this one at point 1 and separated by a small distance + * dt. The separation of the two geodesics at point 2 is M12 + * dt where M12 is called the "geodesic scale". M21 is + * defined similarly (with the geodesics being parallel at point 2). On a + * flat surface, we have M12 = M21 = 1. The quantity + * 1/M12 gives the scale of the Cassini-Soldner projection. + *
  • + * area. The area between the geodesic from point 1 to point 2 and + * the equation is represented by S12; it is the area, measured + * counter-clockwise, of the geodesic quadrilateral with corners + * (lat1,lon1), (0,lon1), (0,lon2), and + * (lat2,lon2). It can be used to compute the area of any + * simple geodesic polygon. + *
+ *

+ * The quantities m12, M12, M21 which all specify the + * behavior of nearby geodesics obey addition rules. If points 1, 2, and 3 all + * lie on a single geodesic, then the following rules hold: + *

    + *
  • + * s13 = s12 + s23 + *
  • + * a13 = a12 + a23 + *
  • + * S13 = S12 + S23 + *
  • + * m13 = m12 M23 + m23 M21 + *
  • + * M13 = M12 M23 − (1 − M12 + * M21) m23 / m12 + *
  • + * M31 = M32 M21 − (1 − M23 + * M32) m12 / m23 + *
+ *

+ * The results of the geodesic calculations are bundled up into a {@link + * GeodesicData} object which includes the input parameters and all the + * computed results, i.e., lat1, lon1, azi1, lat2, + * lon2, azi2, s12, a12, m12, M12, + * M21, S12. + *

+ * The functions {@link #Direct(double, double, double, double, int) Direct}, + * {@link #ArcDirect(double, double, double, double, int) ArcDirect}, and + * {@link #Inverse(double, double, double, double, int) Inverse} include an + * optional final argument outmask which allows you specify which + * results should be computed and returned. If you omit outmask, then + * the "standard" geodesic results are computed (latitudes, longitudes, + * azimuths, and distance). outmask is bitor'ed combination of {@link + * GeodesicMask} values. For example, if you wish just to compute the distance + * between two points you would call, e.g., + *

+ * {@code
+ *  GeodesicData g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2,
+ *                      GeodesicMask.DISTANCE); }
+ *

+ * Additional functionality is provided by the {@link GeodesicLine} class, + * which allows a sequence of points along a geodesic to be computed. + *

+ * The shortest distance returned by the solution of the inverse problem is + * (obviously) uniquely defined. However, in a few special cases there are + * multiple azimuths which yield the same shortest distance. Here is a + * catalog of those cases: + *

    + *
  • + * lat1 = −lat2 (with neither point at a pole). If + * azi1 = azi2, the geodesic is unique. Otherwise there are + * two geodesics and the second one is obtained by setting [azi1, + * azi2] = [azi2, azi1], [M12, M21] = + * [M21, M12], S12 = −S12. (This occurs + * when the longitude difference is near ±180° for oblate + * ellipsoids.) + *
  • + * lon2 = lon1 ± 180° (with neither point at a + * pole). If azi1 = 0° or ±180°, the geodesic is + * unique. Otherwise there are two geodesics and the second one is obtained + * by setting [ azi1, azi2] = [−azi1, + * −azi2], S12 = − S12. (This occurs when + * lat2 is near −lat1 for prolate ellipsoids.) + *
  • + * Points 1 and 2 at opposite poles. There are infinitely many geodesics + * which can be generated by setting [azi1, azi2] = + * [azi1, azi2] + [d, −d], for arbitrary + * d. (For spheres, this prescription applies when points 1 and 2 are + * antipodal.) + *
  • + * s12 = 0 (coincident points). There are infinitely many geodesics which + * can be generated by setting [azi1, azi2] = [azi1, + * azi2] + [d, d], for arbitrary d. + *
+ *

+ * The calculations are accurate to better than 15 nm (15 nanometers) for the + * WGS84 ellipsoid. See Sec. 9 of + * arXiv:1102.1215v1 for + * details. The algorithms used by this class are based on series expansions + * using the flattening f as a small parameter. These are only accurate + * for |f| < 0.02; however reasonably accurate results will be + * obtained for |f| < 0.2. Here is a table of the approximate + * maximum error (expressed as a distance) for an ellipsoid with the same + * major radius as the WGS84 ellipsoid and different values of the + * flattening.

+ *     |f|      error
+ *     0.01     25 nm
+ *     0.02     30 nm
+ *     0.05     10 um
+ *     0.1     1.5 mm
+ *     0.2     300 mm 
+ *

+ * The algorithms are described in + *

+ *

+ * Example of use: + *

+ * {@code
+ * // Solve the direct geodesic problem.
+ *
+ * // This program reads in lines with lat1, lon1, azi1, s12 and prints
+ * // out lines with lat2, lon2, azi2 (for the WGS84 ellipsoid).
+ *
+ * import java.util.*;
+ * import net.sf.geographiclib.*;
+ * public class Direct {
+ *   public static void main(String[] args) {
+ *     try {
+ *       Scanner in = new Scanner(System.in);
+ *       double lat1, lon1, azi1, s12;
+ *       while (true) {
+ *         lat1 = in.nextDouble(); lon1 = in.nextDouble();
+ *         azi1 = in.nextDouble(); s12 = in.nextDouble();
+ *         GeodesicData g = Geodesic.WGS84.Direct(lat1, lon1, azi1, s12);
+ *         System.out.println(g.lat2 + " " + g.lon2 + " " + g.azi2);
+ *       }
+ *     }
+ *     catch (Exception e) {}
+ *   }
+ * }}
+ **********************************************************************/ +public class Geodesic { + + /** + * The order of the expansions used by Geodesic. + **********************************************************************/ + protected static final int GEOGRAPHICLIB_GEODESIC_ORDER = 6; + + protected static final int nA1_ = GEOGRAPHICLIB_GEODESIC_ORDER; + protected static final int nC1_ = GEOGRAPHICLIB_GEODESIC_ORDER; + protected static final int nC1p_ = GEOGRAPHICLIB_GEODESIC_ORDER; + protected static final int nA2_ = GEOGRAPHICLIB_GEODESIC_ORDER; + protected static final int nC2_ = GEOGRAPHICLIB_GEODESIC_ORDER; + protected static final int nA3_ = GEOGRAPHICLIB_GEODESIC_ORDER; + protected static final int nA3x_ = nA3_; + protected static final int nC3_ = GEOGRAPHICLIB_GEODESIC_ORDER; + protected static final int nC3x_ = (nC3_ * (nC3_ - 1)) / 2; + protected static final int nC4_ = GEOGRAPHICLIB_GEODESIC_ORDER; + protected static final int nC4x_ = (nC4_ * (nC4_ + 1)) / 2; + private static final int maxit1_ = 20; + private static final int maxit2_ = maxit1_ + GeoMath.digits + 10; + + // Underflow guard. We require + // tiny_ * epsilon() > 0 + // tiny_ + epsilon() == epsilon() + protected static final double tiny_ = Math.sqrt(GeoMath.min); + private static final double tol0_ = GeoMath.epsilon; + // Increase multiplier in defn of tol1_ from 100 to 200 to fix inverse case + // 52.784459512564 0 -52.784459512563990912 179.634407464943777557 + // which otherwise failed for Visual Studio 10 (Release and Debug) + private static final double tol1_ = 200 * tol0_; + private static final double tol2_ = Math.sqrt(tol0_); + // Check on bisection interval + private static final double tolb_ = tol0_ * tol2_; + private static final double xthresh_ = 1000 * tol2_; + + protected static double AngRound(double x) { + // The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^57 + // for reals = 0.7 pm on the earth if x is an angle in degrees. (This + // is about 1000 times more resolution than we get with angles around 90 + // degrees.) We use this to avoid having to deal with near singular + // cases when x is non-zero but tiny (e.g., 1.0e-200). + final double z = 1/16.0; + double y = Math.abs(x); + // The compiler mustn't "simplify" z - (z - y) to y + y = y < z ? z - (z - y) : y; + return x < 0 ? -y : y; + } + + protected static Pair SinCosNorm(double sinx, double cosx) { + double r = GeoMath.hypot(sinx, cosx); + return new Pair(sinx/r, cosx/r); + } + + protected double _a, _f, _f1, _e2, _ep2, _b, _c2; + private double _n, _etol2; + private double _A3x[], _C3x[], _C4x[]; + + /** + * Constructor for a ellipsoid with + *

+ * @param a equatorial radius (meters). + * @param f flattening of ellipsoid. Setting f = 0 gives a sphere. + * Negative f gives a prolate ellipsoid. If f > 1, set + * flattening to 1/f. + * @exception GeographicErr if a or (1 − f ) a is + * not positive. + **********************************************************************/ + public Geodesic(double a, double f) { + _a = a; + _f = f <= 1 ? f : 1/f; + _f1 = 1 - _f; + _e2 = _f * (2 - _f); + _ep2 = _e2 / GeoMath.sq(_f1); // e2 / (1 - e2) + _n = _f / ( 2 - _f); + _b = _a * _f1; + _c2 = (GeoMath.sq(_a) + GeoMath.sq(_b) * + (_e2 == 0 ? 1 : + (_e2 > 0 ? GeoMath.atanh(Math.sqrt(_e2)) : + Math.atan(Math.sqrt(-_e2))) / + Math.sqrt(Math.abs(_e2))))/2; // authalic radius squared + // The sig12 threshold for "really short". Using the auxiliary sphere + // solution with dnm computed at (bet1 + bet2) / 2, the relative error in + // the azimuth consistency check is sig12^2 * abs(f) * min(1, 1-f/2) / 2. + // (Error measured for 1/100 < b/a < 100 and abs(f) >= 1/1000. For a + // given f and sig12, the max error occurs for lines near the pole. If + // the old rule for computing dnm = (dn1 + dn2)/2 is used, then the error + // increases by a factor of 2.) Setting this equal to epsilon gives + // sig12 = etol2. Here 0.1 is a safety factor (error decreased by 100) + // and max(0.001, abs(f)) stops etol2 getting too large in the nearly + // spherical case. + _etol2 = 0.1 * tol2_ / + Math.sqrt( Math.max(0.001, Math.abs(_f)) * + Math.min(1.0, 1 - _f/2) / 2 ); + if (!(GeoMath.isfinite(_a) && _a > 0)) + throw new GeographicErr("Major radius is not positive"); + if (!(GeoMath.isfinite(_b) && _b > 0)) + throw new GeographicErr("Minor radius is not positive"); + _A3x = new double[nA3x_]; + _C3x = new double[nC3x_]; + _C4x = new double[nC4x_]; + + A3coeff(); + C3coeff(); + C4coeff(); + } + + /** + * Solve the direct geodesic problem where the length of the geodesic + * is specified in terms of distance. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + * @param s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @return a {@link GeodesicData} object with the following fields: + * lat1, lon1, azi1, lat2, lon2, + * azi2, s12, a12. + *

+ * lat1 should be in the range [−90°, 90°]; lon1 + * and azi1 should be in the range [−540°, 540°). The + * values of lon2 and azi2 returned are in the range + * [−180°, 180°). + *

+ * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + **********************************************************************/ + public GeodesicData Direct(double lat1, double lon1, + double azi1, double s12) { + return Direct(lat1, lon1, azi1, false, s12, + GeodesicMask.LATITUDE | GeodesicMask.LONGITUDE | + GeodesicMask.AZIMUTH); + } + /** + * Solve the direct geodesic problem where the length of the geodesic is + * specified in terms of distance and with a subset of the geodesic results + * returned. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + * @param s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @param outmask a bitor'ed combination of {@link GeodesicMask} values + * specifying which results should be returned. + * @return a {@link GeodesicData} object with the fields specified by + * outmask computed. + *

+ * lat1, lon1, azi1, s12, and a12 are + * always included in the returned result. + **********************************************************************/ + public GeodesicData Direct(double lat1, double lon1, + double azi1, double s12, int outmask) { + return Direct(lat1, lon1, azi1, false, s12, outmask); + } + + /** + * Solve the direct geodesic problem where the length of the geodesic + * is specified in terms of arc length. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + * @param a12 arc length between point 1 and point 2 (degrees); it can + * be negative. + * @return a {@link GeodesicData} object with the following fields: + * lat1, lon1, azi1, lat2, lon2, + * azi2, s12, a12. + *

+ * lat1 should be in the range [−90°, 90°]; lon1 + * and azi1 should be in the range [−540°, 540°). The + * values of lon2 and azi2 returned are in the range + * [−180°, 180°). + *

+ * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing lat = ±(90° − ε), + * and taking the limit ε → 0+. An arc length greater that + * 180° signifies a geodesic which is not a shortest path. (For a + * prolate ellipsoid, an additional condition is necessary for a shortest + * path: the longitudinal extent must not exceed of 180°.) + **********************************************************************/ + public GeodesicData ArcDirect(double lat1, double lon1, + double azi1, double a12) { + return Direct(lat1, lon1, azi1, true, a12, + GeodesicMask.LATITUDE | GeodesicMask.LONGITUDE | + GeodesicMask.AZIMUTH | GeodesicMask.DISTANCE); + } + + /** + * Solve the direct geodesic problem where the length of the geodesic is + * specified in terms of arc length and with a subset of the geodesic results + * returned. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + * @param a12 arc length between point 1 and point 2 (degrees); it can + * be negative. + * @param outmask a bitor'ed combination of {@link GeodesicMask} values + * specifying which results should be returned. + * @return a {@link GeodesicData} object with the fields specified by + * outmask computed. + *

+ * lat1, lon1, azi1, and a12 are always included + * in the returned result. + **********************************************************************/ + public GeodesicData ArcDirect(double lat1, double lon1, + double azi1, double a12, int outmask) { + return Direct(lat1, lon1, azi1, true, a12, outmask); + } + + /** + * The general direct geodesic problem. {@link #Direct Direct} and + * {@link #ArcDirect ArcDirect} are defined in terms of this function. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + * @param arcmode boolean flag determining the meaning of the + * s12_a12. + * @param s12_a12 if arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be negative. + * @param outmask a bitor'ed combination of {@link GeodesicMask} values + * specifying which results should be returned. + * @return a {@link GeodesicData} object with the fields specified by + * outmask computed. + *

+ * The {@link GeodesicMask} values possible for outmask are + *

    + *
  • + * outmask |= GeodesicMask.LATITUDE for the latitude lat2; + *
  • + * outmask |= GeodesicMask.LONGITUDE for the latitude lon2; + *
  • + * outmask |= GeodesicMask.AZIMUTH for the latitude azi2; + *
  • + * outmask |= GeodesicMask.DISTANCE for the distance s12; + *
  • + * outmask |= GeodesicMask.REDUCEDLENGTH for the reduced length + * m12; + *
  • + * outmask |= GeodesicMask.GEODESICSCALE for the geodesic scales + * M12 and M21; + *
  • + * outmask |= GeodesicMask.AREA for the area S12; + *
  • + * outmask |= GeodesicMask.ALL for all of the above. + *
+ *

+ * The function value a12 is always computed and returned and this + * equals s12_a12 is arcmode is true. If outmask + * includes {@link GeodesicMask#DISTANCE} and arcmode is false, then + * s12 = s12_a12. It is not necessary to include {@link + * GeodesicMask#DISTANCE_IN} in outmask; this is automatically + * included is arcmode is false. + **********************************************************************/ + public GeodesicData Direct(double lat1, double lon1, double azi1, + boolean arcmode, double s12_a12, int outmask) { + return new GeodesicLine(this, lat1, lon1, azi1, + // Automatically supply DISTANCE_IN if necessary + outmask | (arcmode ? GeodesicMask.NONE : + GeodesicMask.DISTANCE_IN)) + . // Note the dot! + Position(arcmode, s12_a12, outmask); + } + + /** + * Solve the inverse geodesic problem. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param lat2 latitude of point 2 (degrees). + * @param lon2 longitude of point 2 (degrees). + * @return a {@link GeodesicData} object with the following fields: + * lat1, lon1, azi1, lat2, lon2, + * azi2, s12, a12. + *

+ * lat1 and lat2 should be in the range [−90°, + * 90°]; lon1 and lon2 should be in the range + * [−540°, 540°). The values of azi1 and azi2 + * returned are in the range [−180°, 180°). + *

+ * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing lat = ±(90° − ε), + * taking the limit ε → 0+. + *

+ * The solution to the inverse problem is found using Newton's method. If + * this fails to converge (this is very unlikely in geodetic applications + * but does occur for very eccentric ellipsoids), then the bisection method + * is used to refine the solution. + **********************************************************************/ + public GeodesicData Inverse(double lat1, double lon1, + double lat2, double lon2) { + return Inverse(lat1, lon1, lat2, lon2, + GeodesicMask.DISTANCE | GeodesicMask.AZIMUTH); + } + + /** + * Solve the inverse geodesic problem with a subset of the geodesic results + * returned. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param lat2 latitude of point 2 (degrees). + * @param lon2 longitude of point 2 (degrees). + * @param outmask a bitor'ed combination of {@link GeodesicMask} values + * specifying which results should be returned. + * @return a {@link GeodesicData} object with the fields specified by + * outmask computed. + *

+ * The {@link GeodesicMask} values possible for outmask are + *

    + *
  • + * outmask |= GeodesicMask.DISTANCE for the distance s12; + *
  • + * outmask |= GeodesicMask.AZIMUTH for the latitude azi2; + *
  • + * outmask |= GeodesicMask.REDUCEDLENGTH for the reduced length + * m12; + *
  • + * outmask |= GeodesicMask.GEODESICSCALE for the geodesic scales + * M12 and M21; + *
  • + * outmask |= GeodesicMask.AREA for the area S12; + *
  • + * outmask |= GeodesicMask.ALL for all of the above. + *
+ *

+ * lat1, lon1, lat2, lon2, and a12 are + * always included in the returned result. + **********************************************************************/ + public GeodesicData Inverse(double lat1, double lon1, + double lat2, double lon2, int outmask) { + outmask &= GeodesicMask.OUT_ALL; + GeodesicData r = new GeodesicData(); + lon1 = GeoMath.AngNormalize(lon1); + lon2 = GeoMath.AngNormalize(lon2); + // Compute longitude difference (AngDiff does this carefully). Result is + // in [-180, 180] but -180 is only for west-going geodesics. 180 is for + // east-going and meridional geodesics. + double lon12 = GeoMath.AngDiff(lon1, lon2); + // If very close to being on the same half-meridian, then make it so. + lon12 = AngRound(lon12); + // Make longitude difference positive. + int lonsign = lon12 >= 0 ? 1 : -1; + lon12 *= lonsign; + // If really close to the equator, treat as on equator. + lat1 = AngRound(lat1); + lat2 = AngRound(lat2); + // Save input parameters post normalization + r.lat1 = lat1; r.lon1 = lon1; r.lat2 = lat2; r.lon2 = lon2; + // Swap points so that point with higher (abs) latitude is point 1 + int swapp = Math.abs(lat1) >= Math.abs(lat2) ? 1 : -1; + if (swapp < 0) { + lonsign *= -1; + { double t = lat1; lat1 = lat2; lat2 = t; } + } + // Make lat1 <= 0 + int latsign = lat1 < 0 ? 1 : -1; + lat1 *= latsign; + lat2 *= latsign; + // Now we have + // + // 0 <= lon12 <= 180 + // -90 <= lat1 <= 0 + // lat1 <= lat2 <= -lat1 + // + // longsign, swapp, latsign register the transformation to bring the + // coordinates to this canonical form. In all cases, 1 means no change was + // made. We make these transformations so that there are few cases to + // check, e.g., on verifying quadrants in atan2. In addition, this + // enforces some symmetries in the results returned. + + double phi, sbet1, cbet1, sbet2, cbet2, s12x, m12x; + s12x = m12x = Double.NaN; + + phi = lat1 * GeoMath.degree; + // Ensure cbet1 = +epsilon at poles + sbet1 = _f1 * Math.sin(phi); + cbet1 = lat1 == -90 ? tiny_ : Math.cos(phi); + { Pair p = SinCosNorm(sbet1, cbet1); + sbet1 = p.first; cbet1 = p.second; } + + phi = lat2 * GeoMath.degree; + // Ensure cbet2 = +epsilon at poles + sbet2 = _f1 * Math.sin(phi); + cbet2 = Math.abs(lat2) == 90 ? tiny_ : Math.cos(phi); + { Pair p = SinCosNorm(sbet2, cbet2); + sbet2 = p.first; cbet2 = p.second; } + + // If cbet1 < -sbet1, then cbet2 - cbet1 is a sensitive measure of the + // |bet1| - |bet2|. Alternatively (cbet1 >= -sbet1), abs(sbet2) + sbet1 is + // a better measure. This logic is used in assigning calp2 in Lambda12. + // Sometimes these quantities vanish and in that case we force bet2 = +/- + // bet1 exactly. An example where is is necessary is the inverse problem + // 48.522876735459 0 -48.52287673545898293 179.599720456223079643 + // which failed with Visual Studio 10 (Release and Debug) + + if (cbet1 < -sbet1) { + if (cbet2 == cbet1) + sbet2 = sbet2 < 0 ? sbet1 : -sbet1; + } else { + if (Math.abs(sbet2) == -sbet1) + cbet2 = cbet1; + } + + double + dn1 = Math.sqrt(1 + _ep2 * GeoMath.sq(sbet1)), + dn2 = Math.sqrt(1 + _ep2 * GeoMath.sq(sbet2)); + + double + lam12 = lon12 * GeoMath.degree, + slam12 = Math.abs(lon12) == 180 ? 0 : Math.sin(lam12), + clam12 = Math.cos(lam12); // lon12 == 90 isn't interesting + + double a12, sig12, calp1, salp1, calp2, salp2; + a12 = sig12 = calp1 = salp1 = calp2 = salp2 = Double.NaN; + // index zero elements of these arrays are unused + double C1a[] = new double[nC1_ + 1]; + double C2a[] = new double[nC2_ + 1]; + double C3a[] = new double[nC3_]; + + boolean meridian = lat1 == -90 || slam12 == 0; + + if (meridian) { + + // Endpoints are on a single full meridian, so the geodesic might lie on + // a meridian. + + calp1 = clam12; salp1 = slam12; // Head to the target longitude + calp2 = 1; salp2 = 0; // At the target we're heading north + + double + // tan(bet) = tan(sig) * cos(alp) + ssig1 = sbet1, csig1 = calp1 * cbet1, + ssig2 = sbet2, csig2 = calp2 * cbet2; + + // sig12 = sig2 - sig1 + sig12 = Math.atan2(Math.max(csig1 * ssig2 - ssig1 * csig2, 0.0), + csig1 * csig2 + ssig1 * ssig2); + { + LengthsV v = + Lengths(_n, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, + cbet1, cbet2, + (outmask & GeodesicMask.GEODESICSCALE) != 0, C1a, C2a); + s12x = v.s12b; m12x = v.m12b; + if ((outmask & GeodesicMask.GEODESICSCALE) != 0) { + r.M12 = v.M12; r.M21 = v.M21; + } + } + // Add the check for sig12 since zero length geodesics might yield m12 < + // 0. Test case was + // + // echo 20.001 0 20.001 0 | GeodSolve -i + // + // In fact, we will have sig12 > pi/2 for meridional geodesic which is + // not a shortest path. + if (sig12 < 1 || m12x >= 0) { + m12x *= _b; + s12x *= _b; + a12 = sig12 / GeoMath.degree; + } else + // m12 < 0, i.e., prolate and too close to anti-podal + meridian = false; + } + + double omg12 = Double.NaN; + if (!meridian && + sbet1 == 0 && // and sbet2 == 0 + // Mimic the way Lambda12 works with calp1 = 0 + (_f <= 0 || lam12 <= Math.PI - _f * Math.PI)) { + + // Geodesic runs along equator + calp1 = calp2 = 0; salp1 = salp2 = 1; + s12x = _a * lam12; + sig12 = omg12 = lam12 / _f1; + m12x = _b * Math.sin(sig12); + if ((outmask & GeodesicMask.GEODESICSCALE) != 0) + r.M12 = r.M21 = Math.cos(sig12); + a12 = lon12 / _f1; + + } else if (!meridian) { + + // Now point1 and point2 belong within a hemisphere bounded by a + // meridian and geodesic is neither meridional or equatorial. + + // Figure a starting point for Newton's method + double dnm; + { + InverseStartV v = + InverseStart(sbet1, cbet1, dn1, sbet2, cbet2, dn2, + lam12, + C1a, C2a); + sig12 = v.sig12; + salp1 = v.salp1; calp1 = v.calp1; + salp2 = v.salp2; calp2 = v.calp2; + dnm = v.dnm; + } + + if (sig12 >= 0) { + // Short lines (InverseStart sets salp2, calp2, dnm) + s12x = sig12 * _b * dnm; + m12x = GeoMath.sq(dnm) * _b * Math.sin(sig12 / dnm); + if ((outmask & GeodesicMask.GEODESICSCALE) != 0) + r.M12 = r.M21 = Math.cos(sig12 / dnm); + a12 = sig12 / GeoMath.degree; + omg12 = lam12 / (_f1 * dnm); + } else { + + // Newton's method. This is a straightforward solution of f(alp1) = + // lambda12(alp1) - lam12 = 0 with one wrinkle. f(alp) has exactly one + // root in the interval (0, pi) and its derivative is positive at the + // root. Thus f(alp) is positive for alp > alp1 and negative for alp < + // alp1. During the course of the iteration, a range (alp1a, alp1b) is + // maintained which brackets the root and with each evaluation of + // f(alp) the range is shrunk, if possible. Newton's method is + // restarted whenever the derivative of f is negative (because the new + // value of alp1 is then further from the solution) or if the new + // estimate of alp1 lies outside (0,pi); in this case, the new starting + // guess is taken to be (alp1a + alp1b) / 2. + double ssig1, csig1, ssig2, csig2, eps; + ssig1 = csig1 = ssig2 = csig2 = eps = Double.NaN; + int numit = 0; + // Bracketing range + double salp1a = tiny_, calp1a = 1, salp1b = tiny_, calp1b = -1; + for (boolean tripn = false, tripb = false; numit < maxit2_; ++numit) { + // the WGS84 test set: mean = 1.47, sd = 1.25, max = 16 + // WGS84 and random input: mean = 2.85, sd = 0.60 + double v, dv; + { + Lambda12V w = + Lambda12(sbet1, cbet1, dn1, sbet2, cbet2, dn2, salp1, calp1, + numit < maxit1_, C1a, C2a, C3a); + v = w.lam12 - lam12; + salp2 = w.salp2; calp2 = w.calp2; + sig12 = w.sig12; + ssig1 = w.ssig1; csig1 = w.csig1; + ssig2 = w.ssig2; csig2 = w.csig2; + eps = w.eps; omg12 = w.domg12; + dv = w.dlam12; + } + // 2 * tol0 is approximately 1 ulp for a number in [0, pi]. + // Reversed test to allow escape with NaNs + if (tripb || !(Math.abs(v) >= (tripn ? 8 : 2) * tol0_)) break; + // Update bracketing values + if (v > 0 && (numit > maxit1_ || calp1/salp1 > calp1b/salp1b)) + { salp1b = salp1; calp1b = calp1; } + else if (v < 0 && (numit > maxit1_ || calp1/salp1 < calp1a/salp1a)) + { salp1a = salp1; calp1a = calp1; } + if (numit < maxit1_ && dv > 0) { + double + dalp1 = -v/dv; + double + sdalp1 = Math.sin(dalp1), cdalp1 = Math.cos(dalp1), + nsalp1 = salp1 * cdalp1 + calp1 * sdalp1; + if (nsalp1 > 0 && Math.abs(dalp1) < Math.PI) { + calp1 = calp1 * cdalp1 - salp1 * sdalp1; + salp1 = nsalp1; + { Pair p = SinCosNorm(salp1, calp1); + salp1 = p.first; calp1 = p.second; } + // In some regimes we don't get quadratic convergence because + // slope -> 0. So use convergence conditions based on epsilon + // instead of sqrt(epsilon). + tripn = Math.abs(v) <= 16 * tol0_; + continue; + } + } + // Either dv was not postive or updated value was outside legal + // range. Use the midpoint of the bracket as the next estimate. + // This mechanism is not needed for the WGS84 ellipsoid, but it does + // catch problems with more eccentric ellipsoids. Its efficacy is + // such for the WGS84 test set with the starting guess set to alp1 = + // 90deg: + // the WGS84 test set: mean = 5.21, sd = 3.93, max = 24 + // WGS84 and random input: mean = 4.74, sd = 0.99 + salp1 = (salp1a + salp1b)/2; + calp1 = (calp1a + calp1b)/2; + { Pair p = SinCosNorm(salp1, calp1); + salp1 = p.first; calp1 = p.second; } + tripn = false; + tripb = (Math.abs(salp1a - salp1) + (calp1a - calp1) < tolb_ || + Math.abs(salp1 - salp1b) + (calp1 - calp1b) < tolb_); + } + { + LengthsV v = + Lengths(eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, + cbet1, cbet2, + (outmask & GeodesicMask.GEODESICSCALE) != 0, C1a, C2a); + s12x = v.s12b; m12x = v.m12b; + if ((outmask & GeodesicMask.GEODESICSCALE) != 0) { + r.M12 = v.M12; r.M21 = v.M21; + } + } + m12x *= _b; + s12x *= _b; + a12 = sig12 / GeoMath.degree; + omg12 = lam12 - omg12; + } + } + + if ((outmask & GeodesicMask.DISTANCE) != 0) + r.s12 = 0 + s12x; // Convert -0 to 0 + + if ((outmask & GeodesicMask.REDUCEDLENGTH) != 0) + r.m12 = 0 + m12x; // Convert -0 to 0 + + if ((outmask & GeodesicMask.AREA) != 0) { + double + // From Lambda12: sin(alp1) * cos(bet1) = sin(alp0) + salp0 = salp1 * cbet1, + calp0 = GeoMath.hypot(calp1, salp1 * sbet1); // calp0 > 0 + double alp12; + if (calp0 != 0 && salp0 != 0) { + double + // From Lambda12: tan(bet) = tan(sig) * cos(alp) + ssig1 = sbet1, csig1 = calp1 * cbet1, + ssig2 = sbet2, csig2 = calp2 * cbet2, + k2 = GeoMath.sq(calp0) * _ep2, + eps = k2 / (2 * (1 + Math.sqrt(1 + k2)) + k2), + // Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0). + A4 = GeoMath.sq(_a) * calp0 * salp0 * _e2; + { Pair p = SinCosNorm(ssig1, csig1); + ssig1 = p.first; csig1 = p.second; } + { Pair p = SinCosNorm(ssig2, csig2); + ssig2 = p.first; csig2 = p.second; } + double C4a[] = new double[nC4_]; + C4f(eps, C4a); + double + B41 = SinCosSeries(false, ssig1, csig1, C4a), + B42 = SinCosSeries(false, ssig2, csig2, C4a); + r.S12 = A4 * (B42 - B41); + } else + // Avoid problems with indeterminate sig1, sig2 on equator + r.S12 = 0; + + if (!meridian && + omg12 < 0.75 * Math.PI && // Long difference too big + sbet2 - sbet1 < 1.75) { // Lat difference too big + // Use tan(Gamma/2) = tan(omg12/2) + // * (tan(bet1/2)+tan(bet2/2))/(1+tan(bet1/2)*tan(bet2/2)) + // with tan(x/2) = sin(x)/(1+cos(x)) + double + somg12 = Math.sin(omg12), domg12 = 1 + Math.cos(omg12), + dbet1 = 1 + cbet1, dbet2 = 1 + cbet2; + alp12 = 2 * Math.atan2( somg12 * ( sbet1 * dbet2 + sbet2 * dbet1 ), + domg12 * ( sbet1 * sbet2 + dbet1 * dbet2 ) ); + } else { + // alp12 = alp2 - alp1, used in atan2 so no need to normalize + double + salp12 = salp2 * calp1 - calp2 * salp1, + calp12 = calp2 * calp1 + salp2 * salp1; + // The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz + // salp12 = -0 and alp12 = -180. However this depends on the sign + // being attached to 0 correctly. The following ensures the correct + // behavior. + if (salp12 == 0 && calp12 < 0) { + salp12 = tiny_ * calp1; + calp12 = -1; + } + alp12 = Math.atan2(salp12, calp12); + } + r.S12 += _c2 * alp12; + r.S12 *= swapp * lonsign * latsign; + // Convert -0 to 0 + r.S12 += 0; + } + + // Convert calp, salp to azimuth accounting for lonsign, swapp, latsign. + if (swapp < 0) { + { double t = salp1; salp1 = salp2; salp2 = t; } + { double t = calp1; calp1 = calp2; calp2 = t; } + if ((outmask & GeodesicMask.GEODESICSCALE) != 0) + { double t = r.M12; r.M12 = r.M21; r.M21 = t; } + } + + salp1 *= swapp * lonsign; calp1 *= swapp * latsign; + salp2 *= swapp * lonsign; calp2 *= swapp * latsign; + + if ((outmask & GeodesicMask.AZIMUTH) != 0) { + // minus signs give range [-180, 180). 0- converts -0 to +0. + r.azi1 = 0 - Math.atan2(-salp1, calp1) / GeoMath.degree; + r.azi2 = 0 - Math.atan2(-salp2, calp2) / GeoMath.degree; + } + // Returned value in [0, 180] + r.a12 = a12; + return r; + } + + /** + * Set up to compute several points on a single geodesic. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + * @return a {@link GeodesicLine} object. + *

+ * lat1 should be in the range [−90°, 90°]; lon1 + * and azi1 should be in the range [−540°, 540°). The + * full set of capabilities is included. + *

+ * If the point is at a pole, the azimuth is defined by keeping the + * lon1 fixed, writing lat1 = ±(90 − ε), + * taking the limit ε → 0+. + **********************************************************************/ + public GeodesicLine Line(double lat1, double lon1, double azi1) { + return Line(lat1, lon1, azi1, GeodesicMask.ALL); + } + /** + * Set up to compute several points on a single geodesic with a subset of the + * capabilities included. + *

+ * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + * @param caps bitor'ed combination of {@link GeodesicMask} values specifying + * the capabilities the {@link GeodesicLine} object should possess, i.e., + * which quantities can be returned in calls to {@link + * GeodesicLine#Position GeodesicLine.Position}. + * @return a {@link GeodesicLine} object. + *

+ * The {@link GeodesicMask} values are + *

    + *
  • + * caps |= GeodesicMask.LATITUDE for the latitude lat2; this + * is added automatically; + *
  • + * caps |= GeodesicMask.LONGITUDE for the latitude lon2; + *
  • + * caps |= GeodesicMask.AZIMUTH for the azimuth azi2; this is + * added automatically; + *
  • + * caps |= GeodesicMask.DISTANCE for the distance s12; + *
  • + * caps |= GeodesicMask.REDUCEDLENGTH for the reduced length + * m12; + *
  • + * caps |= GeodesicMask.GEODESICSCALE for the geodesic scales + * M12 and M21; + *
  • + * caps |= GeodesicMask.AREA for the area S12; + *
  • + * caps |= GeodesicMask.DISTANCE_IN permits the length of the + * geodesic to be given in terms of s12; without this capability the + * length can only be specified in terms of arc length; + *
  • + * caps |= GeodesicMask.ALL for all of the above. + *
+ *

+ * If the point is at a pole, the azimuth is defined by keeping lon1 + * fixed, writing lat1 = ±(90 − ε), and taking + * the limit ε → 0+. + **********************************************************************/ + public GeodesicLine Line(double lat1, double lon1, double azi1, int caps) { + return new GeodesicLine(this, lat1, lon1, azi1, caps); + } + + /** + * @return a the equatorial radius of the ellipsoid (meters). This is + * the value used in the constructor. + **********************************************************************/ + public double MajorRadius() { return _a; } + + /** + * @return f the flattening of the ellipsoid. This is the + * value used in the constructor. + **********************************************************************/ + public double Flattening() { return _f; } + + /** + * @return total area of ellipsoid in meters2. The area of a + * polygon encircling a pole can be found by adding EllipsoidArea()/2 to + * the sum of S12 for each side of the polygon. + **********************************************************************/ + public double EllipsoidArea() { return 4 * Math.PI * _c2; } + + /** + * A global instantiation of Geodesic with the parameters for the WGS84 + * ellipsoid. + **********************************************************************/ + public static final Geodesic WGS84 = + new Geodesic(Constants.WGS84_a, Constants.WGS84_f); + + // This is a reformulation of the geodesic problem. The notation is as + // follows: + // - at a general point (no suffix or 1 or 2 as suffix) + // - phi = latitude + // - beta = latitude on auxiliary sphere + // - omega = longitude on auxiliary sphere + // - lambda = longitude + // - alpha = azimuth of great circle + // - sigma = arc length along great circle + // - s = distance + // - tau = scaled distance (= sigma at multiples of pi/2) + // - at northwards equator crossing + // - beta = phi = 0 + // - omega = lambda = 0 + // - alpha = alpha0 + // - sigma = s = 0 + // - a 12 suffix means a difference, e.g., s12 = s2 - s1. + // - s and c prefixes mean sin and cos + + protected static double SinCosSeries(boolean sinp, + double sinx, double cosx, + double c[]) { + // Evaluate + // y = sinp ? sum(c[i] * sin( 2*i * x), i, 1, n) : + // sum(c[i] * cos((2*i+1) * x), i, 0, n-1) + // using Clenshaw summation. N.B. c[0] is unused for sin series + // Approx operation count = (n + 5) mult and (2 * n + 2) add + int k = c.length, n = k - (sinp ? 1 : 0); + double + ar = 2 * (cosx - sinx) * (cosx + sinx), // 2 * cos(2 * x) + y0 = (n & 1) != 0 ? c[--k] : 0, y1 = 0; // accumulators for sum + // Now n is even + n /= 2; + while (n-- != 0) { + // Unroll loop x 2, so accumulators return to their original role + y1 = ar * y0 - y1 + c[--k]; + y0 = ar * y1 - y0 + c[--k]; + } + return sinp + ? 2 * sinx * cosx * y0 // sin(2 * x) * y0 + : cosx * (y0 - y1); // cos(x) * (y0 - y1) + } + + private class LengthsV { + private double s12b, m12b, m0, M12, M21; + private LengthsV() { + s12b = m12b = m0 = M12 = M21 = Double.NaN; + } + } + + private LengthsV Lengths(double eps, double sig12, + double ssig1, double csig1, double dn1, + double ssig2, double csig2, double dn2, + double cbet1, double cbet2, + boolean scalep, + // Scratch areas of the right size + double C1a[], double C2a[]) { + // Return m12b = (reduced length)/_b; also calculate s12b = distance/_b, + // and m0 = coefficient of secular term in expression for reduced length. + LengthsV v = new LengthsV(); // To hold s12b, m12b, m0, M12, M21; + C1f(eps, C1a); + C2f(eps, C2a); + double + A1m1 = A1m1f(eps), + AB1 = (1 + A1m1) * (SinCosSeries(true, ssig2, csig2, C1a) - + SinCosSeries(true, ssig1, csig1, C1a)), + A2m1 = A2m1f(eps), + AB2 = (1 + A2m1) * (SinCosSeries(true, ssig2, csig2, C2a) - + SinCosSeries(true, ssig1, csig1, C2a)); + v.m0 = A1m1 - A2m1; + double J12 = v.m0 * sig12 + (AB1 - AB2); + // Missing a factor of _b. + // Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure accurate + // cancellation in the case of coincident points. + v.m12b = dn2 * (csig1 * ssig2) - dn1 * (ssig1 * csig2) - + csig1 * csig2 * J12; + // Missing a factor of _b + v.s12b = (1 + A1m1) * sig12 + AB1; + if (scalep) { + double csig12 = csig1 * csig2 + ssig1 * ssig2; + double t = _ep2 * (cbet1 - cbet2) * (cbet1 + cbet2) / (dn1 + dn2); + v.M12 = csig12 + (t * ssig2 - csig2 * J12) * ssig1 / dn1; + v.M21 = csig12 - (t * ssig1 - csig1 * J12) * ssig2 / dn2; + } + return v; + } + + private static double Astroid(double x, double y) { + // Solve k^4+2*k^3-(x^2+y^2-1)*k^2-2*y^2*k-y^2 = 0 for positive root k. + // This solution is adapted from Geocentric::Reverse. + double k; + double + p = GeoMath.sq(x), + q = GeoMath.sq(y), + r = (p + q - 1) / 6; + if ( !(q == 0 && r <= 0) ) { + double + // Avoid possible division by zero when r = 0 by multiplying equations + // for s and t by r^3 and r, resp. + S = p * q / 4, // S = r^3 * s + r2 = GeoMath.sq(r), + r3 = r * r2, + // The discrimant of the quadratic equation for T3. This is zero on + // the evolute curve p^(1/3)+q^(1/3) = 1 + disc = S * (S + 2 * r3); + double u = r; + if (disc >= 0) { + double T3 = S + r3; + // Pick the sign on the sqrt to maximize abs(T3). This minimizes loss + // of precision due to cancellation. The result is unchanged because + // of the way the T is used in definition of u. + T3 += T3 < 0 ? -Math.sqrt(disc) : Math.sqrt(disc); // T3 = (r * t)^3 + // N.B. cbrt always returns the double root. cbrt(-8) = -2. + double T = GeoMath.cbrt(T3); // T = r * t + // T can be zero; but then r2 / T -> 0. + u += T + (T != 0 ? r2 / T : 0); + } else { + // T is complex, but the way u is defined the result is double. + double ang = Math.atan2(Math.sqrt(-disc), -(S + r3)); + // There are three possible cube roots. We choose the root which + // avoids cancellation. Note that disc < 0 implies that r < 0. + u += 2 * r * Math.cos(ang / 3); + } + double + v = Math.sqrt(GeoMath.sq(u) + q), // guaranteed positive + // Avoid loss of accuracy when u < 0. + uv = u < 0 ? q / (v - u) : u + v, // u+v, guaranteed positive + w = (uv - q) / (2 * v); // positive? + // Rearrange expression for k to avoid loss of accuracy due to + // subtraction. Division by 0 not possible because uv > 0, w >= 0. + k = uv / (Math.sqrt(uv + GeoMath.sq(w)) + w); // guaranteed positive + } else { // q == 0 && r <= 0 + // y = 0 with |x| <= 1. Handle this case directly. + // for y small, positive root is k = abs(y)/sqrt(1-x^2) + k = 0; + } + return k; + } + + private class InverseStartV { + private double sig12, salp1, calp1, + // Only updated if return val >= 0 + salp2, calp2, + // Only updated for short lines + dnm; + private InverseStartV() { + sig12 = salp1 = calp1 = salp2 = calp2 = dnm = Double.NaN; + } + } + + private InverseStartV InverseStart(double sbet1, double cbet1, double dn1, + double sbet2, double cbet2, double dn2, + double lam12, + // Scratch areas of the right size + double C1a[], double C2a[]) { + // Return a starting point for Newton's method in salp1 and calp1 (function + // value is -1). If Newton's method doesn't need to be used, return also + // salp2 and calp2 and function value is sig12. + + // To hold sig12, salp1, calp1, salp2, calp2, dnm. + InverseStartV w = new InverseStartV(); + w.sig12 = -1; // Return value + double + // bet12 = bet2 - bet1 in [0, pi); bet12a = bet2 + bet1 in (-pi, 0] + sbet12 = sbet2 * cbet1 - cbet2 * sbet1, + cbet12 = cbet2 * cbet1 + sbet2 * sbet1; + double sbet12a = sbet2 * cbet1 + cbet2 * sbet1; + boolean shortline = cbet12 >= 0 && sbet12 < 0.5 && + cbet2 * lam12 < 0.5; + double omg12 = lam12; + if (shortline) { + double sbetm2 = GeoMath.sq(sbet1 + sbet2); + // sin((bet1+bet2)/2)^2 + // = (sbet1 + sbet2)^2 / ((sbet1 + sbet2)^2 + (cbet1 + cbet2)^2) + sbetm2 /= sbetm2 + GeoMath.sq(cbet1 + cbet2); + w.dnm = Math.sqrt(1 + _ep2 * sbetm2); + omg12 /= _f1 * w.dnm; + } + double somg12 = Math.sin(omg12), comg12 = Math.cos(omg12); + + w.salp1 = cbet2 * somg12; + w.calp1 = comg12 >= 0 ? + sbet12 + cbet2 * sbet1 * GeoMath.sq(somg12) / (1 + comg12) : + sbet12a - cbet2 * sbet1 * GeoMath.sq(somg12) / (1 - comg12); + + double + ssig12 = GeoMath.hypot(w.salp1, w.calp1), + csig12 = sbet1 * sbet2 + cbet1 * cbet2 * comg12; + + if (shortline && ssig12 < _etol2) { + // really short lines + w.salp2 = cbet1 * somg12; + w.calp2 = sbet12 - cbet1 * sbet2 * + (comg12 >= 0 ? GeoMath.sq(somg12) / (1 + comg12) : 1 - comg12); + { Pair p = SinCosNorm(w.salp2, w.calp2); + w.salp2 = p.first; w.calp2 = p.second; } + // Set return value + w.sig12 = Math.atan2(ssig12, csig12); + } else if (Math.abs(_n) > 0.1 || // Skip astroid calc if too eccentric + csig12 >= 0 || + ssig12 >= 6 * Math.abs(_n) * Math.PI * GeoMath.sq(cbet1)) { + // Nothing to do, zeroth order spherical approximation is OK + } else { + // Scale lam12 and bet2 to x, y coordinate system where antipodal point + // is at origin and singular point is at y = 0, x = -1. + double y, lamscale, betscale; + // In C++ volatile declaration needed to fix inverse case + // 56.320923501171 0 -56.320923501171 179.664747671772880215 + // which otherwise fails with g++ 4.4.4 x86 -O3 + double x; + if (_f >= 0) { // In fact f == 0 does not get here + // x = dlong, y = dlat + { + double + k2 = GeoMath.sq(sbet1) * _ep2, + eps = k2 / (2 * (1 + Math.sqrt(1 + k2)) + k2); + lamscale = _f * cbet1 * A3f(eps) * Math.PI; + } + betscale = lamscale * cbet1; + + x = (lam12 - Math.PI) / lamscale; + y = sbet12a / betscale; + } else { // _f < 0 + // x = dlat, y = dlong + double + cbet12a = cbet2 * cbet1 - sbet2 * sbet1, + bet12a = Math.atan2(sbet12a, cbet12a); + double m12b, m0; + // In the case of lon12 = 180, this repeats a calculation made in + // Inverse. + LengthsV v = + Lengths(_n, Math.PI + bet12a, + sbet1, -cbet1, dn1, sbet2, cbet2, dn2, + cbet1, cbet2, false, C1a, C2a); + m12b = v.m12b; m0 = v.m0; + + x = -1 + m12b / (cbet1 * cbet2 * m0 * Math.PI); + betscale = x < -0.01 ? sbet12a / x : + -_f * GeoMath.sq(cbet1) * Math.PI; + lamscale = betscale / cbet1; + y = (lam12 - Math.PI) / lamscale; + } + + if (y > -tol1_ && x > -1 - xthresh_) { + // strip near cut + if (_f >= 0) { + w.salp1 = Math.min(1.0, -x); + w.calp1 = - Math.sqrt(1 - GeoMath.sq(w.salp1)); + } else { + w.calp1 = Math.max(x > -tol1_ ? 0.0 : -1.0, x); + w.salp1 = Math.sqrt(1 - GeoMath.sq(w.calp1)); + } + } else { + // Estimate alp1, by solving the astroid problem. + // + // Could estimate alpha1 = theta + pi/2, directly, i.e., + // calp1 = y/k; salp1 = -x/(1+k); for _f >= 0 + // calp1 = x/(1+k); salp1 = -y/k; for _f < 0 (need to check) + // + // However, it's better to estimate omg12 from astroid and use + // spherical formula to compute alp1. This reduces the mean number of + // Newton iterations for astroid cases from 2.24 (min 0, max 6) to 2.12 + // (min 0 max 5). The changes in the number of iterations are as + // follows: + // + // change percent + // 1 5 + // 0 78 + // -1 16 + // -2 0.6 + // -3 0.04 + // -4 0.002 + // + // The histogram of iterations is (m = number of iterations estimating + // alp1 directly, n = number of iterations estimating via omg12, total + // number of trials = 148605): + // + // iter m n + // 0 148 186 + // 1 13046 13845 + // 2 93315 102225 + // 3 36189 32341 + // 4 5396 7 + // 5 455 1 + // 6 56 0 + // + // Because omg12 is near pi, estimate work with omg12a = pi - omg12 + double k = Astroid(x, y); + double + omg12a = lamscale * ( _f >= 0 ? -x * k/(1 + k) : -y * (1 + k)/k ); + somg12 = Math.sin(omg12a); comg12 = -Math.cos(omg12a); + // Update spherical estimate of alp1 using omg12 instead of lam12 + w.salp1 = cbet2 * somg12; + w.calp1 = sbet12a - cbet2 * sbet1 * GeoMath.sq(somg12) / (1 - comg12); + } + } + if (w.salp1 > 0) // Sanity check on starting guess + { Pair p = SinCosNorm(w.salp1, w.calp1); + w.salp1 = p.first; w.calp1 = p.second; } + else { + w.salp1 = 1; w.calp1 = 0; + } + return w; + } + + private class Lambda12V { + private double lam12, salp2, calp2, sig12, ssig1, csig1, ssig2, csig2, + eps, domg12, dlam12; + private Lambda12V() { + lam12 = salp2 = calp2 = sig12 = ssig1 = csig1 = ssig2 = csig2 + = eps = domg12 = dlam12 = Double.NaN; + } + } + + private Lambda12V Lambda12(double sbet1, double cbet1, double dn1, + double sbet2, double cbet2, double dn2, + double salp1, double calp1, + boolean diffp, + // Scratch areas of the right size + double C1a[], double C2a[], double C3a[]) { + // Object to hold lam12, salp2, calp2, sig12, ssig1, csig1, ssig2, csig2, + // eps, domg12, dlam12; + + Lambda12V w = new Lambda12V(); + + if (sbet1 == 0 && calp1 == 0) + // Break degeneracy of equatorial line. This case has already been + // handled. + calp1 = -tiny_; + + double + // sin(alp1) * cos(bet1) = sin(alp0) + salp0 = salp1 * cbet1, + calp0 = GeoMath.hypot(calp1, salp1 * sbet1); // calp0 > 0 + + double somg1, comg1, somg2, comg2, omg12; + // tan(bet1) = tan(sig1) * cos(alp1) + // tan(omg1) = sin(alp0) * tan(sig1) = tan(omg1)=tan(alp1)*sin(bet1) + w.ssig1 = sbet1; somg1 = salp0 * sbet1; + w.csig1 = comg1 = calp1 * cbet1; + { Pair p = SinCosNorm(w.ssig1, w.csig1); + w.ssig1 = p.first; w.csig1 = p.second; } + // SinCosNorm(somg1, comg1); -- don't need to normalize! + + // Enforce symmetries in the case abs(bet2) = -bet1. Need to be careful + // about this case, since this can yield singularities in the Newton + // iteration. + // sin(alp2) * cos(bet2) = sin(alp0) + w.salp2 = cbet2 != cbet1 ? salp0 / cbet2 : salp1; + // calp2 = sqrt(1 - sq(salp2)) + // = sqrt(sq(calp0) - sq(sbet2)) / cbet2 + // and subst for calp0 and rearrange to give (choose positive sqrt + // to give alp2 in [0, pi/2]). + w.calp2 = cbet2 != cbet1 || Math.abs(sbet2) != -sbet1 ? + Math.sqrt(GeoMath.sq(calp1 * cbet1) + + (cbet1 < -sbet1 ? + (cbet2 - cbet1) * (cbet1 + cbet2) : + (sbet1 - sbet2) * (sbet1 + sbet2))) / cbet2 : + Math.abs(calp1); + // tan(bet2) = tan(sig2) * cos(alp2) + // tan(omg2) = sin(alp0) * tan(sig2). + w.ssig2 = sbet2; somg2 = salp0 * sbet2; + w.csig2 = comg2 = w.calp2 * cbet2; + { Pair p = SinCosNorm(w.ssig2, w.csig2); + w.ssig2 = p.first; w.csig2 = p.second; } + // SinCosNorm(somg2, comg2); -- don't need to normalize! + + // sig12 = sig2 - sig1, limit to [0, pi] + w.sig12 = Math.atan2(Math.max(w.csig1 * w.ssig2 - w.ssig1 * w.csig2, 0.0), + w.csig1 * w.csig2 + w.ssig1 * w.ssig2); + + // omg12 = omg2 - omg1, limit to [0, pi] + omg12 = Math.atan2(Math.max(comg1 * somg2 - somg1 * comg2, 0.0), + comg1 * comg2 + somg1 * somg2); + double B312, h0; + double k2 = GeoMath.sq(calp0) * _ep2; + w.eps = k2 / (2 * (1 + Math.sqrt(1 + k2)) + k2); + C3f(w.eps, C3a); + B312 = (SinCosSeries(true, w.ssig2, w.csig2, C3a) - + SinCosSeries(true, w.ssig1, w.csig1, C3a)); + h0 = -_f * A3f(w.eps); + w.domg12 = salp0 * h0 * (w.sig12 + B312); + w.lam12 = omg12 + w.domg12; + + if (diffp) { + if (w.calp2 == 0) + w.dlam12 = - 2 * _f1 * dn1 / sbet1; + else { + double dummy; + LengthsV v = + Lengths(w.eps, w.sig12, w.ssig1, w.csig1, dn1, w.ssig2, w.csig2, dn2, + cbet1, cbet2, false, C1a, C2a); + w.dlam12 = v.m12b; + w.dlam12 *= _f1 / (w.calp2 * cbet2); + } + } + + return w; + } + + protected double A3f(double eps) { + // Evaluate sum(_A3x[k] * eps^k, k, 0, nA3x_-1) by Horner's method + double v = 0; + for (int i = nA3x_; i > 0; ) + v = eps * v + _A3x[--i]; + return v; + } + + protected void C3f(double eps, double c[]) { + // Evaluate C3 coeffs by Horner's method + // Elements c[1] thru c[nC3_ - 1] are set + for (int j = nC3x_, k = nC3_ - 1; k > 0; ) { + double t = 0; + for (int i = nC3_ - k; i > 0; --i) + t = eps * t + _C3x[--j]; + c[k--] = t; + } + + double mult = 1; + for (int k = 1; k < nC3_; ) { + mult *= eps; + c[k++] *= mult; + } + } + + protected void C4f(double eps, double c[]) { + // Evaluate C4 coeffs by Horner's method + // Elements c[0] thru c[nC4_ - 1] are set + for (int j = nC4x_, k = nC4_; k > 0; ) { + double t = 0; + for (int i = nC4_ - k + 1; i > 0; --i) + t = eps * t + _C4x[--j]; + c[--k] = t; + } + + double mult = 1; + for (int k = 1; k < nC4_; ) { + mult *= eps; + c[k++] *= mult; + } + } + + // Generated by Maxima on 2010-09-04 10:26:17-04:00 + + // The scale factor A1-1 = mean value of (d/dsigma)I1 - 1 + protected static double A1m1f(double eps) { + double + eps2 = GeoMath.sq(eps), + t; + t = eps2*(eps2*(eps2+4)+64)/256; + return (t + eps) / (1 - eps); + } + + // The coefficients C1[l] in the Fourier expansion of B1 + protected static void C1f(double eps, double c[]) { + double + eps2 = GeoMath.sq(eps), + d = eps; + c[1] = d*((6-eps2)*eps2-16)/32; + d *= eps; + c[2] = d*((64-9*eps2)*eps2-128)/2048; + d *= eps; + c[3] = d*(9*eps2-16)/768; + d *= eps; + c[4] = d*(3*eps2-5)/512; + d *= eps; + c[5] = -7*d/1280; + d *= eps; + c[6] = -7*d/2048; + } + + // The coefficients C1p[l] in the Fourier expansion of B1p + protected static void C1pf(double eps, double c[]) { + double + eps2 = GeoMath.sq(eps), + d = eps; + c[1] = d*(eps2*(205*eps2-432)+768)/1536; + d *= eps; + c[2] = d*(eps2*(4005*eps2-4736)+3840)/12288; + d *= eps; + c[3] = d*(116-225*eps2)/384; + d *= eps; + c[4] = d*(2695-7173*eps2)/7680; + d *= eps; + c[5] = 3467*d/7680; + d *= eps; + c[6] = 38081*d/61440; + } + + // The scale factor A2-1 = mean value of (d/dsigma)I2 - 1 + protected static double A2m1f(double eps) { + double + eps2 = GeoMath.sq(eps), + t; + t = eps2*(eps2*(25*eps2+36)+64)/256; + return t * (1 - eps) - eps; + } + + // The coefficients C2[l] in the Fourier expansion of B2 + protected static void C2f(double eps, double c[]) { + double + eps2 = GeoMath.sq(eps), + d = eps; + c[1] = d*(eps2*(eps2+2)+16)/32; + d *= eps; + c[2] = d*(eps2*(35*eps2+64)+384)/2048; + d *= eps; + c[3] = d*(15*eps2+80)/768; + d *= eps; + c[4] = d*(7*eps2+35)/512; + d *= eps; + c[5] = 63*d/1280; + d *= eps; + c[6] = 77*d/2048; + } + + // The scale factor A3 = mean value of (d/dsigma)I3 + protected void A3coeff() { + _A3x[0] = 1; + _A3x[1] = (_n-1)/2; + _A3x[2] = (_n*(3*_n-1)-2)/8; + _A3x[3] = ((-_n-3)*_n-1)/16; + _A3x[4] = (-2*_n-3)/64; + _A3x[5] = -3/128.0; + } + + // The coefficients C3[l] in the Fourier expansion of B3 + protected void C3coeff() { + _C3x[0] = (1-_n)/4; + _C3x[1] = (1-_n*_n)/8; + _C3x[2] = ((3-_n)*_n+3)/64; + _C3x[3] = (2*_n+5)/128; + _C3x[4] = 3/128.0; + _C3x[5] = ((_n-3)*_n+2)/32; + _C3x[6] = ((-3*_n-2)*_n+3)/64; + _C3x[7] = (_n+3)/128; + _C3x[8] = 5/256.0; + _C3x[9] = (_n*(5*_n-9)+5)/192; + _C3x[10] = (9-10*_n)/384; + _C3x[11] = 7/512.0; + _C3x[12] = (7-14*_n)/512; + _C3x[13] = 7/512.0; + _C3x[14] = 21/2560.0; + } + + // Generated by Maxima on 2012-10-19 08:02:34-04:00 + + // The coefficients C4[l] in the Fourier expansion of I4 + protected void C4coeff() { + _C4x[0] = (_n*(_n*(_n*(_n*(100*_n+208)+572)+3432)-12012)+30030)/45045; + _C4x[1] = (_n*(_n*(_n*(64*_n+624)-4576)+6864)-3003)/15015; + _C4x[2] = (_n*((14144-10656*_n)*_n-4576)-858)/45045; + _C4x[3] = ((-224*_n-4784)*_n+1573)/45045; + _C4x[4] = (1088*_n+156)/45045; + _C4x[5] = 97/15015.0; + _C4x[6] = (_n*(_n*((-64*_n-624)*_n+4576)-6864)+3003)/135135; + _C4x[7] = (_n*(_n*(5952*_n-11648)+9152)-2574)/135135; + _C4x[8] = (_n*(5792*_n+1040)-1287)/135135; + _C4x[9] = (468-2944*_n)/135135; + _C4x[10] = 1/9009.0; + _C4x[11] = (_n*((4160-1440*_n)*_n-4576)+1716)/225225; + _C4x[12] = ((4992-8448*_n)*_n-1144)/225225; + _C4x[13] = (1856*_n-936)/225225; + _C4x[14] = 8/10725.0; + _C4x[15] = (_n*(3584*_n-3328)+1144)/315315; + _C4x[16] = (1024*_n-208)/105105; + _C4x[17] = -136/63063.0; + _C4x[18] = (832-2560*_n)/405405; + _C4x[19] = -128/135135.0; + _C4x[20] = 128/99099.0; + } +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicData.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicData.java new file mode 100644 index 000000000..1a667a5ed --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicData.java @@ -0,0 +1,78 @@ +/** + * Implementation of the net.sf.geographiclib.GeodesicData class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * The results of geodesic calculations. + * + * This is used to return the results for a geodesic between point 1 + * (lat1, lon1) and point 2 (lat2, lon2). Fields + * that have not been set will be filled with Double.NaN. The returned + * GeodesicData objects always include the parameters provided to {@link + * Geodesic#Direct(double, double, double, double) Geodesic.Direct} and {@link + * Geodesic#Inverse(double, double, double, double) Geodesic.Inverse} and it + * always includes the field a12. + **********************************************************************/ +public class GeodesicData { + /** + * latitude of point 1 (degrees). + **********************************************************************/ + public double lat1; + /** + * longitude of point 1 (degrees). + **********************************************************************/ + public double lon1; + /** + * azimuth at point 1 (degrees). + **********************************************************************/ + public double azi1; + /** + * latitude of point 2 (degrees). + **********************************************************************/ + public double lat2; + /** + * longitude of point 2 (degrees). + **********************************************************************/ + public double lon2; + /** + * azimuth at point 2 (degrees). + **********************************************************************/ + public double azi2; + /** + * distance between point 1 and point 2 (meters). + **********************************************************************/ + public double s12; + /** + * arc length on the auxiliary sphere between point 1 and point 2 + * (degrees). + **********************************************************************/ + public double a12; + /** + * reduced length of geodesic (meters). + **********************************************************************/ + public double m12; + /** + * geodesic scale of point 2 relative to point 1 (dimensionless). + **********************************************************************/ + public double M12; + /** + * geodesic scale of point 1 relative to point 2 (dimensionless). + **********************************************************************/ + public double M21; + /** + * area under the geodesic (meters2). + **********************************************************************/ + public double S12; + /** + * Initialize all the fields to Double.NaN. + **********************************************************************/ + public GeodesicData() { + lat1 = lon1 = azi1 = lat2 = lon2 = azi2 = + s12 = a12 = m12 = M12 = M21 = S12 = Double.NaN; + } +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicLine.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicLine.java new file mode 100644 index 000000000..61d29de6b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicLine.java @@ -0,0 +1,632 @@ +/** + * Implementation of the net.sf.geographiclib.GeodesicLine class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * A geodesic line. + *

+ * GeodesicLine facilitates the determination of a series of points on a single + * geodesic. The starting point (lat1, lon1) and the azimuth + * azi1 are specified in the constructor. {@link #Position Position} + * returns the location of point 2 a distance s12 along the geodesic. + * Alternatively {@link #ArcPosition ArcPosition} gives the position of point 2 + * an arc length a12 along the geodesic. + *

+ * The calculations are accurate to better than 15 nm (15 nanometers). See + * Sec. 9 of + * arXiv:1102.1215v1 for + * details. The algorithms used by this class are based on series expansions + * using the flattening f as a small parameter. These are only accurate + * for |f| < 0.02; however reasonably accurate results will be + * obtained for |f| < 0.2. + *

+ * The algorithms are described in + *

+ *

+ * Here's an example of using this class + *

+ * {@code
+ * import net.sf.geographiclib.*;
+ * public class GeodesicLineTest {
+ *   public static void main(String[] args) {
+ *     // Print waypoints between JFK and SIN
+ *     Geodesic geod = Geodesic.WGS84;
+ *     double
+ *       lat1 = 40.640, lon1 = -73.779, // JFK
+ *       lat2 =  1.359, lon2 = 103.989; // SIN
+ *     GeodesicData g = geod.Inverse(lat1, lon1, lat2, lon2,
+ *                  GeodesicMask.DISTANCE | GeodesicMask.AZIMUTH);
+ *     GeodesicLine line = new GeodesicLine(geod, lat1, lon1, g.azi1,
+ *                  GeodesicMask.DISTANCE_IN | GeodesicMask.LONGITUDE);
+ *     double
+ *       s12 = g.s12,
+ *       a12 = g.a12,
+ *       ds0 = 500e3;        // Nominal distance between points = 500 km
+ *     int num = (int)(Math.ceil(s12 / ds0)); // The number of intervals
+ *     {
+ *       // Use intervals of equal length
+ *       double ds = s12 / num;
+ *       for (int i = 0; i <= num; ++i) {
+ *         g = line.Position(i * ds,
+ *                  GeodesicMask.LATITUDE | GeodesicMask.LONGITUDE);
+ *         System.out.println(i + " " + g.lat2 + " " + g.lon2);
+ *       }
+ *     }
+ *     {
+ *       // Slightly faster, use intervals of equal arc length
+ *       double da = a12 / num;
+ *       for (int i = 0; i <= num; ++i) {
+ *         g = line.ArcPosition(i * da,
+ *                  GeodesicMask.LATITUDE | GeodesicMask.LONGITUDE);
+ *         System.out.println(i + " " + g.lat2 + " " + g.lon2);
+ *       }
+ *     }
+ *   }
+ * }}
+ **********************************************************************/ +public class GeodesicLine { + + private static final int nC1_ = Geodesic.nC1_; + private static final int nC1p_ = Geodesic.nC1p_; + private static final int nC2_ = Geodesic.nC2_; + private static final int nC3_ = Geodesic.nC3_; + private static final int nC4_ = Geodesic.nC4_; + + private double _lat1, _lon1, _azi1; + private double _a, _f, _b, _c2, _f1, _salp0, _calp0, _k2, + _salp1, _calp1, _ssig1, _csig1, _dn1, _stau1, _ctau1, _somg1, _comg1, + _A1m1, _A2m1, _A3c, _B11, _B21, _B31, _A4, _B41; + // index zero elements of _C1a, _C1pa, _C2a, _C3a are unused + private double _C1a[], _C1pa[], _C2a[], _C3a[], + _C4a[]; // all the elements of _C4a are used + private int _caps; + + /** + * Constructor for a geodesic line staring at latitude lat1, longitude + * lon1, and azimuth azi1 (all in degrees). + *

+ * @param g A {@link Geodesic} object used to compute the necessary + * information about the GeodesicLine. + * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + *

+ * lat1 should be in the range [−90°, 90°]; lon1 + * and azi1 should be in the range [−540°, 540°). + *

+ * If the point is at a pole, the azimuth is defined by keeping lon1 + * fixed, writing lat1 = ±(90° − ε), and + * taking the limit ε → 0+. + **********************************************************************/ + public GeodesicLine(Geodesic g, + double lat1, double lon1, double azi1) { + this(g, lat1, lon1, azi1, GeodesicMask.ALL); + } + + /** + * Constructor for a geodesic line staring at latitude lat1, longitude + * lon1, and azimuth azi1 (all in degrees) with a subset of the + * capabilities included. + *

+ * @param g A {@link Geodesic} object used to compute the necessary + * information about the GeodesicLine. + * @param lat1 latitude of point 1 (degrees). + * @param lon1 longitude of point 1 (degrees). + * @param azi1 azimuth at point 1 (degrees). + * @param caps bitor'ed combination of {@link GeodesicMask} values + * specifying the capabilities the GeodesicLine object should possess, + * i.e., which quantities can be returned in calls to {@link #Position + * Position}. + *

+ * The {@link GeodesicMask} values are + *

    + *
  • + * caps |= GeodesicMask.LATITUDE for the latitude lat2; this + * is added automatically; + *
  • + * caps |= GeodesicMask.LONGITUDE for the latitude lon2; + *
  • + * caps |= GeodesicMask.AZIMUTH for the latitude azi2; this + * is added automatically; + *
  • + * caps |= GeodesicMask.DISTANCE for the distance s12; + *
  • + * caps |= GeodesicMask.REDUCEDLENGTH for the reduced length + * m12; + *
  • + * caps |= GeodesicMask.GEODESICSCALE for the geodesic scales + * M12 and M21; + *
  • + * caps |= GeodesicMask.AREA for the area S12; + *
  • + * caps |= GeodesicMask.DISTANCE_IN permits the length of the + * geodesic to be given in terms of s12; without this capability the + * length can only be specified in terms of arc length; + *
  • + * caps |= GeodesicMask.ALL for all of the above; + *
+ **********************************************************************/ + public GeodesicLine(Geodesic g, + double lat1, double lon1, double azi1, + int caps) { + _a = g._a; + _f = g._f; + _b = g._b; + _c2 = g._c2; + _f1 = g._f1; + // Always allow latitude and azimuth + _caps = caps | GeodesicMask.LATITUDE | GeodesicMask.AZIMUTH; + + // Guard against underflow in salp0 + azi1 = Geodesic.AngRound(GeoMath.AngNormalize(azi1)); + lon1 = GeoMath.AngNormalize(lon1); + _lat1 = lat1; + _lon1 = lon1; + _azi1 = azi1; + // alp1 is in [0, pi] + double alp1 = azi1 * GeoMath.degree; + // Enforce sin(pi) == 0 and cos(pi/2) == 0. Better to face the ensuing + // problems directly than to skirt them. + _salp1 = azi1 == -180 ? 0 : Math.sin(alp1); + _calp1 = Math.abs(azi1) == 90 ? 0 : Math.cos(alp1); + double cbet1, sbet1, phi; + phi = lat1 * GeoMath.degree; + // Ensure cbet1 = +epsilon at poles + sbet1 = _f1 * Math.sin(phi); + cbet1 = Math.abs(lat1) == 90 ? Geodesic.tiny_ : Math.cos(phi); + { Pair p = Geodesic.SinCosNorm(sbet1, cbet1); + sbet1 = p.first; cbet1 = p.second; } + _dn1 = Math.sqrt(1 + g._ep2 * GeoMath.sq(sbet1)); + + // Evaluate alp0 from sin(alp1) * cos(bet1) = sin(alp0), + _salp0 = _salp1 * cbet1; // alp0 in [0, pi/2 - |bet1|] + // Alt: calp0 = hypot(sbet1, calp1 * cbet1). The following + // is slightly better (consider the case salp1 = 0). + _calp0 = GeoMath.hypot(_calp1, _salp1 * sbet1); + // Evaluate sig with tan(bet1) = tan(sig1) * cos(alp1). + // sig = 0 is nearest northward crossing of equator. + // With bet1 = 0, alp1 = pi/2, we have sig1 = 0 (equatorial line). + // With bet1 = pi/2, alp1 = -pi, sig1 = pi/2 + // With bet1 = -pi/2, alp1 = 0 , sig1 = -pi/2 + // Evaluate omg1 with tan(omg1) = sin(alp0) * tan(sig1). + // With alp0 in (0, pi/2], quadrants for sig and omg coincide. + // No atan2(0,0) ambiguity at poles since cbet1 = +epsilon. + // With alp0 = 0, omg1 = 0 for alp1 = 0, omg1 = pi for alp1 = pi. + _ssig1 = sbet1; _somg1 = _salp0 * sbet1; + _csig1 = _comg1 = sbet1 != 0 || _calp1 != 0 ? cbet1 * _calp1 : 1; + { Pair p = Geodesic.SinCosNorm(_ssig1, _csig1); + _ssig1 = p.first; _csig1 = p.second; } // sig1 in (-pi, pi] + // Geodesic.SinCosNorm(_somg1, _comg1); -- don't need to normalize! + + _k2 = GeoMath.sq(_calp0) * g._ep2; + double eps = _k2 / (2 * (1 + Math.sqrt(1 + _k2)) + _k2); + + if ((_caps & GeodesicMask.CAP_C1) != 0) { + _A1m1 = Geodesic.A1m1f(eps); + _C1a = new double[nC1_ + 1]; + Geodesic.C1f(eps, _C1a); + _B11 = Geodesic.SinCosSeries(true, _ssig1, _csig1, _C1a); + double s = Math.sin(_B11), c = Math.cos(_B11); + // tau1 = sig1 + B11 + _stau1 = _ssig1 * c + _csig1 * s; + _ctau1 = _csig1 * c - _ssig1 * s; + // Not necessary because C1pa reverts C1a + // _B11 = -SinCosSeries(true, _stau1, _ctau1, _C1pa, nC1p_); + } + + if ((_caps & GeodesicMask.CAP_C1p) != 0) { + _C1pa = new double[nC1p_ + 1]; + Geodesic.C1pf(eps, _C1pa); + } + + if ((_caps & GeodesicMask.CAP_C2) != 0) { + _C2a = new double[nC2_ + 1]; + _A2m1 = Geodesic.A2m1f(eps); + Geodesic.C2f(eps, _C2a); + _B21 = Geodesic.SinCosSeries(true, _ssig1, _csig1, _C2a); + } + + if ((_caps & GeodesicMask.CAP_C3) != 0) { + _C3a = new double[nC3_]; + g.C3f(eps, _C3a); + _A3c = -_f * _salp0 * g.A3f(eps); + _B31 = Geodesic.SinCosSeries(true, _ssig1, _csig1, _C3a); + } + + if ((_caps & GeodesicMask.CAP_C4) != 0) { + _C4a = new double[nC4_]; + g.C4f(eps, _C4a); + // Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0) + _A4 = GeoMath.sq(_a) * _calp0 * _salp0 * g._e2; + _B41 = Geodesic.SinCosSeries(false, _ssig1, _csig1, _C4a); + } + } + + /** + * A default constructor. If GeodesicLine.Position is called on the + * resulting object, it returns immediately (without doing any calculations). + * The object can be set with a call to {@link Geodesic.Line}. Use {@link + * Init()} to test whether object is still in this uninitialized state. + * (This constructor was useful in C++, e.g., to allow vectors of + * GeodesicLine objects. It may not be needed in Java, so make it private.) + **********************************************************************/ + private GeodesicLine() { _caps = 0; } + + /** + * Compute the position of point 2 which is a distance s12 (meters) + * from point 1. + *

+ * @param s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @return a {@link GeodesicData} object with the following fields: + * lat1, lon1, azi1, lat2, lon2, + * azi2, s12, a12. Some of these results may be + * missing if the GeodesicLine did not include the relevant capability. + *

+ * The values of lon2 and azi2 returned are in the range + * [−180°, 180°). + *

+ * The GeodesicLine object must have been constructed with caps + * |= {@link GeodesicMask#DISTANCE_IN}; otherwise no parameters are set. + **********************************************************************/ + public GeodesicData Position(double s12) { + return Position(false, s12, + GeodesicMask.LATITUDE | GeodesicMask.LONGITUDE | + GeodesicMask.AZIMUTH); + } + /** + * Compute the position of point 2 which is a distance s12 (meters) + * from point 1 and with a subset of the geodesic results returned. + *

+ * @param s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @param outmask a bitor'ed combination of {@link GeodesicMask} values + * specifying which results should be returned. + * @return a {@link GeodesicData} object including the requested results. + *

+ * The GeodesicLine object must have been constructed with caps + * |= {@link GeodesicMask#DISTANCE_IN}; otherwise no parameters are set. + * Requesting a value which the GeodesicLine object is not capable of + * computing is not an error (no parameters will be set). + **********************************************************************/ + public GeodesicData Position(double s12, int outmask) { + return Position(false, s12, outmask); + } + + /** + * Compute the position of point 2 which is an arc length a12 + * (degrees) from point 1. + *

+ * @param a12 arc length between point 1 and point 2 (degrees); it can + * be negative. + * @return a {@link GeodesicData} object with the following fields: + * lat1, lon1, azi1, lat2, lon2, + * azi2, s12, a12. Some of these results may be + * missing if the GeodesicLine did not include the relevant capability. + *

+ * The values of lon2 and azi2 returned are in the range + * [−180°, 180°). + *

+ * The GeodesicLine object must have been constructed with caps + * |= {@link GeodesicMask#DISTANCE_IN}; otherwise no parameters are set. + **********************************************************************/ + public GeodesicData ArcPosition(double a12) { + return Position(true, a12, + GeodesicMask.LATITUDE | GeodesicMask.LONGITUDE | + GeodesicMask.AZIMUTH | GeodesicMask.DISTANCE); + } + /** + * Compute the position of point 2 which is an arc length a12 + * (degrees) from point 1 and with a subset of the geodesic results returned. + *

+ * @param a12 arc length between point 1 and point 2 (degrees); it can + * be negative. + * @param outmask a bitor'ed combination of {@link GeodesicMask} values + * specifying which results should be returned. + * @return a {@link GeodesicData} object giving lat1, lon2, + * azi2, and a12. + *

+ * The GeodesicLine object must have been constructed with caps + * |= {@link GeodesicMask#DISTANCE_IN}; otherwise no parameters are set. + * Requesting a value which the GeodesicLine object is not capable of + * computing is not an error (no parameters will be set). + **********************************************************************/ + public GeodesicData ArcPosition(double a12, int outmask) { + return Position(true, a12, outmask); + } + + /** + * The general position function. {@link #Position(double, int) Position} + * and {@link #ArcPosition(double, int) ArcPosition} are defined in terms of + * this function. + *

+ * @param arcmode boolean flag determining the meaning of the second + * parameter; if arcmode is false, then the GeodesicLine object must have + * been constructed with caps |= {@link GeodesicMask#DISTANCE_IN}. + * @param s12_a12 if arcmode is false, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be negative. + * @param outmask a bitor'ed combination of {@link GeodesicMask} values + * specifying which results should be returned. + * @return a {@link GeodesicData} object with the requested results. + *

+ * The {@link GeodesicMask} values possible for outmask are + *

    + *
  • + * outmask |= GeodesicMask.LATITUDE for the latitude lat2. + *
  • + * outmask |= GeodesicMask.LONGITUDE for the latitude lon2. + *
  • + * outmask |= GeodesicMask.AZIMUTH for the latitude azi2. + *
  • + * outmask |= GeodesicMask.DISTANCE for the distance s12. + *
  • + * outmask |= GeodesicMask.REDUCEDLENGTH for the reduced length + * m12. + *
  • + * outmask |= GeodesicMask.GEODESICSCALE for the geodesic scales + * M12 and M21. + *
  • + * outmask |= GeodesicMask.AREA for the area S12. + *
+ *

+ * Requesting a value which the GeodesicLine object is not capable of + * computing is not an error; Double.NaN is returned instead. + **********************************************************************/ + public GeodesicData Position(boolean arcmode, double s12_a12, + int outmask) { + outmask &= _caps & GeodesicMask.OUT_ALL; + GeodesicData r = new GeodesicData(); + if (!( Init() && + (arcmode || + (_caps & GeodesicMask.DISTANCE_IN & GeodesicMask.OUT_ALL) != 0) )) + // Uninitialized or impossible distance calculation requested + return r; + r.lat1 = _lat1; r.lon1 = _lon1; r.azi1 = _azi1; + + // Avoid warning about uninitialized B12. + double sig12, ssig12, csig12, B12 = 0, AB1 = 0; + if (arcmode) { + // Interpret s12_a12 as spherical arc length + r.a12 = s12_a12; + sig12 = s12_a12 * GeoMath.degree; + double s12a = Math.abs(s12_a12); + s12a -= 180 * Math.floor(s12a / 180); + ssig12 = s12a == 0 ? 0 : Math.sin(sig12); + csig12 = s12a == 90 ? 0 : Math.cos(sig12); + } else { + // Interpret s12_a12 as distance + r.s12 = s12_a12; + double + tau12 = s12_a12 / (_b * (1 + _A1m1)), + s = Math.sin(tau12), + c = Math.cos(tau12); + // tau2 = tau1 + tau12 + B12 = - Geodesic.SinCosSeries(true, + _stau1 * c + _ctau1 * s, + _ctau1 * c - _stau1 * s, + _C1pa); + sig12 = tau12 - (B12 - _B11); + r.a12 = sig12 / GeoMath.degree; + ssig12 = Math.sin(sig12); csig12 = Math.cos(sig12); + if (Math.abs(_f) > 0.01) { + // Reverted distance series is inaccurate for |f| > 1/100, so correct + // sig12 with 1 Newton iteration. The following table shows the + // approximate maximum error for a = WGS_a() and various f relative to + // GeodesicExact. + // erri = the error in the inverse solution (nm) + // errd = the error in the direct solution (series only) (nm) + // errda = the error in the direct solution (series + 1 Newton) (nm) + // + // f erri errd errda + // -1/5 12e6 1.2e9 69e6 + // -1/10 123e3 12e6 765e3 + // -1/20 1110 108e3 7155 + // -1/50 18.63 200.9 27.12 + // -1/100 18.63 23.78 23.37 + // -1/150 18.63 21.05 20.26 + // 1/150 22.35 24.73 25.83 + // 1/100 22.35 25.03 25.31 + // 1/50 29.80 231.9 30.44 + // 1/20 5376 146e3 10e3 + // 1/10 829e3 22e6 1.5e6 + // 1/5 157e6 3.8e9 280e6 + double + ssig2 = _ssig1 * csig12 + _csig1 * ssig12, + csig2 = _csig1 * csig12 - _ssig1 * ssig12; + B12 = Geodesic.SinCosSeries(true, ssig2, csig2, _C1a); + double serr = (1 + _A1m1) * (sig12 + (B12 - _B11)) - s12_a12 / _b; + sig12 = sig12 - serr / Math.sqrt(1 + _k2 * GeoMath.sq(ssig2)); + ssig12 = Math.sin(sig12); csig12 = Math.cos(sig12); + // Update B12 below + } + } + + double omg12, lam12, lon12; + double ssig2, csig2, sbet2, cbet2, somg2, comg2, salp2, calp2; + // sig2 = sig1 + sig12 + ssig2 = _ssig1 * csig12 + _csig1 * ssig12; + csig2 = _csig1 * csig12 - _ssig1 * ssig12; + double dn2 = Math.sqrt(1 + _k2 * GeoMath.sq(ssig2)); + if ((outmask & (GeodesicMask.DISTANCE | GeodesicMask.REDUCEDLENGTH | + GeodesicMask.GEODESICSCALE)) != 0) { + if (arcmode || Math.abs(_f) > 0.01) + B12 = Geodesic.SinCosSeries(true, ssig2, csig2, _C1a); + AB1 = (1 + _A1m1) * (B12 - _B11); + } + // sin(bet2) = cos(alp0) * sin(sig2) + sbet2 = _calp0 * ssig2; + // Alt: cbet2 = hypot(csig2, salp0 * ssig2); + cbet2 = GeoMath.hypot(_salp0, _calp0 * csig2); + if (cbet2 == 0) + // I.e., salp0 = 0, csig2 = 0. Break the degeneracy in this case + cbet2 = csig2 = Geodesic.tiny_; + // tan(omg2) = sin(alp0) * tan(sig2) + somg2 = _salp0 * ssig2; comg2 = csig2; // No need to normalize + // tan(alp0) = cos(sig2)*tan(alp2) + salp2 = _salp0; calp2 = _calp0 * csig2; // No need to normalize + // omg12 = omg2 - omg1 + omg12 = Math.atan2(somg2 * _comg1 - comg2 * _somg1, + comg2 * _comg1 + somg2 * _somg1); + + if ((outmask & GeodesicMask.DISTANCE) != 0 && arcmode) + r.s12 = _b * ((1 + _A1m1) * sig12 + AB1); + + if ((outmask & GeodesicMask.LONGITUDE) != 0) { + lam12 = omg12 + _A3c * + ( sig12 + (Geodesic.SinCosSeries(true, ssig2, csig2, _C3a) + - _B31)); + lon12 = lam12 / GeoMath.degree; + // Use GeoMath.AngNormalize2 because longitude might have wrapped + // multiple times. + lon12 = GeoMath.AngNormalize2(lon12); + r.lon2 = GeoMath.AngNormalize(_lon1 + lon12); + } + + if ((outmask & GeodesicMask.LATITUDE) != 0) + r.lat2 = Math.atan2(sbet2, _f1 * cbet2) / GeoMath.degree; + + if ((outmask & GeodesicMask.AZIMUTH) != 0) + // minus signs give range [-180, 180). 0- converts -0 to +0. + r.azi2 = 0 - Math.atan2(-salp2, calp2) / GeoMath.degree; + + if ((outmask & + (GeodesicMask.REDUCEDLENGTH | GeodesicMask.GEODESICSCALE)) != 0) { + double + B22 = Geodesic.SinCosSeries(true, ssig2, csig2, _C2a), + AB2 = (1 + _A2m1) * (B22 - _B21), + J12 = (_A1m1 - _A2m1) * sig12 + (AB1 - AB2); + if ((outmask & GeodesicMask.REDUCEDLENGTH) != 0) + // Add parens around (_csig1 * ssig2) and (_ssig1 * csig2) to ensure + // accurate cancellation in the case of coincident points. + r.m12 = _b * ((dn2 * (_csig1 * ssig2) - _dn1 * (_ssig1 * csig2)) + - _csig1 * csig2 * J12); + if ((outmask & GeodesicMask.GEODESICSCALE) != 0) { + double t = _k2 * (ssig2 - _ssig1) * (ssig2 + _ssig1) / (_dn1 + dn2); + r.M12 = csig12 + (t * ssig2 - csig2 * J12) * _ssig1 / _dn1; + r.M21 = csig12 - (t * _ssig1 - _csig1 * J12) * ssig2 / dn2; + } + } + + if ((outmask & GeodesicMask.AREA) != 0) { + double + B42 = Geodesic.SinCosSeries(false, ssig2, csig2, _C4a); + double salp12, calp12; + if (_calp0 == 0 || _salp0 == 0) { + // alp12 = alp2 - alp1, used in atan2 so no need to normalized + salp12 = salp2 * _calp1 - calp2 * _salp1; + calp12 = calp2 * _calp1 + salp2 * _salp1; + // The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz + // salp12 = -0 and alp12 = -180. However this depends on the sign + // being attached to 0 correctly. The following ensures the correct + // behavior. + if (salp12 == 0 && calp12 < 0) { + salp12 = Geodesic.tiny_ * _calp1; + calp12 = -1; + } + } else { + // tan(alp) = tan(alp0) * sec(sig) + // tan(alp2-alp1) = (tan(alp2) -tan(alp1)) / (tan(alp2)*tan(alp1)+1) + // = calp0 * salp0 * (csig1-csig2) / (salp0^2 + calp0^2 * csig1*csig2) + // If csig12 > 0, write + // csig1 - csig2 = ssig12 * (csig1 * ssig12 / (1 + csig12) + ssig1) + // else + // csig1 - csig2 = csig1 * (1 - csig12) + ssig12 * ssig1 + // No need to normalize + salp12 = _calp0 * _salp0 * + (csig12 <= 0 ? _csig1 * (1 - csig12) + ssig12 * _ssig1 : + ssig12 * (_csig1 * ssig12 / (1 + csig12) + _ssig1)); + calp12 = GeoMath.sq(_salp0) + GeoMath.sq(_calp0) * _csig1 * csig2; + } + r.S12 = _c2 * Math.atan2(salp12, calp12) + _A4 * (B42 - _B41); + } + + return r; + } + + /** + * @return true if the object has been initialized. + **********************************************************************/ + private boolean Init() { return _caps != 0; } + + /** + * @return lat1 the latitude of point 1 (degrees). + **********************************************************************/ + public double Latitude() + { return Init() ? _lat1 : Double.NaN; } + + /** + * @return lon1 the longitude of point 1 (degrees). + **********************************************************************/ + public double Longitude() + { return Init() ? _lon1 : Double.NaN; } + + /** + * @return azi1 the azimuth (degrees) of the geodesic line at point 1. + **********************************************************************/ + public double Azimuth() + { return Init() ? _azi1 : Double.NaN; } + + /** + * @return azi0 the azimuth (degrees) of the geodesic line as it + * crosses the equator in a northward direction. + **********************************************************************/ + public double EquatorialAzimuth() { + return Init() ? + Math.atan2(_salp0, _calp0) / GeoMath.degree : Double.NaN; + } + + /** + * @return a1 the arc length (degrees) between the northward + * equatorial crossing and point 1. + **********************************************************************/ + public double EquatorialArc() { + return Init() ? + Math.atan2(_ssig1, _csig1) / GeoMath.degree : Double.NaN; + } + + /** + * @return a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + public double MajorRadius() + { return Init() ? _a : Double.NaN; } + + /** + * @return f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + public double Flattening() + { return Init() ? _f : Double.NaN; } + + /** + * @return caps the computational capabilities that this object was + * constructed with. LATITUDE and AZIMUTH are always included. + **********************************************************************/ + public int Capabilities() { return _caps; } + + /** + * @param testcaps a set of bitor'ed {@link GeodesicMask} values. + * @return true if the GeodesicLine object has all these capabilities. + **********************************************************************/ + public boolean Capabilities(int testcaps) { + testcaps &= GeodesicMask.OUT_ALL; + return (_caps & testcaps) == testcaps; + } + +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicMask.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicMask.java new file mode 100644 index 000000000..6b72ea79c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeodesicMask.java @@ -0,0 +1,77 @@ +/** + * Implementation of the net.sf.geographiclib.GeodesicMask class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * Bit masks for what geodesic calculations to do. + *

+ * These masks do double duty. They specify (via the outmask parameter) + * which results to return in the {@link GeodesicData} object returned by the + * general routines {@link Geodesic#Direct(double, double, double, double, int) + * Geodesic.Direct} and {@link Geodesic#Inverse(double, double, double, double, + * int) Geodesic.Inverse} routines. They also signify (via the caps + * parameter) to the {@link GeodesicLine#GeodesicLine(Geodesic, double, double, + * double, int) GeodesicLine.GeodesicLine} constructor and to {@link + * Geodesic#Line(double, double, double, int) Geodesic.Line} what capabilities + * should be included in the {@link GeodesicLine} object. + **********************************************************************/ +public class GeodesicMask { + protected static final int CAP_NONE = 0; + protected static final int CAP_C1 = 1<<0; + protected static final int CAP_C1p = 1<<1; + protected static final int CAP_C2 = 1<<2; + protected static final int CAP_C3 = 1<<3; + protected static final int CAP_C4 = 1<<4; + protected static final int CAP_ALL = 0x1F; + protected static final int OUT_ALL = 0x7F80; + + /** + * No capabilities, no output. + **********************************************************************/ + public static final int NONE = 0; + /** + * Calculate latitude lat2. (It's not necessary to include this as a + * capability to {@link GeodesicLine} because this is included by default.) + **********************************************************************/ + public static final int LATITUDE = 1<<7 | CAP_NONE; + /** + * Calculate longitude lon2. + **********************************************************************/ + public static final int LONGITUDE = 1<<8 | CAP_C3; + /** + * Calculate azimuths azi1 and azi2. (It's not necessary to + * include this as a capability to {@link GeodesicLine} because this is + * included by default.) + **********************************************************************/ + public static final int AZIMUTH = 1<<9 | CAP_NONE; + /** + * Calculate distance s12. + **********************************************************************/ + public static final int DISTANCE = 1<<10 | CAP_C1; + /** + * Allow distance s12 to be used as input in the direct + * geodesic problem. + **********************************************************************/ + public static final int DISTANCE_IN = 1<<11 | CAP_C1 | CAP_C1p; + /** + * Calculate reduced length m12. + **********************************************************************/ + public static final int REDUCEDLENGTH = 1<<12 | CAP_C1 | CAP_C2; + /** + * Calculate geodesic scales M12 and M21. + **********************************************************************/ + public static final int GEODESICSCALE = 1<<13 | CAP_C1 | CAP_C2; + /** + * Calculate area S12. + **********************************************************************/ + public static final int AREA = 1<<14 | CAP_C4; + /** + * All capabilities, calculate everything. + **********************************************************************/ + public static final int ALL = OUT_ALL| CAP_ALL; +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeographicErr.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeographicErr.java new file mode 100644 index 000000000..d437a000c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/GeographicErr.java @@ -0,0 +1,24 @@ +/** + * Implementation of the net.sf.geographiclib.GeographicErr class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * Exception handling for GeographicLib. + *

+ * A class to handle exceptions. It's derived from RuntimeException so it + * can be caught by the usual catch clauses. + **********************************************************************/ +public class GeographicErr extends RuntimeException { + /** + * Constructor + *

+ * @param msg a string message, which is accessible in the catch + * clause via getMessage(). + **********************************************************************/ + public GeographicErr(String msg) { super(msg); } +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Pair.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Pair.java new file mode 100644 index 000000000..1e1140b49 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/Pair.java @@ -0,0 +1,32 @@ +/** + * Implementation of the net.sf.geographiclib.Pair class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * A pair of double precision numbers. + *

+ * This duplicates the C++ class {@code std::pair}. + **********************************************************************/ +public class Pair { + /** + * The first member of the pair. + **********************************************************************/ + public double first; + /** + * The second member of the pair. + **********************************************************************/ + public double second; + /** + * Constructor + *

+ * @param first the first member of the pair. + * @param second the second member of the pair. + **********************************************************************/ + public Pair(double first, double second) + { this.first = first; this.second = second; } +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/PolygonArea.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/PolygonArea.java new file mode 100644 index 000000000..75cb09a4d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/PolygonArea.java @@ -0,0 +1,383 @@ +/** + * Implementation of the net.sf.geographiclib.PolygonArea class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * Polygon areas. + *

+ * This computes the area of a geodesic polygon using the method given + * Section 6 of + *

+ *

+ * This class lets you add vertices one at a time to the polygon. The area + * and perimeter are accumulated in two times the standard floating point + * precision to guard against the loss of accuracy with many-sided polygons. + * At any point you can ask for the perimeter and area so far. There's an + * option to treat the points as defining a polyline instead of a polygon; in + * that case, only the perimeter is computed. + *

+ * Example of use: + *

+ * {@code
+ * // Compute the area of a geodesic polygon.
+ *
+ * // This program reads lines with lat, lon for each vertex of a polygon.
+ * // At the end of input, the program prints the number of vertices,
+ * // the perimeter of the polygon and its area (for the WGS84 ellipsoid).
+ *
+ * import java.util.*;
+ * import net.sf.geographiclib.*;
+ *
+ * public class Planimeter {
+ *   public static void main(String[] args) {
+ *     PolygonArea p = new PolygonArea(Geodesic.WGS84, false);
+ *     try {
+ *       Scanner in = new Scanner(System.in);
+ *       while (true) {
+ *         double lat = in.nextDouble(), lon = in.nextDouble();
+ *         p.AddPoint(lat, lon);
+ *       }
+ *     }
+ *     catch (Exception e) {}
+ *     PolygonResult r = p.Compute();
+ *     System.out.println(r.num + " " + r.perimeter + " " + r.area);
+ *   }
+ * }}
+ **********************************************************************/ +public class PolygonArea { + + private Geodesic _earth; + private double _area0; // Full ellipsoid area + private boolean _polyline; // Assume polyline (don't close and skip area) + private int _mask; + private int _num; + private int _crossings; + private Accumulator _areasum, _perimetersum; + private double _lat0, _lon0, _lat1, _lon1; + private static int transit(double lon1, double lon2) { + // Return 1 or -1 if crossing prime meridian in east or west direction. + // Otherwise return zero. + // Compute lon12 the same way as Geodesic.Inverse. + lon1 = GeoMath.AngNormalize(lon1); + lon2 = GeoMath.AngNormalize(lon2); + double lon12 = GeoMath.AngDiff(lon1, lon2); + int cross = + lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 : + (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0); + return cross; + } + + /** + * Constructor for PolygonArea. + *

+ * @param earth the Geodesic object to use for geodesic calculations. + * @param polyline if true that treat the points as defining a polyline + * instead of a polygon. + **********************************************************************/ + public PolygonArea(Geodesic earth, boolean polyline) { + _earth = earth; + _area0 = _earth.EllipsoidArea(); + _polyline = polyline; + _mask = GeodesicMask.LATITUDE | GeodesicMask.LONGITUDE | + GeodesicMask.DISTANCE | + (_polyline ? GeodesicMask.NONE : GeodesicMask.AREA); + _perimetersum = new Accumulator(0); + if (!_polyline) + _areasum = new Accumulator(0); + Clear(); + } + + /** + * Clear PolygonArea, allowing a new polygon to be started. + **********************************************************************/ + public void Clear() { + _num = 0; + _crossings = 0; + _perimetersum.Set(0); + if (!_polyline) _areasum.Set(0); + _lat0 = _lon0 = _lat1 = _lon1 = Double.NaN; + } + + /** + * Add a point to the polygon or polyline. + *

+ * @param lat the latitude of the point (degrees). + * @param lon the latitude of the point (degrees). + *

+ * lat should be in the range [−90°, 90°] and lon + * should be in the range [−540°, 540°). + **********************************************************************/ + public void AddPoint(double lat, double lon) { + lon = GeoMath.AngNormalize(lon); + if (_num == 0) { + _lat0 = _lat1 = lat; + _lon0 = _lon1 = lon; + } else { + GeodesicData g = _earth.Inverse(_lat1, _lon1, lat, lon, _mask); + _perimetersum.Add(g.s12); + if (!_polyline) { + _areasum.Add(g.S12); + _crossings += transit(_lon1, lon); + } + _lat1 = lat; _lon1 = lon; + } + ++_num; + } + + /** + * Add an edge to the polygon or polyline. + *

+ * @param azi azimuth at current point (degrees). + * @param s distance from current point to next point (meters). + *

+ * azi should be in the range [−540°, 540°). This does + * nothing if no points have been added yet. Use PolygonArea.CurrentPoint to + * determine the position of the new vertex. + **********************************************************************/ + public void AddEdge(double azi, double s) { + if (_num > 0) { // Do nothing if _num is zero + GeodesicData g = _earth.Direct(_lat1, _lon1, azi, s, _mask); + _perimetersum.Add(g.s12); + if (!_polyline) { + _areasum.Add(g.S12); + _crossings += transit(_lon1, g.lon2); + } + _lat1 = g.lat2; _lon1 = g.lon2; + ++_num; + } + } + + /** + * Return the results so far. + *

+ * @return PolygonResult(num, perimeter, area) where + * num is the number of vertices, perimeter is the perimeter + * of the polygon or the length of the polyline (meters), and area + * is the area of the polygon (meters2) or Double.NaN of + * polyline is true in the constructor. + *

+ * Counter-clockwise traversal counts as a positive area. + **********************************************************************/ + public PolygonResult Compute() { return Compute(false, true); } + /** + * Return the results so far. + *

+ * @param reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @return PolygonResult(num, perimeter, area) where + * num is the number of vertices, perimeter is the perimeter + * of the polygon or the length of the polyline (meters), and area + * is the area of the polygon (meters2) or Double.NaN of + * polyline is true in the constructor. + **********************************************************************/ + public PolygonResult Compute(boolean reverse, boolean sign) { + if (_num < 2) + return new PolygonResult(_num, 0, _polyline ? Double.NaN : 0); + if (_polyline) + return new PolygonResult(_num, _perimetersum.Sum(), Double.NaN); + + GeodesicData g = _earth.Inverse(_lat1, _lon1, _lat0, _lon0, _mask); + Accumulator tempsum = new Accumulator(_areasum); + tempsum.Add(g.S12); + int crossings = _crossings + transit(_lon1, _lon0); + if ((crossings & 1) != 0) + tempsum.Add((tempsum.Sum() < 0 ? 1 : -1) * _area0/2); + // area is with the clockwise sense. If !reverse convert to + // counter-clockwise convention. + if (!reverse) + tempsum.Negate(); + // If sign put area in (-area0/2, area0/2], else put area in [0, area0) + if (sign) { + if (tempsum.Sum() > _area0/2) + tempsum.Add(-_area0); + else if (tempsum.Sum() <= -_area0/2) + tempsum.Add(+_area0); + } else { + if (tempsum.Sum() >= _area0) + tempsum.Add(-_area0); + else if (tempsum.Sum() < 0) + tempsum.Add(+_area0); + } + return new PolygonResult(_num, _perimetersum.Sum(g.s12), 0 + tempsum.Sum()); + } + + /** + * Return the results assuming a tentative final test point is added; + * however, the data for the test point is not saved. This lets you report + * a running result for the perimeter and area as the user moves the mouse + * cursor. Ordinary floating point arithmetic is used to accumulate the + * data for the test point; thus the area and perimeter returned are less + * accurate than if AddPoint and Compute are used. + *

+ * @param lat the latitude of the test point (degrees). + * @param lon the longitude of the test point (degrees). + * @param reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @return PolygonResult(num, perimeter, area) where + * num is the number of vertices, perimeter is the perimeter + * of the polygon or the length of the polyline (meters), and area + * is the area of the polygon (meters2) or Double.NaN of + * polyline is true in the constructor. + *

+ * lat should be in the range [−90°, 90°] and lon + * should be in the range [−540°, 540°). + **********************************************************************/ + public PolygonResult TestPoint(double lat, double lon, + boolean reverse, boolean sign) { + if (_num == 0) + return new PolygonResult(1, 0, _polyline ? Double.NaN : 0); + + double perimeter = _perimetersum.Sum(); + double tempsum = _polyline ? 0 : _areasum.Sum(); + int crossings = _crossings; + int num = _num + 1; + for (int i = 0; i < (_polyline ? 1 : 2); ++i) { + GeodesicData g = + _earth.Inverse(i == 0 ? _lat1 : lat, i == 0 ? _lon1 : lon, + i != 0 ? _lat0 : lat, i != 0 ? _lon0 : lon, + _mask); + perimeter += g.s12; + if (!_polyline) { + tempsum += g.S12; + crossings += transit(i == 0 ? _lon1 : lon, + i != 0 ? _lon0 : lon); + } + } + + if (_polyline) + return new PolygonResult(num, perimeter, Double.NaN); + + if ((crossings & 1) != 0) + tempsum += (tempsum < 0 ? 1 : -1) * _area0/2; + // area is with the clockwise sense. If !reverse convert to + // counter-clockwise convention. + if (!reverse) + tempsum *= -1; + // If sign put area in (-area0/2, area0/2], else put area in [0, area0) + if (sign) { + if (tempsum > _area0/2) + tempsum -= _area0; + else if (tempsum <= -_area0/2) + tempsum += _area0; + } else { + if (tempsum >= _area0) + tempsum -= _area0; + else if (tempsum < 0) + tempsum += _area0; + } + return new PolygonResult(num, perimeter, 0 + tempsum); + } + + /** + * Return the results assuming a tentative final test point is added via an + * azimuth and distance; however, the data for the test point is not saved. + * This lets you report a running result for the perimeter and area as the + * user moves the mouse cursor. Ordinary floating point arithmetic is used + * to accumulate the data for the test point; thus the area and perimeter + * returned are less accurate than if AddPoint and Compute are used. + *

+ * @param azi azimuth at current point (degrees). + * @param s distance from current point to final test point (meters). + * @param reverse if true then clockwise (instead of counter-clockwise) + * traversal counts as a positive area. + * @param sign if true then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @return PolygonResult(num, perimeter, area) where + * num is the number of vertices, perimeter is the perimeter + * of the polygon or the length of the polyline (meters), and area + * is the area of the polygon (meters2) or Double.NaN of + * polyline is true in the constructor. + *

+ * azi should be in the range [−540°, 540°). + **********************************************************************/ + public PolygonResult TestEdge(double azi, double s, + boolean reverse, boolean sign) { + if (_num == 0) // we don't have a starting point! + return new PolygonResult(0, Double.NaN, Double.NaN); + + int num = _num + 1; + double perimeter = _perimetersum.Sum() + s; + if (_polyline) + return new PolygonResult(num, perimeter, Double.NaN); + + double tempsum = _areasum.Sum(); + int crossings = _crossings; + { + double lat, lon, s12, S12, t; + GeodesicData g = + _earth.Direct(_lat1, _lon1, azi, false, s, _mask); + tempsum += g.S12; + crossings += transit(_lon1, g.lon2); + g = _earth.Inverse(g.lat2, g.lon2, _lat0, _lon0, _mask); + perimeter += g.s12; + tempsum += g.S12; + crossings += transit(g.lon2, _lon0); + } + + if ((crossings & 1) != 0) + tempsum += (tempsum < 0 ? 1 : -1) * _area0/2; + // area is with the clockwise sense. If !reverse convert to + // counter-clockwise convention. + if (!reverse) + tempsum *= -1; + // If sign put area in (-area0/2, area0/2], else put area in [0, area0) + if (sign) { + if (tempsum > _area0/2) + tempsum -= _area0; + else if (tempsum <= -_area0/2) + tempsum += _area0; + } else { + if (tempsum >= _area0) + tempsum -= _area0; + else if (tempsum < 0) + tempsum += _area0; + } + + return new PolygonResult(num, perimeter, 0 + tempsum); + } + + /** + * @return a the equatorial radius of the ellipsoid (meters). This is + * the value inherited from the Geodesic object used in the constructor. + **********************************************************************/ + + public double MajorRadius() { return _earth.MajorRadius(); } + + /** + * @return f the flattening of the ellipsoid. This is the value + * inherited from the Geodesic object used in the constructor. + **********************************************************************/ + public double Flattening() { return _earth.Flattening(); } + + /** + * Report the previous vertex added to the polygon or polyline. + *

+ * @return Pair(lat, lon), the current latitude and longitude. + *

+ * If no points have been added, then Double.NaN is returned. Otherwise, + * lon will be in the range [−180°, 180°). + **********************************************************************/ + public Pair CurrentPoint() { return new Pair(_lat1, _lon1); } +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/PolygonResult.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/PolygonResult.java new file mode 100644 index 000000000..fdbb7ef1a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/PolygonResult.java @@ -0,0 +1,39 @@ +/** + * Implementation of the net.sf.geographiclib.PolygonResult class + * + * Copyright (c) Charles Karney (2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + **********************************************************************/ +package net.sf.geographiclib; + +/** + * A container for the results from PolygonArea. + **********************************************************************/ +public class PolygonResult { + /** + * The number of vertices in the polygon + **********************************************************************/ + public int num; + /** + * The perimeter of the polygon or the length of the polyline (meters). + **********************************************************************/ + public double perimeter; + /** + * The area of the polygon (meters2). + **********************************************************************/ + public double area; + /** + * Constructor + *

+ * @param num the number of vertices in the polygon. + * @param perimeter the perimeter of the polygon or the length of the + * polyline (meters). + * @param area the area of the polygon (meters2). + **********************************************************************/ + public PolygonResult(int num, double perimeter, double area) { + this.num = num; + this.perimeter = perimeter; + this.area = area; + } +} diff --git a/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/package-info.java b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/package-info.java new file mode 100644 index 000000000..6bceb8f69 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/java/src/main/java/net/sf/geographiclib/package-info.java @@ -0,0 +1,182 @@ +/** + *

Geodesic routines from GeographicLib implemented in Java

+ * @author Charles F. F. Karney (charles@karney.com) + * @version 1.31 + * + *

Abstract

+ *

+ * This is a Java implementation of the geodesic algorithms from GeographicLib. This is a + * self-contained library which makes it easy to do geodesic computations + * for an ellipsoid of revolution in a Java program. It requires Java + * version 1.1 or later. + *

+ *

Downloading the source

+ *

+ * The Java library is part of GeographicLib which available for download at + *

+ *

+ * as either a compressed tar file (tar.gz) or a zip file. After unpacking + * the source, the Java library can be found in GeographicLib-1.31/java. (This + * library is completely independent from the rest of GeodegraphicLib.) The + * library consists of the files in the src/main/java/net/sf/geographiclib + * subdirectory. + *

+ *

Sample programs

+ *

+ * Also included are 3 small test programs + *

    + *
  • + * {@code direct/src/main/java/Direct.java} is a simple command line utility + * for solving the direct geodesic problem; + *
  • + * {@code inverse/src/main/java/Inverse.java} is a simple command line + * utility for solving the inverse geodesic problem; + *
  • + * {@code planimter/src/main/java/Planimeter.java} is a simple command line + * utility for computing the area of a geodesic polygon given its vertices. + *
+ *

+ * Here, for example, is {@code Inverse.java} + *

+ * {@code
+ * // Solve the inverse geodesic problem.
+ *
+ * // This program reads in lines with lat1, lon1, lat2, lon2 and prints
+ * // out lines with azi1, azi2, s12 (for the WGS84 ellipsoid).
+ *
+ * import java.util.*;
+ * import net.sf.geographiclib.*;
+ * public class Inverse {
+ *   public static void main(String[] args) {
+ *     try {
+ *       Scanner in = new Scanner(System.in);
+ *       double lat1, lon1, lat2, lon2;
+ *       while (true) {
+ *         lat1 = in.nextDouble(); lon1 = in.nextDouble();
+ *         lat2 = in.nextDouble(); lon2 = in.nextDouble();
+ *         GeodesicData g = Geodesic.WGS84.Inverse(lat1, lon1, lat2, lon2);
+ *         System.out.println(g.azi1 + " " + g.azi2 + " " + g.s12);
+ *       }
+ *     }
+ *     catch (Exception e) {}
+ *   }
+ * }}
+ *

Compiling and running a sample program

+ * Three difference ways of compiling and running {@code Inverse.java} are + * given. These differ in the degree to which they utilize + * maven to manage your Java code and + * its dependencies. (Thanks to Skip Breidbach for supplying the maven + * support.) + *

Without using maven

+ * Compile and run as follows
+ * cd inverse/src/main/java
+ * javac -cp .:../../../../src/main/java Inverse.java
+ * echo -30 0 29.5 179.5 | java -cp .:../../../../src/main/java Inverse 
+ *

Using maven to package GeographicLib

+ * Use maven to create a jar file by + * running (in the main java directory)
+ * mvn package 
+ * (Your first run of maven may take a long time, because it needs to download + * some additional packages to your local repository.) Then compile and run + * Inverse.java with
+ * cd inverse/src/main/java
+ * javac -cp .:../../../../target/GeographicLib-1.31.jar Inverse.java
+ * echo -30 0 29.5 179.5 |
+ *   java -cp .:../../../../target/GeographicLib-1.31.jar Inverse 
+ *

Using maven to build and run {@code Inverse.java}

+ * Use maven to install GeographicLib by + * running (in the main java directory)
+ * mvn install 
+ * (Your first run of maven may take a long time, because it needs to download + * some additional packages to your local repository.) Then compile and run + * Inverse.java using {@code inverse/pom.xml} with
+ * cd inverse
+ * mvn compile
+ * echo -30 0 29.5 179.5 | mvn -q exec:java 
+ *

Using the library

+ *

+ *

    + *
  • + * Put
    + *   import net.sf.geographiclib.*
    + * in your source code. + *
  • + * Make calls to the geodesic routines from your code. + *
  • + * Compile and run in one of the ways described above. + *
+ *

+ * The important classes are + *

    + *
  • + * {@link net.sf.geographiclib.Geodesic}, for direct and inverse geodesic + * calculations; + *
  • + * {@link net.sf.geographiclib.GeodesicLine}, an efficient way of + * calculating multiple points on a single geodesic; + *
  • + * {@link net.sf.geographiclib.GeodesicData}, the object containing the + * results of the geodesic calculations; + *
  • + * {@link net.sf.geographiclib.GeodesicMask}, the constants that let you + * specify the variables to return in {@link + * net.sf.geographiclib.GeodesicData} and the capabilities of a {@link + * net.sf.geographiclib.GeodesicLine}; + *
  • + * {@link net.sf.geographiclib.Constants}, the parameters for the WGS84 + * ellipsoid; + *
  • + * {@link net.sf.geographiclib.PolygonArea}, a class to compute the + * perimeter and area of a geodesic polygon (returned as a {@link + * net.sf.geographiclib.PolygonResult}). + *
+ *

+ * The documentation is generated using javadoc when {@code mvn package} is run + * (the top of the documentation tree is {@code target/apidocs/index.html}). + * This is also available on the web at + * + * http://geographiclib.sf.net/html/C/index.html. + *

+ *

External links

+ *

+ *

+ **********************************************************************/ +package net.sf.geographiclib; diff --git a/gtsam/3rdparty/GeographicLib/legacy/C/00README.txt b/gtsam/3rdparty/GeographicLib/legacy/C/00README.txt new file mode 100644 index 000000000..45027219a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/C/00README.txt @@ -0,0 +1,27 @@ +This is a C implementation of the geodesic algorithms described in + + C. F. F. Karney, + Algorithms for geodesics, + J. Geodesy 87, 43-55 (2013); + http://dx.doi.org/10.1007/s00190-012-0578-z + Addenda: http://geographiclib.sf.net/geod-addenda.html + +For documentation, see + + http://geographiclib.sourceforge.net/html/C/ + +The code in this directory is entirely self-contained. In particular, +it does not depend on the C++ classes. You can compile and link the +example programs directly with something like: + + cc -o inverse inverse.c geodesic.c -lm + echo 30 0 29.5 179.5 | ./inverse + +Alternatively, you can build the examples using cmake. For example, on +Linux systems you might do: + + mkdir BUILD + cd BUILD + cmake .. + make + echo 30 0 29.5 179.5 | ./inverse diff --git a/gtsam/3rdparty/GeographicLib/legacy/C/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/legacy/C/CMakeLists.txt new file mode 100644 index 000000000..3bdf38f1f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/C/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required (VERSION 2.6) + +project (GeographicLib-legacy-C C) + +# Set a default build type for single-configuration cmake generators if +# no build type is set. +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set (CMAKE_BUILD_TYPE Release) +endif () + +# Make the compiler more picky. +if (WIN32) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4") +else () + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -ansi") +endif () + +set (TOOLS direct inverse planimeter) + +foreach (TOOL ${TOOLS}) + add_executable (${TOOL} ${TOOL}.c geodesic.c geodesic.h) + if (NOT WIN32) + target_link_libraries (${TOOL} m) + endif () +endforeach () diff --git a/gtsam/3rdparty/GeographicLib/legacy/C/direct.c b/gtsam/3rdparty/GeographicLib/legacy/C/direct.c new file mode 100644 index 000000000..b8c113064 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/C/direct.c @@ -0,0 +1,32 @@ +/** + * @file direct.c + * @brief A test program for geod_direct() + **********************************************************************/ + +#include +#include "geodesic.h" + +#if defined(_MSC_VER) +/* Squelch warnings about scanf */ +# pragma warning (disable: 4996) +#endif + +/** + * A simple program to solve the direct geodesic problem. + * + * This program reads in lines with lat1, lon1, azi1, s12 and prints out lines + * with lat2, lon2, azi2 (for the WGS84 ellipsoid). + **********************************************************************/ + +int main() { + double a = 6378137, f = 1/298.257223563; /* WGS84 */ + double lat1, lon1, azi1, lat2, lon2, azi2, s12; + struct geod_geodesic g; + + geod_init(&g, a, f); + while (scanf("%lf %lf %lf %lf\n", &lat1, &lon1, &azi1, &s12) == 4) { + geod_direct(&g, lat1, lon1, azi1, s12, &lat2, &lon2, &azi2); + printf("%.15f %.15f %.15f\n", lat2, lon2, azi2); + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.c b/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.c new file mode 100644 index 000000000..bd9fc960f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.c @@ -0,0 +1,1770 @@ +/** + * \file geodesic.c + * \brief Implementation of the geodesic routines in C + * + * For the full documentation see geodesic.h. + **********************************************************************/ + +/** @cond SKIP */ + +/* + * This is a C implementation of the geodesic algorithms described in + * + * C. F. F. Karney, + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * http://dx.doi.org/10.1007/s00190-012-0578-z + * Addenda: http://geographiclib.sf.net/geod-addenda.html + * + * See the comments in geodesic.h for documentation. + * + * Copyright (c) Charles Karney (2012-2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + */ + +#include "geodesic.h" +#include + +#define GEOGRAPHICLIB_GEODESIC_ORDER 6 +#define nC1 GEOGRAPHICLIB_GEODESIC_ORDER +#define nC1p GEOGRAPHICLIB_GEODESIC_ORDER +#define nC2 GEOGRAPHICLIB_GEODESIC_ORDER +#define nA3 GEOGRAPHICLIB_GEODESIC_ORDER +#define nA3x nA3 +#define nC3 GEOGRAPHICLIB_GEODESIC_ORDER +#define nC3x ((nC3 * (nC3 - 1)) / 2) +#define nC4 GEOGRAPHICLIB_GEODESIC_ORDER +#define nC4x ((nC4 * (nC4 + 1)) / 2) + +typedef double real; +typedef int boolx; + +static unsigned init = 0; +static const int FALSE = 0; +static const int TRUE = 1; +static unsigned digits, maxit1, maxit2; +static real epsilon, realmin, pi, degree, NaN, + tiny, tol0, tol1, tol2, tolb, xthresh; + +static void Init() { + if (!init) { +#if defined(__DBL_MANT_DIG__) + digits = __DBL_MANT_DIG__; +#else + digits = 53; +#endif +#if defined(__DBL_EPSILON__) + epsilon = __DBL_EPSILON__; +#else + epsilon = pow(0.5, digits - 1); +#endif +#if defined(__DBL_MIN__) + realmin = __DBL_MIN__; +#else + realmin = pow(0.5, 1022); +#endif +#if defined(M_PI) + pi = M_PI; +#else + pi = atan2(0.0, -1.0); +#endif + maxit1 = 20; + maxit2 = maxit1 + digits + 10; + tiny = sqrt(realmin); + tol0 = epsilon; + /* Increase multiplier in defn of tol1 from 100 to 200 to fix inverse case + * 52.784459512564 0 -52.784459512563990912 179.634407464943777557 + * which otherwise failed for Visual Studio 10 (Release and Debug) */ + tol1 = 200 * tol0; + tol2 = sqrt(tol0); + /* Check on bisection interval */ + tolb = tol0 * tol2; + xthresh = 1000 * tol2; + degree = pi/180; + NaN = sqrt(-1.0); + init = 1; + } +} + +enum captype { + CAP_NONE = 0U, + CAP_C1 = 1U<<0, + CAP_C1p = 1U<<1, + CAP_C2 = 1U<<2, + CAP_C3 = 1U<<3, + CAP_C4 = 1U<<4, + CAP_ALL = 0x1FU, + OUT_ALL = 0x7F80U +}; + +static real sq(real x) { return x * x; } +static real log1px(real x) { + volatile real + y = 1 + x, + z = y - 1; + /* Here's the explanation for this magic: y = 1 + z, exactly, and z + * approx x, thus log(y)/z (which is nearly constant near z = 0) returns + * a good approximation to the true log(1 + x)/x. The multiplication x * + * (log(y)/z) introduces little additional error. */ + return z == 0 ? x : x * log(y) / z; +} + +static real atanhx(real x) { + real y = fabs(x); /* Enforce odd parity */ + y = log1px(2 * y/(1 - y))/2; + return x < 0 ? -y : y; +} + +static real hypotx(real x, real y) +{ return sqrt(x * x + y * y); } + +static real cbrtx(real x) { + real y = pow(fabs(x), 1/(real)(3)); /* Return the real cube root */ + return x < 0 ? -y : y; +} + +static real sumx(real u, real v, real* t) { + volatile real s = u + v; + volatile real up = s - v; + volatile real vpp = s - up; + up -= u; + vpp -= v; + *t = -(up + vpp); + /* error-free sum: + * u + v = s + t + * = round(u + v) + t */ + return s; +} + +static real minx(real x, real y) +{ return x < y ? x : y; } + +static real maxx(real x, real y) +{ return x > y ? x : y; } + +static void swapx(real* x, real* y) +{ real t = *x; *x = *y; *y = t; } + +static void SinCosNorm(real* sinx, real* cosx) { + real r = hypotx(*sinx, *cosx); + *sinx /= r; + *cosx /= r; +} + +static real AngNormalize(real x) +{ return x >= 180 ? x - 360 : (x < -180 ? x + 360 : x); } +static real AngNormalize2(real x) +{ return AngNormalize(fmod(x, (real)(360))); } + +static real AngDiff(real x, real y) { + real t, d = sumx(-x, y, &t); + if ((d - (real)(180)) + t > (real)(0)) /* y - x > 180 */ + d -= (real)(360); /* exact */ + else if ((d + (real)(180)) + t <= (real)(0)) /* y - x <= -180 */ + d += (real)(360); /* exact */ + return d + t; +} + +static real AngRound(real x) { + const real z = 1/(real)(16); + volatile real y = fabs(x); + /* The compiler mustn't "simplify" z - (z - y) to y */ + y = y < z ? z - (z - y) : y; + return x < 0 ? -y : y; +} + +static void A3coeff(struct geod_geodesic* g); +static void C3coeff(struct geod_geodesic* g); +static void C4coeff(struct geod_geodesic* g); +static real SinCosSeries(boolx sinp, + real sinx, real cosx, + const real c[], int n); +static void Lengths(const struct geod_geodesic* g, + real eps, real sig12, + real ssig1, real csig1, real dn1, + real ssig2, real csig2, real dn2, + real cbet1, real cbet2, + real* ps12b, real* pm12b, real* pm0, + boolx scalep, real* pM12, real* pM21, + /* Scratch areas of the right size */ + real C1a[], real C2a[]); +static real Astroid(real x, real y); +static real InverseStart(const struct geod_geodesic* g, + real sbet1, real cbet1, real dn1, + real sbet2, real cbet2, real dn2, + real lam12, + real* psalp1, real* pcalp1, + /* Only updated if return val >= 0 */ + real* psalp2, real* pcalp2, + /* Only updated for short lines */ + real* pdnm, + /* Scratch areas of the right size */ + real C1a[], real C2a[]); +static real Lambda12(const struct geod_geodesic* g, + real sbet1, real cbet1, real dn1, + real sbet2, real cbet2, real dn2, + real salp1, real calp1, + real* psalp2, real* pcalp2, + real* psig12, + real* pssig1, real* pcsig1, + real* pssig2, real* pcsig2, + real* peps, real* pdomg12, + boolx diffp, real* pdlam12, + /* Scratch areas of the right size */ + real C1a[], real C2a[], real C3a[]); +static real A3f(const struct geod_geodesic* g, real eps); +static void C3f(const struct geod_geodesic* g, real eps, real c[]); +static void C4f(const struct geod_geodesic* g, real eps, real c[]); +static real A1m1f(real eps); +static void C1f(real eps, real c[]); +static void C1pf(real eps, real c[]); +static real A2m1f(real eps); +static void C2f(real eps, real c[]); +static int transit(real lon1, real lon2); +static void accini(real s[]); +static void acccopy(const real s[], real t[]); +static void accadd(real s[], real y); +static real accsum(const real s[], real y); +static void accneg(real s[]); + +void geod_init(struct geod_geodesic* g, real a, real f) { + if (!init) Init(); + g->a = a; + g->f = f <= 1 ? f : 1/f; + g->f1 = 1 - g->f; + g->e2 = g->f * (2 - g->f); + g->ep2 = g->e2 / sq(g->f1); /* e2 / (1 - e2) */ + g->n = g->f / ( 2 - g->f); + g->b = g->a * g->f1; + g->c2 = (sq(g->a) + sq(g->b) * + (g->e2 == 0 ? 1 : + (g->e2 > 0 ? atanhx(sqrt(g->e2)) : atan(sqrt(-g->e2))) / + sqrt(fabs(g->e2))))/2; /* authalic radius squared */ + /* The sig12 threshold for "really short". Using the auxiliary sphere + * solution with dnm computed at (bet1 + bet2) / 2, the relative error in the + * azimuth consistency check is sig12^2 * abs(f) * min(1, 1-f/2) / 2. (Error + * measured for 1/100 < b/a < 100 and abs(f) >= 1/1000. For a given f and + * sig12, the max error occurs for lines near the pole. If the old rule for + * computing dnm = (dn1 + dn2)/2 is used, then the error increases by a + * factor of 2.) Setting this equal to epsilon gives sig12 = etol2. Here + * 0.1 is a safety factor (error decreased by 100) and max(0.001, abs(f)) + * stops etol2 getting too large in the nearly spherical case. */ + g->etol2 = 0.1 * tol2 / + sqrt( maxx((real)(0.001), fabs(g->f)) * minx((real)(1), 1 - g->f/2) / 2 ); + + A3coeff(g); + C3coeff(g); + C4coeff(g); +} + +void geod_lineinit(struct geod_geodesicline* l, + const struct geod_geodesic* g, + real lat1, real lon1, real azi1, unsigned caps) { + real alp1, cbet1, sbet1, phi, eps; + l->a = g->a; + l->f = g->f; + l->b = g->b; + l->c2 = g->c2; + l->f1 = g->f1; + /* If caps is 0 assume the standard direct calculation */ + l->caps = (caps ? caps : GEOD_DISTANCE_IN | GEOD_LONGITUDE) | + GEOD_LATITUDE | GEOD_AZIMUTH; /* Always allow latitude and azimuth */ + + /* Guard against underflow in salp0 */ + azi1 = AngRound(AngNormalize(azi1)); + lon1 = AngNormalize(lon1); + l->lat1 = lat1; + l->lon1 = lon1; + l->azi1 = azi1; + /* alp1 is in [0, pi] */ + alp1 = azi1 * degree; + /* Enforce sin(pi) == 0 and cos(pi/2) == 0. Better to face the ensuing + * problems directly than to skirt them. */ + l->salp1 = azi1 == -180 ? 0 : sin(alp1); + l->calp1 = fabs(azi1) == 90 ? 0 : cos(alp1); + phi = lat1 * degree; + /* Ensure cbet1 = +epsilon at poles */ + sbet1 = l->f1 * sin(phi); + cbet1 = fabs(lat1) == 90 ? tiny : cos(phi); + SinCosNorm(&sbet1, &cbet1); + l->dn1 = sqrt(1 + g->ep2 * sq(sbet1)); + + /* Evaluate alp0 from sin(alp1) * cos(bet1) = sin(alp0), */ + l->salp0 = l->salp1 * cbet1; /* alp0 in [0, pi/2 - |bet1|] */ + /* Alt: calp0 = hypot(sbet1, calp1 * cbet1). The following + * is slightly better (consider the case salp1 = 0). */ + l->calp0 = hypotx(l->calp1, l->salp1 * sbet1); + /* Evaluate sig with tan(bet1) = tan(sig1) * cos(alp1). + * sig = 0 is nearest northward crossing of equator. + * With bet1 = 0, alp1 = pi/2, we have sig1 = 0 (equatorial line). + * With bet1 = pi/2, alp1 = -pi, sig1 = pi/2 + * With bet1 = -pi/2, alp1 = 0 , sig1 = -pi/2 + * Evaluate omg1 with tan(omg1) = sin(alp0) * tan(sig1). + * With alp0 in (0, pi/2], quadrants for sig and omg coincide. + * No atan2(0,0) ambiguity at poles since cbet1 = +epsilon. + * With alp0 = 0, omg1 = 0 for alp1 = 0, omg1 = pi for alp1 = pi. */ + l->ssig1 = sbet1; l->somg1 = l->salp0 * sbet1; + l->csig1 = l->comg1 = sbet1 != 0 || l->calp1 != 0 ? cbet1 * l->calp1 : 1; + SinCosNorm(&l->ssig1, &l->csig1); /* sig1 in (-pi, pi] */ + /* SinCosNorm(somg1, comg1); -- don't need to normalize! */ + + l->k2 = sq(l->calp0) * g->ep2; + eps = l->k2 / (2 * (1 + sqrt(1 + l->k2)) + l->k2); + + if (l->caps & CAP_C1) { + real s, c; + l->A1m1 = A1m1f(eps); + C1f(eps, l->C1a); + l->B11 = SinCosSeries(TRUE, l->ssig1, l->csig1, l->C1a, nC1); + s = sin(l->B11); c = cos(l->B11); + /* tau1 = sig1 + B11 */ + l->stau1 = l->ssig1 * c + l->csig1 * s; + l->ctau1 = l->csig1 * c - l->ssig1 * s; + /* Not necessary because C1pa reverts C1a + * B11 = -SinCosSeries(TRUE, stau1, ctau1, C1pa, nC1p); */ + } + + if (l->caps & CAP_C1p) + C1pf(eps, l->C1pa); + + if (l->caps & CAP_C2) { + l->A2m1 = A2m1f(eps); + C2f(eps, l->C2a); + l->B21 = SinCosSeries(TRUE, l->ssig1, l->csig1, l->C2a, nC2); + } + + if (l->caps & CAP_C3) { + C3f(g, eps, l->C3a); + l->A3c = -l->f * l->salp0 * A3f(g, eps); + l->B31 = SinCosSeries(TRUE, l->ssig1, l->csig1, l->C3a, nC3-1); + } + + if (l->caps & CAP_C4) { + C4f(g, eps, l->C4a); + /* Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0) */ + l->A4 = sq(l->a) * l->calp0 * l->salp0 * g->e2; + l->B41 = SinCosSeries(FALSE, l->ssig1, l->csig1, l->C4a, nC4); + } +} + +real geod_genposition(const struct geod_geodesicline* l, + boolx arcmode, real s12_a12, + real* plat2, real* plon2, real* pazi2, + real* ps12, real* pm12, + real* pM12, real* pM21, + real* pS12) { + real lat2 = 0, lon2 = 0, azi2 = 0, s12 = 0, + m12 = 0, M12 = 0, M21 = 0, S12 = 0; + /* Avoid warning about uninitialized B12. */ + real sig12, ssig12, csig12, B12 = 0, AB1 = 0; + real omg12, lam12, lon12; + real ssig2, csig2, sbet2, cbet2, somg2, comg2, salp2, calp2, dn2; + unsigned outmask = + (plat2 ? GEOD_LATITUDE : 0U) | + (plon2 ? GEOD_LONGITUDE : 0U) | + (pazi2 ? GEOD_AZIMUTH : 0U) | + (ps12 ? GEOD_DISTANCE : 0U) | + (pm12 ? GEOD_REDUCEDLENGTH : 0U) | + (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) | + (pS12 ? GEOD_AREA : 0U); + + outmask &= l->caps & OUT_ALL; + if (!( TRUE /*Init()*/ && + (arcmode || (l->caps & GEOD_DISTANCE_IN & OUT_ALL)) )) + /* Uninitialized or impossible distance calculation requested */ + return NaN; + + if (arcmode) { + real s12a; + /* Interpret s12_a12 as spherical arc length */ + sig12 = s12_a12 * degree; + s12a = fabs(s12_a12); + s12a -= 180 * floor(s12a / 180); + ssig12 = s12a == 0 ? 0 : sin(sig12); + csig12 = s12a == 90 ? 0 : cos(sig12); + } else { + /* Interpret s12_a12 as distance */ + real + tau12 = s12_a12 / (l->b * (1 + l->A1m1)), + s = sin(tau12), + c = cos(tau12); + /* tau2 = tau1 + tau12 */ + B12 = - SinCosSeries(TRUE, + l->stau1 * c + l->ctau1 * s, + l->ctau1 * c - l->stau1 * s, + l->C1pa, nC1p); + sig12 = tau12 - (B12 - l->B11); + ssig12 = sin(sig12); csig12 = cos(sig12); + if (fabs(l->f) > 0.01) { + /* Reverted distance series is inaccurate for |f| > 1/100, so correct + * sig12 with 1 Newton iteration. The following table shows the + * approximate maximum error for a = WGS_a() and various f relative to + * GeodesicExact. + * erri = the error in the inverse solution (nm) + * errd = the error in the direct solution (series only) (nm) + * errda = the error in the direct solution (series + 1 Newton) (nm) + * + * f erri errd errda + * -1/5 12e6 1.2e9 69e6 + * -1/10 123e3 12e6 765e3 + * -1/20 1110 108e3 7155 + * -1/50 18.63 200.9 27.12 + * -1/100 18.63 23.78 23.37 + * -1/150 18.63 21.05 20.26 + * 1/150 22.35 24.73 25.83 + * 1/100 22.35 25.03 25.31 + * 1/50 29.80 231.9 30.44 + * 1/20 5376 146e3 10e3 + * 1/10 829e3 22e6 1.5e6 + * 1/5 157e6 3.8e9 280e6 */ + real + ssig2 = l->ssig1 * csig12 + l->csig1 * ssig12, + csig2 = l->csig1 * csig12 - l->ssig1 * ssig12, + serr; + B12 = SinCosSeries(TRUE, ssig2, csig2, l->C1a, nC1); + serr = (1 + l->A1m1) * (sig12 + (B12 - l->B11)) - s12_a12 / l->b; + sig12 = sig12 - serr / sqrt(1 + l->k2 * sq(ssig2)); + ssig12 = sin(sig12); csig12 = cos(sig12); + /* Update B12 below */ + } + } + + /* sig2 = sig1 + sig12 */ + ssig2 = l->ssig1 * csig12 + l->csig1 * ssig12; + csig2 = l->csig1 * csig12 - l->ssig1 * ssig12; + dn2 = sqrt(1 + l->k2 * sq(ssig2)); + if (outmask & (GEOD_DISTANCE | GEOD_REDUCEDLENGTH | GEOD_GEODESICSCALE)) { + if (arcmode || fabs(l->f) > 0.01) + B12 = SinCosSeries(TRUE, ssig2, csig2, l->C1a, nC1); + AB1 = (1 + l->A1m1) * (B12 - l->B11); + } + /* sin(bet2) = cos(alp0) * sin(sig2) */ + sbet2 = l->calp0 * ssig2; + /* Alt: cbet2 = hypot(csig2, salp0 * ssig2); */ + cbet2 = hypotx(l->salp0, l->calp0 * csig2); + if (cbet2 == 0) + /* I.e., salp0 = 0, csig2 = 0. Break the degeneracy in this case */ + cbet2 = csig2 = tiny; + /* tan(omg2) = sin(alp0) * tan(sig2) */ + somg2 = l->salp0 * ssig2; comg2 = csig2; /* No need to normalize */ + /* tan(alp0) = cos(sig2)*tan(alp2) */ + salp2 = l->salp0; calp2 = l->calp0 * csig2; /* No need to normalize */ + /* omg12 = omg2 - omg1 */ + omg12 = atan2(somg2 * l->comg1 - comg2 * l->somg1, + comg2 * l->comg1 + somg2 * l->somg1); + + if (outmask & GEOD_DISTANCE) + s12 = arcmode ? l->b * ((1 + l->A1m1) * sig12 + AB1) : s12_a12; + + if (outmask & GEOD_LONGITUDE) { + lam12 = omg12 + l->A3c * + ( sig12 + (SinCosSeries(TRUE, ssig2, csig2, l->C3a, nC3-1) + - l->B31)); + lon12 = lam12 / degree; + /* Use AngNormalize2 because longitude might have wrapped multiple + * times. */ + lon12 = AngNormalize2(lon12); + lon2 = AngNormalize(l->lon1 + lon12); + } + + if (outmask & GEOD_LATITUDE) + lat2 = atan2(sbet2, l->f1 * cbet2) / degree; + + if (outmask & GEOD_AZIMUTH) + /* minus signs give range [-180, 180). 0- converts -0 to +0. */ + azi2 = 0 - atan2(-salp2, calp2) / degree; + + if (outmask & (GEOD_REDUCEDLENGTH | GEOD_GEODESICSCALE)) { + real + B22 = SinCosSeries(TRUE, ssig2, csig2, l->C2a, nC2), + AB2 = (1 + l->A2m1) * (B22 - l->B21), + J12 = (l->A1m1 - l->A2m1) * sig12 + (AB1 - AB2); + if (outmask & GEOD_REDUCEDLENGTH) + /* Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure + * accurate cancellation in the case of coincident points. */ + m12 = l->b * ((dn2 * (l->csig1 * ssig2) - l->dn1 * (l->ssig1 * csig2)) + - l->csig1 * csig2 * J12); + if (outmask & GEOD_GEODESICSCALE) { + real t = l->k2 * (ssig2 - l->ssig1) * (ssig2 + l->ssig1) / (l->dn1 + dn2); + M12 = csig12 + (t * ssig2 - csig2 * J12) * l->ssig1 / l->dn1; + M21 = csig12 - (t * l->ssig1 - l->csig1 * J12) * ssig2 / dn2; + } + } + + if (outmask & GEOD_AREA) { + real + B42 = SinCosSeries(FALSE, ssig2, csig2, l->C4a, nC4); + real salp12, calp12; + if (l->calp0 == 0 || l->salp0 == 0) { + /* alp12 = alp2 - alp1, used in atan2 so no need to normalized */ + salp12 = salp2 * l->calp1 - calp2 * l->salp1; + calp12 = calp2 * l->calp1 + salp2 * l->salp1; + /* The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz + * salp12 = -0 and alp12 = -180. However this depends on the sign being + * attached to 0 correctly. The following ensures the correct + * behavior. */ + if (salp12 == 0 && calp12 < 0) { + salp12 = tiny * l->calp1; + calp12 = -1; + } + } else { + /* tan(alp) = tan(alp0) * sec(sig) + * tan(alp2-alp1) = (tan(alp2) -tan(alp1)) / (tan(alp2)*tan(alp1)+1) + * = calp0 * salp0 * (csig1-csig2) / (salp0^2 + calp0^2 * csig1*csig2) + * If csig12 > 0, write + * csig1 - csig2 = ssig12 * (csig1 * ssig12 / (1 + csig12) + ssig1) + * else + * csig1 - csig2 = csig1 * (1 - csig12) + ssig12 * ssig1 + * No need to normalize */ + salp12 = l->calp0 * l->salp0 * + (csig12 <= 0 ? l->csig1 * (1 - csig12) + ssig12 * l->ssig1 : + ssig12 * (l->csig1 * ssig12 / (1 + csig12) + l->ssig1)); + calp12 = sq(l->salp0) + sq(l->calp0) * l->csig1 * csig2; + } + S12 = l->c2 * atan2(salp12, calp12) + l->A4 * (B42 - l->B41); + } + + if (outmask & GEOD_LATITUDE) + *plat2 = lat2; + if (outmask & GEOD_LONGITUDE) + *plon2 = lon2; + if (outmask & GEOD_AZIMUTH) + *pazi2 = azi2; + if (outmask & GEOD_DISTANCE) + *ps12 = s12; + if (outmask & GEOD_REDUCEDLENGTH) + *pm12 = m12; + if (outmask & GEOD_GEODESICSCALE) { + if (pM12) *pM12 = M12; + if (pM21) *pM21 = M21; + } + if (outmask & GEOD_AREA) + *pS12 = S12; + + return arcmode ? s12_a12 : sig12 / degree; +} + +void geod_position(const struct geod_geodesicline* l, real s12, + real* plat2, real* plon2, real* pazi2) { + geod_genposition(l, FALSE, s12, plat2, plon2, pazi2, 0, 0, 0, 0, 0); +} + +real geod_gendirect(const struct geod_geodesic* g, + real lat1, real lon1, real azi1, + boolx arcmode, real s12_a12, + real* plat2, real* plon2, real* pazi2, + real* ps12, real* pm12, real* pM12, real* pM21, + real* pS12) { + struct geod_geodesicline l; + unsigned outmask = + (plat2 ? GEOD_LATITUDE : 0U) | + (plon2 ? GEOD_LONGITUDE : 0U) | + (pazi2 ? GEOD_AZIMUTH : 0U) | + (ps12 ? GEOD_DISTANCE : 0U) | + (pm12 ? GEOD_REDUCEDLENGTH : 0U) | + (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) | + (pS12 ? GEOD_AREA : 0U); + + geod_lineinit(&l, g, lat1, lon1, azi1, + /* Automatically supply GEOD_DISTANCE_IN if necessary */ + outmask | (arcmode ? GEOD_NONE : GEOD_DISTANCE_IN)); + return geod_genposition(&l, arcmode, s12_a12, + plat2, plon2, pazi2, ps12, pm12, pM12, pM21, pS12); +} + +void geod_direct(const struct geod_geodesic* g, + real lat1, real lon1, real azi1, + real s12, + real* plat2, real* plon2, real* pazi2) { + geod_gendirect(g, lat1, lon1, azi1, FALSE, s12, plat2, plon2, pazi2, + 0, 0, 0, 0, 0); +} + +real geod_geninverse(const struct geod_geodesic* g, + real lat1, real lon1, real lat2, real lon2, + real* ps12, real* pazi1, real* pazi2, + real* pm12, real* pM12, real* pM21, real* pS12) { + real s12 = 0, azi1 = 0, azi2 = 0, m12 = 0, M12 = 0, M21 = 0, S12 = 0; + real lon12; + int latsign, lonsign, swapp; + real phi, sbet1, cbet1, sbet2, cbet2, s12x = 0, m12x = 0; + real dn1, dn2, lam12, slam12, clam12; + real a12 = 0, sig12, calp1 = 0, salp1 = 0, calp2 = 0, salp2 = 0; + /* index zero elements of these arrays are unused */ + real C1a[nC1 + 1], C2a[nC2 + 1], C3a[nC3]; + boolx meridian; + real omg12 = 0; + + unsigned outmask = + (ps12 ? GEOD_DISTANCE : 0U) | + (pazi1 || pazi2 ? GEOD_AZIMUTH : 0U) | + (pm12 ? GEOD_REDUCEDLENGTH : 0U) | + (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) | + (pS12 ? GEOD_AREA : 0U); + + outmask &= OUT_ALL; + /* Compute longitude difference (AngDiff does this carefully). Result is + * in [-180, 180] but -180 is only for west-going geodesics. 180 is for + * east-going and meridional geodesics. */ + lon12 = AngDiff(AngNormalize(lon1), AngNormalize(lon2)); + /* If very close to being on the same half-meridian, then make it so. */ + lon12 = AngRound(lon12); + /* Make longitude difference positive. */ + lonsign = lon12 >= 0 ? 1 : -1; + lon12 *= lonsign; + /* If really close to the equator, treat as on equator. */ + lat1 = AngRound(lat1); + lat2 = AngRound(lat2); + /* Swap points so that point with higher (abs) latitude is point 1 */ + swapp = fabs(lat1) >= fabs(lat2) ? 1 : -1; + if (swapp < 0) { + lonsign *= -1; + swapx(&lat1, &lat2); + } + /* Make lat1 <= 0 */ + latsign = lat1 < 0 ? 1 : -1; + lat1 *= latsign; + lat2 *= latsign; + /* Now we have + * + * 0 <= lon12 <= 180 + * -90 <= lat1 <= 0 + * lat1 <= lat2 <= -lat1 + * + * longsign, swapp, latsign register the transformation to bring the + * coordinates to this canonical form. In all cases, 1 means no change was + * made. We make these transformations so that there are few cases to + * check, e.g., on verifying quadrants in atan2. In addition, this + * enforces some symmetries in the results returned. */ + + phi = lat1 * degree; + /* Ensure cbet1 = +epsilon at poles */ + sbet1 = g->f1 * sin(phi); + cbet1 = lat1 == -90 ? tiny : cos(phi); + SinCosNorm(&sbet1, &cbet1); + + phi = lat2 * degree; + /* Ensure cbet2 = +epsilon at poles */ + sbet2 = g->f1 * sin(phi); + cbet2 = fabs(lat2) == 90 ? tiny : cos(phi); + SinCosNorm(&sbet2, &cbet2); + + /* If cbet1 < -sbet1, then cbet2 - cbet1 is a sensitive measure of the + * |bet1| - |bet2|. Alternatively (cbet1 >= -sbet1), abs(sbet2) + sbet1 is + * a better measure. This logic is used in assigning calp2 in Lambda12. + * Sometimes these quantities vanish and in that case we force bet2 = +/- + * bet1 exactly. An example where is is necessary is the inverse problem + * 48.522876735459 0 -48.52287673545898293 179.599720456223079643 + * which failed with Visual Studio 10 (Release and Debug) */ + + if (cbet1 < -sbet1) { + if (cbet2 == cbet1) + sbet2 = sbet2 < 0 ? sbet1 : -sbet1; + } else { + if (fabs(sbet2) == -sbet1) + cbet2 = cbet1; + } + + dn1 = sqrt(1 + g->ep2 * sq(sbet1)); + dn2 = sqrt(1 + g->ep2 * sq(sbet2)); + + lam12 = lon12 * degree; + slam12 = lon12 == 180 ? 0 : sin(lam12); + clam12 = cos(lam12); /* lon12 == 90 isn't interesting */ + + meridian = lat1 == -90 || slam12 == 0; + + if (meridian) { + + /* Endpoints are on a single full meridian, so the geodesic might lie on + * a meridian. */ + + real ssig1, csig1, ssig2, csig2; + calp1 = clam12; salp1 = slam12; /* Head to the target longitude */ + calp2 = 1; salp2 = 0; /* At the target we're heading north */ + + /* tan(bet) = tan(sig) * cos(alp) */ + ssig1 = sbet1; csig1 = calp1 * cbet1; + ssig2 = sbet2; csig2 = calp2 * cbet2; + + /* sig12 = sig2 - sig1 */ + sig12 = atan2(maxx(csig1 * ssig2 - ssig1 * csig2, (real)(0)), + csig1 * csig2 + ssig1 * ssig2); + { + real dummy; + Lengths(g, g->n, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, + cbet1, cbet2, &s12x, &m12x, &dummy, + (outmask & GEOD_GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a); + } + /* Add the check for sig12 since zero length geodesics might yield m12 < + * 0. Test case was + * + * echo 20.001 0 20.001 0 | Geod -i + * + * In fact, we will have sig12 > pi/2 for meridional geodesic which is + * not a shortest path. */ + if (sig12 < 1 || m12x >= 0) { + m12x *= g->b; + s12x *= g->b; + a12 = sig12 / degree; + } else + /* m12 < 0, i.e., prolate and too close to anti-podal */ + meridian = FALSE; + } + + if (!meridian && + sbet1 == 0 && /* and sbet2 == 0 */ + /* Mimic the way Lambda12 works with calp1 = 0 */ + (g->f <= 0 || lam12 <= pi - g->f * pi)) { + + /* Geodesic runs along equator */ + calp1 = calp2 = 0; salp1 = salp2 = 1; + s12x = g->a * lam12; + sig12 = omg12 = lam12 / g->f1; + m12x = g->b * sin(sig12); + if (outmask & GEOD_GEODESICSCALE) + M12 = M21 = cos(sig12); + a12 = lon12 / g->f1; + + } else if (!meridian) { + + /* Now point1 and point2 belong within a hemisphere bounded by a + * meridian and geodesic is neither meridional or equatorial. */ + + /* Figure a starting point for Newton's method */ + real dnm = 0; + sig12 = InverseStart(g, sbet1, cbet1, dn1, sbet2, cbet2, dn2, + lam12, + &salp1, &calp1, &salp2, &calp2, &dnm, + C1a, C2a); + + if (sig12 >= 0) { + /* Short lines (InverseStart sets salp2, calp2, dnm) */ + s12x = sig12 * g->b * dnm; + m12x = sq(dnm) * g->b * sin(sig12 / dnm); + if (outmask & GEOD_GEODESICSCALE) + M12 = M21 = cos(sig12 / dnm); + a12 = sig12 / degree; + omg12 = lam12 / (g->f1 * dnm); + } else { + + /* Newton's method. This is a straightforward solution of f(alp1) = + * lambda12(alp1) - lam12 = 0 with one wrinkle. f(alp) has exactly one + * root in the interval (0, pi) and its derivative is positive at the + * root. Thus f(alp) is positive for alp > alp1 and negative for alp < + * alp1. During the course of the iteration, a range (alp1a, alp1b) is + * maintained which brackets the root and with each evaluation of + * f(alp) the range is shrunk, if possible. Newton's method is + * restarted whenever the derivative of f is negative (because the new + * value of alp1 is then further from the solution) or if the new + * estimate of alp1 lies outside (0,pi); in this case, the new starting + * guess is taken to be (alp1a + alp1b) / 2. */ + real ssig1 = 0, csig1 = 0, ssig2 = 0, csig2 = 0, eps = 0; + unsigned numit = 0; + /* Bracketing range */ + real salp1a = tiny, calp1a = 1, salp1b = tiny, calp1b = -1; + boolx tripn, tripb; + for (tripn = FALSE, tripb = FALSE; numit < maxit2; ++numit) { + /* the WGS84 test set: mean = 1.47, sd = 1.25, max = 16 + * WGS84 and random input: mean = 2.85, sd = 0.60 */ + real dv, + v = (Lambda12(g, sbet1, cbet1, dn1, sbet2, cbet2, dn2, salp1, calp1, + &salp2, &calp2, &sig12, &ssig1, &csig1, &ssig2, &csig2, + &eps, &omg12, numit < maxit1, &dv, C1a, C2a, C3a) + - lam12); + /* 2 * tol0 is approximately 1 ulp for a number in [0, pi]. */ + /* Reversed test to allow escape with NaNs */ + if (tripb || !(fabs(v) >= (tripn ? 8 : 2) * tol0)) break; + /* Update bracketing values */ + if (v > 0 && (numit > maxit1 || calp1/salp1 > calp1b/salp1b)) + { salp1b = salp1; calp1b = calp1; } + else if (v < 0 && (numit > maxit1 || calp1/salp1 < calp1a/salp1a)) + { salp1a = salp1; calp1a = calp1; } + if (numit < maxit1 && dv > 0) { + real + dalp1 = -v/dv; + real + sdalp1 = sin(dalp1), cdalp1 = cos(dalp1), + nsalp1 = salp1 * cdalp1 + calp1 * sdalp1; + if (nsalp1 > 0 && fabs(dalp1) < pi) { + calp1 = calp1 * cdalp1 - salp1 * sdalp1; + salp1 = nsalp1; + SinCosNorm(&salp1, &calp1); + /* In some regimes we don't get quadratic convergence because + * slope -> 0. So use convergence conditions based on epsilon + * instead of sqrt(epsilon). */ + tripn = fabs(v) <= 16 * tol0; + continue; + } + } + /* Either dv was not postive or updated value was outside legal + * range. Use the midpoint of the bracket as the next estimate. + * This mechanism is not needed for the WGS84 ellipsoid, but it does + * catch problems with more eccentric ellipsoids. Its efficacy is + * such for the WGS84 test set with the starting guess set to alp1 = + * 90deg: + * the WGS84 test set: mean = 5.21, sd = 3.93, max = 24 + * WGS84 and random input: mean = 4.74, sd = 0.99 */ + salp1 = (salp1a + salp1b)/2; + calp1 = (calp1a + calp1b)/2; + SinCosNorm(&salp1, &calp1); + tripn = FALSE; + tripb = (fabs(salp1a - salp1) + (calp1a - calp1) < tolb || + fabs(salp1 - salp1b) + (calp1 - calp1b) < tolb); + } + { + real dummy; + Lengths(g, eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, + cbet1, cbet2, &s12x, &m12x, &dummy, + (outmask & GEOD_GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a); + } + m12x *= g->b; + s12x *= g->b; + a12 = sig12 / degree; + omg12 = lam12 - omg12; + } + } + + if (outmask & GEOD_DISTANCE) + s12 = 0 + s12x; /* Convert -0 to 0 */ + + if (outmask & GEOD_REDUCEDLENGTH) + m12 = 0 + m12x; /* Convert -0 to 0 */ + + if (outmask & GEOD_AREA) { + real + /* From Lambda12: sin(alp1) * cos(bet1) = sin(alp0) */ + salp0 = salp1 * cbet1, + calp0 = hypotx(calp1, salp1 * sbet1); /* calp0 > 0 */ + real alp12; + if (calp0 != 0 && salp0 != 0) { + real + /* From Lambda12: tan(bet) = tan(sig) * cos(alp) */ + ssig1 = sbet1, csig1 = calp1 * cbet1, + ssig2 = sbet2, csig2 = calp2 * cbet2, + k2 = sq(calp0) * g->ep2, + eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2), + /* Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0). */ + A4 = sq(g->a) * calp0 * salp0 * g->e2; + real C4a[nC4]; + real B41, B42; + SinCosNorm(&ssig1, &csig1); + SinCosNorm(&ssig2, &csig2); + C4f(g, eps, C4a); + B41 = SinCosSeries(FALSE, ssig1, csig1, C4a, nC4); + B42 = SinCosSeries(FALSE, ssig2, csig2, C4a, nC4); + S12 = A4 * (B42 - B41); + } else + /* Avoid problems with indeterminate sig1, sig2 on equator */ + S12 = 0; + + if (!meridian && + omg12 < (real)(0.75) * pi && /* Long difference too big */ + sbet2 - sbet1 < (real)(1.75)) { /* Lat difference too big */ + /* Use tan(Gamma/2) = tan(omg12/2) + * * (tan(bet1/2)+tan(bet2/2))/(1+tan(bet1/2)*tan(bet2/2)) + * with tan(x/2) = sin(x)/(1+cos(x)) */ + real + somg12 = sin(omg12), domg12 = 1 + cos(omg12), + dbet1 = 1 + cbet1, dbet2 = 1 + cbet2; + alp12 = 2 * atan2( somg12 * ( sbet1 * dbet2 + sbet2 * dbet1 ), + domg12 * ( sbet1 * sbet2 + dbet1 * dbet2 ) ); + } else { + /* alp12 = alp2 - alp1, used in atan2 so no need to normalize */ + real + salp12 = salp2 * calp1 - calp2 * salp1, + calp12 = calp2 * calp1 + salp2 * salp1; + /* The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz + * salp12 = -0 and alp12 = -180. However this depends on the sign + * being attached to 0 correctly. The following ensures the correct + * behavior. */ + if (salp12 == 0 && calp12 < 0) { + salp12 = tiny * calp1; + calp12 = -1; + } + alp12 = atan2(salp12, calp12); + } + S12 += g->c2 * alp12; + S12 *= swapp * lonsign * latsign; + /* Convert -0 to 0 */ + S12 += 0; + } + + /* Convert calp, salp to azimuth accounting for lonsign, swapp, latsign. */ + if (swapp < 0) { + swapx(&salp1, &salp2); + swapx(&calp1, &calp2); + if (outmask & GEOD_GEODESICSCALE) + swapx(&M12, &M21); + } + + salp1 *= swapp * lonsign; calp1 *= swapp * latsign; + salp2 *= swapp * lonsign; calp2 *= swapp * latsign; + + if (outmask & GEOD_AZIMUTH) { + /* minus signs give range [-180, 180). 0- converts -0 to +0. */ + azi1 = 0 - atan2(-salp1, calp1) / degree; + azi2 = 0 - atan2(-salp2, calp2) / degree; + } + + if (outmask & GEOD_DISTANCE) + *ps12 = s12; + if (outmask & GEOD_AZIMUTH) { + if (pazi1) *pazi1 = azi1; + if (pazi2) *pazi2 = azi2; + } + if (outmask & GEOD_REDUCEDLENGTH) + *pm12 = m12; + if (outmask & GEOD_GEODESICSCALE) { + if (pM12) *pM12 = M12; + if (pM21) *pM21 = M21; + } + if (outmask & GEOD_AREA) + *pS12 = S12; + + /* Returned value in [0, 180] */ + return a12; +} + +void geod_inverse(const struct geod_geodesic* g, + real lat1, real lon1, real lat2, real lon2, + real* ps12, real* pazi1, real* pazi2) { + geod_geninverse(g, lat1, lon1, lat2, lon2, ps12, pazi1, pazi2, 0, 0, 0, 0); +} + +real SinCosSeries(boolx sinp, real sinx, real cosx, const real c[], int n) { + /* Evaluate + * y = sinp ? sum(c[i] * sin( 2*i * x), i, 1, n) : + * sum(c[i] * cos((2*i+1) * x), i, 0, n-1) + * using Clenshaw summation. N.B. c[0] is unused for sin series + * Approx operation count = (n + 5) mult and (2 * n + 2) add */ + real ar, y0, y1; + c += (n + sinp); /* Point to one beyond last element */ + ar = 2 * (cosx - sinx) * (cosx + sinx); /* 2 * cos(2 * x) */ + y0 = n & 1 ? *--c : 0; y1 = 0; /* accumulators for sum */ + /* Now n is even */ + n /= 2; + while (n--) { + /* Unroll loop x 2, so accumulators return to their original role */ + y1 = ar * y0 - y1 + *--c; + y0 = ar * y1 - y0 + *--c; + } + return sinp + ? 2 * sinx * cosx * y0 /* sin(2 * x) * y0 */ + : cosx * (y0 - y1); /* cos(x) * (y0 - y1) */ +} + +void Lengths(const struct geod_geodesic* g, + real eps, real sig12, + real ssig1, real csig1, real dn1, + real ssig2, real csig2, real dn2, + real cbet1, real cbet2, + real* ps12b, real* pm12b, real* pm0, + boolx scalep, real* pM12, real* pM21, + /* Scratch areas of the right size */ + real C1a[], real C2a[]) { + real s12b = 0, m12b = 0, m0 = 0, M12 = 0, M21 = 0; + real A1m1, AB1, A2m1, AB2, J12; + + /* Return m12b = (reduced length)/b; also calculate s12b = distance/b, + * and m0 = coefficient of secular term in expression for reduced length. */ + C1f(eps, C1a); + C2f(eps, C2a); + A1m1 = A1m1f(eps); + AB1 = (1 + A1m1) * (SinCosSeries(TRUE, ssig2, csig2, C1a, nC1) - + SinCosSeries(TRUE, ssig1, csig1, C1a, nC1)); + A2m1 = A2m1f(eps); + AB2 = (1 + A2m1) * (SinCosSeries(TRUE, ssig2, csig2, C2a, nC2) - + SinCosSeries(TRUE, ssig1, csig1, C2a, nC2)); + m0 = A1m1 - A2m1; + J12 = m0 * sig12 + (AB1 - AB2); + /* Missing a factor of b. + * Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure accurate + * cancellation in the case of coincident points. */ + m12b = dn2 * (csig1 * ssig2) - dn1 * (ssig1 * csig2) - csig1 * csig2 * J12; + /* Missing a factor of b */ + s12b = (1 + A1m1) * sig12 + AB1; + if (scalep) { + real csig12 = csig1 * csig2 + ssig1 * ssig2; + real t = g->ep2 * (cbet1 - cbet2) * (cbet1 + cbet2) / (dn1 + dn2); + M12 = csig12 + (t * ssig2 - csig2 * J12) * ssig1 / dn1; + M21 = csig12 - (t * ssig1 - csig1 * J12) * ssig2 / dn2; + } + *ps12b = s12b; + *pm12b = m12b; + *pm0 = m0; + if (scalep) { + *pM12 = M12; + *pM21 = M21; + } +} + +real Astroid(real x, real y) { + /* Solve k^4+2*k^3-(x^2+y^2-1)*k^2-2*y^2*k-y^2 = 0 for positive root k. + * This solution is adapted from Geocentric::Reverse. */ + real k; + real + p = sq(x), + q = sq(y), + r = (p + q - 1) / 6; + if ( !(q == 0 && r <= 0) ) { + real + /* Avoid possible division by zero when r = 0 by multiplying equations + * for s and t by r^3 and r, resp. */ + S = p * q / 4, /* S = r^3 * s */ + r2 = sq(r), + r3 = r * r2, + /* The discrimant of the quadratic equation for T3. This is zero on + * the evolute curve p^(1/3)+q^(1/3) = 1 */ + disc = S * (S + 2 * r3); + real u = r; + real v, uv, w; + if (disc >= 0) { + real T3 = S + r3, T; + /* Pick the sign on the sqrt to maximize abs(T3). This minimizes loss + * of precision due to cancellation. The result is unchanged because + * of the way the T is used in definition of u. */ + T3 += T3 < 0 ? -sqrt(disc) : sqrt(disc); /* T3 = (r * t)^3 */ + /* N.B. cbrtx always returns the real root. cbrtx(-8) = -2. */ + T = cbrtx(T3); /* T = r * t */ + /* T can be zero; but then r2 / T -> 0. */ + u += T + (T != 0 ? r2 / T : 0); + } else { + /* T is complex, but the way u is defined the result is real. */ + real ang = atan2(sqrt(-disc), -(S + r3)); + /* There are three possible cube roots. We choose the root which + * avoids cancellation. Note that disc < 0 implies that r < 0. */ + u += 2 * r * cos(ang / 3); + } + v = sqrt(sq(u) + q); /* guaranteed positive */ + /* Avoid loss of accuracy when u < 0. */ + uv = u < 0 ? q / (v - u) : u + v; /* u+v, guaranteed positive */ + w = (uv - q) / (2 * v); /* positive? */ + /* Rearrange expression for k to avoid loss of accuracy due to + * subtraction. Division by 0 not possible because uv > 0, w >= 0. */ + k = uv / (sqrt(uv + sq(w)) + w); /* guaranteed positive */ + } else { /* q == 0 && r <= 0 */ + /* y = 0 with |x| <= 1. Handle this case directly. + * for y small, positive root is k = abs(y)/sqrt(1-x^2) */ + k = 0; + } + return k; +} + +real InverseStart(const struct geod_geodesic* g, + real sbet1, real cbet1, real dn1, + real sbet2, real cbet2, real dn2, + real lam12, + real* psalp1, real* pcalp1, + /* Only updated if return val >= 0 */ + real* psalp2, real* pcalp2, + /* Only updated for short lines */ + real* pdnm, + /* Scratch areas of the right size */ + real C1a[], real C2a[]) { + real salp1 = 0, calp1 = 0, salp2 = 0, calp2 = 0, dnm = 0; + + /* Return a starting point for Newton's method in salp1 and calp1 (function + * value is -1). If Newton's method doesn't need to be used, return also + * salp2 and calp2 and function value is sig12. */ + real + sig12 = -1, /* Return value */ + /* bet12 = bet2 - bet1 in [0, pi); bet12a = bet2 + bet1 in (-pi, 0] */ + sbet12 = sbet2 * cbet1 - cbet2 * sbet1, + cbet12 = cbet2 * cbet1 + sbet2 * sbet1; +#if defined(__GNUC__) && __GNUC__ == 4 && \ + (__GNUC_MINOR__ < 6 || defined(__MINGW32__)) + /* Volatile declaration needed to fix inverse cases + * 88.202499451857 0 -88.202499451857 179.981022032992859592 + * 89.262080389218 0 -89.262080389218 179.992207982775375662 + * 89.333123580033 0 -89.333123580032997687 179.99295812360148422 + * which otherwise fail with g++ 4.4.4 x86 -O3 (Linux) + * and g++ 4.4.0 (mingw) and g++ 4.6.1 (tdm mingw). */ + real sbet12a; + { + volatile real xx1 = sbet2 * cbet1; + volatile real xx2 = cbet2 * sbet1; + sbet12a = xx1 + xx2; + } +#else + real sbet12a = sbet2 * cbet1 + cbet2 * sbet1; +#endif + boolx shortline = cbet12 >= 0 && sbet12 < (real)(0.5) && + cbet2 * lam12 < (real)(0.5); + real omg12 = lam12, somg12, comg12, ssig12, csig12; + if (shortline) { + real sbetm2 = sq(sbet1 + sbet2); + /* sin((bet1+bet2)/2)^2 + * = (sbet1 + sbet2)^2 / ((sbet1 + sbet2)^2 + (cbet1 + cbet2)^2) */ + sbetm2 /= sbetm2 + sq(cbet1 + cbet2); + dnm = sqrt(1 + g->ep2 * sbetm2); + omg12 /= g->f1 * dnm; + } + somg12 = sin(omg12); comg12 = cos(omg12); + + salp1 = cbet2 * somg12; + calp1 = comg12 >= 0 ? + sbet12 + cbet2 * sbet1 * sq(somg12) / (1 + comg12) : + sbet12a - cbet2 * sbet1 * sq(somg12) / (1 - comg12); + + ssig12 = hypotx(salp1, calp1); + csig12 = sbet1 * sbet2 + cbet1 * cbet2 * comg12; + + if (shortline && ssig12 < g->etol2) { + /* really short lines */ + salp2 = cbet1 * somg12; + calp2 = sbet12 - cbet1 * sbet2 * + (comg12 >= 0 ? sq(somg12) / (1 + comg12) : 1 - comg12); + SinCosNorm(&salp2, &calp2); + /* Set return value */ + sig12 = atan2(ssig12, csig12); + } else if (fabs(g->n) > (real)(0.1) || /* No astroid calc if too eccentric */ + csig12 >= 0 || + ssig12 >= 6 * fabs(g->n) * pi * sq(cbet1)) { + /* Nothing to do, zeroth order spherical approximation is OK */ + } else { + /* Scale lam12 and bet2 to x, y coordinate system where antipodal point + * is at origin and singular point is at y = 0, x = -1. */ + real y, lamscale, betscale; + /* Volatile declaration needed to fix inverse case + * 56.320923501171 0 -56.320923501171 179.664747671772880215 + * which otherwise fails with g++ 4.4.4 x86 -O3 */ + volatile real x; + if (g->f >= 0) { /* In fact f == 0 does not get here */ + /* x = dlong, y = dlat */ + { + real + k2 = sq(sbet1) * g->ep2, + eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2); + lamscale = g->f * cbet1 * A3f(g, eps) * pi; + } + betscale = lamscale * cbet1; + + x = (lam12 - pi) / lamscale; + y = sbet12a / betscale; + } else { /* f < 0 */ + /* x = dlat, y = dlong */ + real + cbet12a = cbet2 * cbet1 - sbet2 * sbet1, + bet12a = atan2(sbet12a, cbet12a); + real m12b, m0, dummy; + /* In the case of lon12 = 180, this repeats a calculation made in + * Inverse. */ + Lengths(g, g->n, pi + bet12a, + sbet1, -cbet1, dn1, sbet2, cbet2, dn2, + cbet1, cbet2, &dummy, &m12b, &m0, FALSE, + &dummy, &dummy, C1a, C2a); + x = -1 + m12b / (cbet1 * cbet2 * m0 * pi); + betscale = x < -(real)(0.01) ? sbet12a / x : + -g->f * sq(cbet1) * pi; + lamscale = betscale / cbet1; + y = (lam12 - pi) / lamscale; + } + + if (y > -tol1 && x > -1 - xthresh) { + /* strip near cut */ + if (g->f >= 0) { + salp1 = minx((real)(1), -(real)(x)); calp1 = - sqrt(1 - sq(salp1)); + } else { + calp1 = maxx((real)(x > -tol1 ? 0 : -1), (real)(x)); + salp1 = sqrt(1 - sq(calp1)); + } + } else { + /* Estimate alp1, by solving the astroid problem. + * + * Could estimate alpha1 = theta + pi/2, directly, i.e., + * calp1 = y/k; salp1 = -x/(1+k); for f >= 0 + * calp1 = x/(1+k); salp1 = -y/k; for f < 0 (need to check) + * + * However, it's better to estimate omg12 from astroid and use + * spherical formula to compute alp1. This reduces the mean number of + * Newton iterations for astroid cases from 2.24 (min 0, max 6) to 2.12 + * (min 0 max 5). The changes in the number of iterations are as + * follows: + * + * change percent + * 1 5 + * 0 78 + * -1 16 + * -2 0.6 + * -3 0.04 + * -4 0.002 + * + * The histogram of iterations is (m = number of iterations estimating + * alp1 directly, n = number of iterations estimating via omg12, total + * number of trials = 148605): + * + * iter m n + * 0 148 186 + * 1 13046 13845 + * 2 93315 102225 + * 3 36189 32341 + * 4 5396 7 + * 5 455 1 + * 6 56 0 + * + * Because omg12 is near pi, estimate work with omg12a = pi - omg12 */ + real k = Astroid(x, y); + real + omg12a = lamscale * ( g->f >= 0 ? -x * k/(1 + k) : -y * (1 + k)/k ); + somg12 = sin(omg12a); comg12 = -cos(omg12a); + /* Update spherical estimate of alp1 using omg12 instead of lam12 */ + salp1 = cbet2 * somg12; + calp1 = sbet12a - cbet2 * sbet1 * sq(somg12) / (1 - comg12); + } + } + if (salp1 > 0) /* Sanity check on starting guess */ + SinCosNorm(&salp1, &calp1); + else { + salp1 = 1; calp1 = 0; + } + + *psalp1 = salp1; + *pcalp1 = calp1; + if (shortline) + *pdnm = dnm; + if (sig12 >= 0) { + *psalp2 = salp2; + *pcalp2 = calp2; + } + return sig12; +} + +real Lambda12(const struct geod_geodesic* g, + real sbet1, real cbet1, real dn1, + real sbet2, real cbet2, real dn2, + real salp1, real calp1, + real* psalp2, real* pcalp2, + real* psig12, + real* pssig1, real* pcsig1, + real* pssig2, real* pcsig2, + real* peps, real* pdomg12, + boolx diffp, real* pdlam12, + /* Scratch areas of the right size */ + real C1a[], real C2a[], real C3a[]) { + real salp2 = 0, calp2 = 0, sig12 = 0, + ssig1 = 0, csig1 = 0, ssig2 = 0, csig2 = 0, eps = 0, domg12 = 0, dlam12 = 0; + real salp0, calp0; + real somg1, comg1, somg2, comg2, omg12, lam12; + real B312, h0, k2; + + if (sbet1 == 0 && calp1 == 0) + /* Break degeneracy of equatorial line. This case has already been + * handled. */ + calp1 = -tiny; + + /* sin(alp1) * cos(bet1) = sin(alp0) */ + salp0 = salp1 * cbet1; + calp0 = hypotx(calp1, salp1 * sbet1); /* calp0 > 0 */ + + /* tan(bet1) = tan(sig1) * cos(alp1) + * tan(omg1) = sin(alp0) * tan(sig1) = tan(omg1)=tan(alp1)*sin(bet1) */ + ssig1 = sbet1; somg1 = salp0 * sbet1; + csig1 = comg1 = calp1 * cbet1; + SinCosNorm(&ssig1, &csig1); + /* SinCosNorm(&somg1, &comg1); -- don't need to normalize! */ + + /* Enforce symmetries in the case abs(bet2) = -bet1. Need to be careful + * about this case, since this can yield singularities in the Newton + * iteration. + * sin(alp2) * cos(bet2) = sin(alp0) */ + salp2 = cbet2 != cbet1 ? salp0 / cbet2 : salp1; + /* calp2 = sqrt(1 - sq(salp2)) + * = sqrt(sq(calp0) - sq(sbet2)) / cbet2 + * and subst for calp0 and rearrange to give (choose positive sqrt + * to give alp2 in [0, pi/2]). */ + calp2 = cbet2 != cbet1 || fabs(sbet2) != -sbet1 ? + sqrt(sq(calp1 * cbet1) + + (cbet1 < -sbet1 ? + (cbet2 - cbet1) * (cbet1 + cbet2) : + (sbet1 - sbet2) * (sbet1 + sbet2))) / cbet2 : + fabs(calp1); + /* tan(bet2) = tan(sig2) * cos(alp2) + * tan(omg2) = sin(alp0) * tan(sig2). */ + ssig2 = sbet2; somg2 = salp0 * sbet2; + csig2 = comg2 = calp2 * cbet2; + SinCosNorm(&ssig2, &csig2); + /* SinCosNorm(&somg2, &comg2); -- don't need to normalize! */ + + /* sig12 = sig2 - sig1, limit to [0, pi] */ + sig12 = atan2(maxx(csig1 * ssig2 - ssig1 * csig2, (real)(0)), + csig1 * csig2 + ssig1 * ssig2); + + /* omg12 = omg2 - omg1, limit to [0, pi] */ + omg12 = atan2(maxx(comg1 * somg2 - somg1 * comg2, (real)(0)), + comg1 * comg2 + somg1 * somg2); + k2 = sq(calp0) * g->ep2; + eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2); + C3f(g, eps, C3a); + B312 = (SinCosSeries(TRUE, ssig2, csig2, C3a, nC3-1) - + SinCosSeries(TRUE, ssig1, csig1, C3a, nC3-1)); + h0 = -g->f * A3f(g, eps); + domg12 = salp0 * h0 * (sig12 + B312); + lam12 = omg12 + domg12; + + if (diffp) { + if (calp2 == 0) + dlam12 = - 2 * g->f1 * dn1 / sbet1; + else { + real dummy; + Lengths(g, eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, + cbet1, cbet2, &dummy, &dlam12, &dummy, + FALSE, &dummy, &dummy, C1a, C2a); + dlam12 *= g->f1 / (calp2 * cbet2); + } + } + + *psalp2 = salp2; + *pcalp2 = calp2; + *psig12 = sig12; + *pssig1 = ssig1; + *pcsig1 = csig1; + *pssig2 = ssig2; + *pcsig2 = csig2; + *peps = eps; + *pdomg12 = domg12; + if (diffp) + *pdlam12 = dlam12; + + return lam12; +} + +real A3f(const struct geod_geodesic* g, real eps) { + /* Evaluate sum(A3x[k] * eps^k, k, 0, nA3x-1) by Horner's method */ + real v = 0; + int i; + for (i = nA3x; i; ) + v = eps * v + g->A3x[--i]; + return v; +} + +void C3f(const struct geod_geodesic* g, real eps, real c[]) { + /* Evaluate C3 coeffs by Horner's method + * Elements c[1] thru c[nC3 - 1] are set */ + int i, j, k; + real mult = 1; + for (j = nC3x, k = nC3 - 1; k; ) { + real t = 0; + for (i = nC3 - k; i; --i) + t = eps * t + g->C3x[--j]; + c[k--] = t; + } + + for (k = 1; k < nC3; ) { + mult *= eps; + c[k++] *= mult; + } +} + +void C4f(const struct geod_geodesic* g, real eps, real c[]) { + /* Evaluate C4 coeffs by Horner's method + * Elements c[0] thru c[nC4 - 1] are set */ + int i, j, k; + real mult = 1; + for (j = nC4x, k = nC4; k; ) { + real t = 0; + for (i = nC4 - k + 1; i; --i) + t = eps * t + g->C4x[--j]; + c[--k] = t; + } + + for (k = 1; k < nC4; ) { + mult *= eps; + c[k++] *= mult; + } +} + +/* Generated by Maxima on 2010-09-04 10:26:17-04:00 */ + +/* The scale factor A1-1 = mean value of (d/dsigma)I1 - 1 */ +real A1m1f(real eps) { + real + eps2 = sq(eps), + t = eps2*(eps2*(eps2+4)+64)/256; + return (t + eps) / (1 - eps); +} + +/* The coefficients C1[l] in the Fourier expansion of B1 */ +void C1f(real eps, real c[]) { + real + eps2 = sq(eps), + d = eps; + c[1] = d*((6-eps2)*eps2-16)/32; + d *= eps; + c[2] = d*((64-9*eps2)*eps2-128)/2048; + d *= eps; + c[3] = d*(9*eps2-16)/768; + d *= eps; + c[4] = d*(3*eps2-5)/512; + d *= eps; + c[5] = -7*d/1280; + d *= eps; + c[6] = -7*d/2048; +} + +/* The coefficients C1p[l] in the Fourier expansion of B1p */ +void C1pf(real eps, real c[]) { + real + eps2 = sq(eps), + d = eps; + c[1] = d*(eps2*(205*eps2-432)+768)/1536; + d *= eps; + c[2] = d*(eps2*(4005*eps2-4736)+3840)/12288; + d *= eps; + c[3] = d*(116-225*eps2)/384; + d *= eps; + c[4] = d*(2695-7173*eps2)/7680; + d *= eps; + c[5] = 3467*d/7680; + d *= eps; + c[6] = 38081*d/61440; +} + +/* The scale factor A2-1 = mean value of (d/dsigma)I2 - 1 */ +real A2m1f(real eps) { + real + eps2 = sq(eps), + t = eps2*(eps2*(25*eps2+36)+64)/256; + return t * (1 - eps) - eps; +} + +/* The coefficients C2[l] in the Fourier expansion of B2 */ +void C2f(real eps, real c[]) { + real + eps2 = sq(eps), + d = eps; + c[1] = d*(eps2*(eps2+2)+16)/32; + d *= eps; + c[2] = d*(eps2*(35*eps2+64)+384)/2048; + d *= eps; + c[3] = d*(15*eps2+80)/768; + d *= eps; + c[4] = d*(7*eps2+35)/512; + d *= eps; + c[5] = 63*d/1280; + d *= eps; + c[6] = 77*d/2048; +} + +/* The scale factor A3 = mean value of (d/dsigma)I3 */ +void A3coeff(struct geod_geodesic* g) { + g->A3x[0] = 1; + g->A3x[1] = (g->n-1)/2; + g->A3x[2] = (g->n*(3*g->n-1)-2)/8; + g->A3x[3] = ((-g->n-3)*g->n-1)/16; + g->A3x[4] = (-2*g->n-3)/64; + g->A3x[5] = -3/(real)(128); +} + +/* The coefficients C3[l] in the Fourier expansion of B3 */ +void C3coeff(struct geod_geodesic* g) { + g->C3x[0] = (1-g->n)/4; + g->C3x[1] = (1-g->n*g->n)/8; + g->C3x[2] = ((3-g->n)*g->n+3)/64; + g->C3x[3] = (2*g->n+5)/128; + g->C3x[4] = 3/(real)(128); + g->C3x[5] = ((g->n-3)*g->n+2)/32; + g->C3x[6] = ((-3*g->n-2)*g->n+3)/64; + g->C3x[7] = (g->n+3)/128; + g->C3x[8] = 5/(real)(256); + g->C3x[9] = (g->n*(5*g->n-9)+5)/192; + g->C3x[10] = (9-10*g->n)/384; + g->C3x[11] = 7/(real)(512); + g->C3x[12] = (7-14*g->n)/512; + g->C3x[13] = 7/(real)(512); + g->C3x[14] = 21/(real)(2560); +} + +/* Generated by Maxima on 2012-10-19 08:02:34-04:00 */ + +/* The coefficients C4[l] in the Fourier expansion of I4 */ +void C4coeff(struct geod_geodesic* g) { + g->C4x[0] = (g->n*(g->n*(g->n*(g->n*(100*g->n+208)+572)+3432)-12012)+30030)/ + 45045; + g->C4x[1] = (g->n*(g->n*(g->n*(64*g->n+624)-4576)+6864)-3003)/15015; + g->C4x[2] = (g->n*((14144-10656*g->n)*g->n-4576)-858)/45045; + g->C4x[3] = ((-224*g->n-4784)*g->n+1573)/45045; + g->C4x[4] = (1088*g->n+156)/45045; + g->C4x[5] = 97/(real)(15015); + g->C4x[6] = (g->n*(g->n*((-64*g->n-624)*g->n+4576)-6864)+3003)/135135; + g->C4x[7] = (g->n*(g->n*(5952*g->n-11648)+9152)-2574)/135135; + g->C4x[8] = (g->n*(5792*g->n+1040)-1287)/135135; + g->C4x[9] = (468-2944*g->n)/135135; + g->C4x[10] = 1/(real)(9009); + g->C4x[11] = (g->n*((4160-1440*g->n)*g->n-4576)+1716)/225225; + g->C4x[12] = ((4992-8448*g->n)*g->n-1144)/225225; + g->C4x[13] = (1856*g->n-936)/225225; + g->C4x[14] = 8/(real)(10725); + g->C4x[15] = (g->n*(3584*g->n-3328)+1144)/315315; + g->C4x[16] = (1024*g->n-208)/105105; + g->C4x[17] = -136/(real)(63063); + g->C4x[18] = (832-2560*g->n)/405405; + g->C4x[19] = -128/(real)(135135); + g->C4x[20] = 128/(real)(99099); +} + +int transit(real lon1, real lon2) { + real lon12; + /* Return 1 or -1 if crossing prime meridian in east or west direction. + * Otherwise return zero. */ + /* Compute lon12 the same way as Geodesic::Inverse. */ + lon1 = AngNormalize(lon1); + lon2 = AngNormalize(lon2); + lon12 = AngDiff(lon1, lon2); + return lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 : + (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0); +} + +void accini(real s[]) { + /* Initialize an accumulator; this is an array with two elements. */ + s[0] = s[1] = 0; +} + +void acccopy(const real s[], real t[]) { + /* Copy an accumulator; t = s. */ + t[0] = s[0]; t[1] = s[1]; +} + +void accadd(real s[], real y) { + /* Add y to an accumulator. */ + real u, z = sumx(y, s[1], &u); + s[0] = sumx(z, s[0], &s[1]); + if (s[0] == 0) + s[0] = u; + else + s[1] = s[1] + u; +} + +real accsum(const real s[], real y) { + /* Return accumulator + y (but don't add to accumulator). */ + real t[2]; + acccopy(s, t); + accadd(t, y); + return t[0]; +} + +void accneg(real s[]) { + /* Negate an accumulator. */ + s[0] = -s[0]; s[1] = -s[1]; +} + +void geod_polygon_init(struct geod_polygon* p, boolx polylinep) { + p->lat0 = p->lon0 = p->lat = p->lon = NaN; + p->polyline = (polylinep != 0); + accini(p->P); + accini(p->A); + p->num = p->crossings = 0; +} + +void geod_polygon_addpoint(const struct geod_geodesic* g, + struct geod_polygon* p, + real lat, real lon) { + lon = AngNormalize(lon); + if (p->num == 0) { + p->lat0 = p->lat = lat; + p->lon0 = p->lon = lon; + } else { + real s12, S12; + geod_geninverse(g, p->lat, p->lon, lat, lon, + &s12, 0, 0, 0, 0, 0, p->polyline ? 0 : &S12); + accadd(p->P, s12); + if (!p->polyline) { + accadd(p->A, S12); + p->crossings += transit(p->lon, lon); + } + p->lat = lat; p->lon = lon; + } + ++p->num; +} + +void geod_polygon_addedge(const struct geod_geodesic* g, + struct geod_polygon* p, + real azi, real s) { + if (p->num) { /* Do nothing is num is zero */ + real lat, lon, S12; + geod_gendirect(g, p->lat, p->lon, azi, FALSE, s, + &lat, &lon, 0, + 0, 0, 0, 0, p->polyline ? 0 : &S12); + accadd(p->P, s); + if (!p->polyline) { + accadd(p->A, S12); + p->crossings += transit(p->lon, lon); + } + p->lat = lat; p->lon = lon; + ++p->num; + } +} + +unsigned geod_polygon_compute(const struct geod_geodesic* g, + const struct geod_polygon* p, + boolx reverse, boolx sign, + real* pA, real* pP) { + real s12, S12, t[2], area0; + int crossings; + if (p->num < 2) { + if (pP) *pP = 0; + if (!p->polyline && pA) *pA = 0; + return p->num; + } + if (p->polyline) { + if (pP) *pP = p->P[0]; + return p->num; + } + geod_geninverse(g, p->lat, p->lon, p->lat0, p->lon0, + &s12, 0, 0, 0, 0, 0, &S12); + if (pP) *pP = accsum(p->P, s12); + acccopy(p->A, t); + accadd(t, S12); + crossings = p->crossings + transit(p->lon, p->lon0); + area0 = 4 * pi * g->c2; + if (crossings & 1) + accadd(t, (t[0] < 0 ? 1 : -1) * area0/2); + /* area is with the clockwise sense. If !reverse convert to + * counter-clockwise convention. */ + if (!reverse) + accneg(t); + /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */ + if (sign) { + if (t[0] > area0/2) + accadd(t, -area0); + else if (t[0] <= -area0/2) + accadd(t, +area0); + } else { + if (t[0] >= area0) + accadd(t, -area0); + else if (t[0] < 0) + accadd(t, +area0); + } + if (pA) *pA = 0 + t[0]; + return p->num; +} + +unsigned geod_polygon_testpoint(const struct geod_geodesic* g, + const struct geod_polygon* p, + real lat, real lon, + boolx reverse, boolx sign, + real* pA, real* pP) { + real perimeter, tempsum, area0; + int crossings, i; + unsigned num = p->num + 1; + if (num == 1) { + if (pP) *pP = 0; + if (!p->polyline && pA) *pA = 0; + return num; + } + perimeter = p->P[0]; + tempsum = p->polyline ? 0 : p->A[0]; + crossings = p->crossings; + for (i = 0; i < (p->polyline ? 1 : 2); ++i) { + real s12, S12; + geod_geninverse(g, + i == 0 ? p->lat : lat, i == 0 ? p->lon : lon, + i != 0 ? p->lat0 : lat, i != 0 ? p->lon0 : lon, + &s12, 0, 0, 0, 0, 0, p->polyline ? 0 : &S12); + perimeter += s12; + if (!p->polyline) { + tempsum += S12; + crossings += transit(i == 0 ? p->lon : lon, + i != 0 ? p->lon0 : lon); + } + } + + if (pP) *pP = perimeter; + if (p->polyline) + return num; + + area0 = 4 * pi * g->c2; + if (crossings & 1) + tempsum += (tempsum < 0 ? 1 : -1) * area0/2; + /* area is with the clockwise sense. If !reverse convert to + * counter-clockwise convention. */ + if (!reverse) + tempsum *= -1; + /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */ + if (sign) { + if (tempsum > area0/2) + tempsum -= area0; + else if (tempsum <= -area0/2) + tempsum += area0; + } else { + if (tempsum >= area0) + tempsum -= area0; + else if (tempsum < 0) + tempsum += area0; + } + if (pA) *pA = 0 + tempsum; + return num; +} + +unsigned geod_polygon_testedge(const struct geod_geodesic* g, + const struct geod_polygon* p, + real azi, real s, + boolx reverse, boolx sign, + real* pA, real* pP) { + real perimeter, tempsum, area0; + int crossings; + unsigned num = p->num + 1; + if (num == 1) { /* we don't have a starting point! */ + if (pP) *pP = NaN; + if (!p->polyline && pA) *pA = NaN; + return 0; + } + perimeter = p->P[0] + s; + if (p->polyline) { + if (pP) *pP = perimeter; + return num; + } + + tempsum = p->A[0]; + crossings = p->crossings; + { + real lat, lon, s12, S12; + geod_gendirect(g, p->lat, p->lon, azi, FALSE, s, + &lat, &lon, 0, + 0, 0, 0, 0, &S12); + tempsum += S12; + crossings += transit(p->lon, lon); + geod_geninverse(g, lat, lon, p->lat0, p->lon0, + &s12, 0, 0, 0, 0, 0, &S12); + perimeter += s12; + tempsum += S12; + crossings += transit(lon, p->lon0); + } + + area0 = 4 * pi * g->c2; + if (crossings & 1) + tempsum += (tempsum < 0 ? 1 : -1) * area0/2; + /* area is with the clockwise sense. If !reverse convert to + * counter-clockwise convention. */ + if (!reverse) + tempsum *= -1; + /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */ + if (sign) { + if (tempsum > area0/2) + tempsum -= area0; + else if (tempsum <= -area0/2) + tempsum += area0; + } else { + if (tempsum >= area0) + tempsum -= area0; + else if (tempsum < 0) + tempsum += area0; + } + if (pP) *pP = perimeter; + if (pA) *pA = 0 + tempsum; + return num; +} + +void geod_polygonarea(const struct geod_geodesic* g, + real lats[], real lons[], int n, + real* pA, real* pP) { + int i; + struct geod_polygon p; + geod_polygon_init(&p, FALSE); + for (i = 0; i < n; ++i) + geod_polygon_addpoint(g, &p, lats[i], lons[i]); + geod_polygon_compute(g, &p, FALSE, TRUE, pA, pP); +} + +/** @endcond */ diff --git a/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.h b/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.h new file mode 100644 index 000000000..5efa63f57 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.h @@ -0,0 +1,745 @@ +/** + * \file geodesic.h + * \brief Header for the geodesic routines in C + * + * This an implementation in C of the geodesic algorithms described in + * - C. F. F. Karney, + * + * Algorithms for geodesics, + * J. Geodesy 87, 43--55 (2013); + * DOI: + * 10.1007/s00190-012-0578-z; + * addenda: + * geod-addenda.html. + * . + * The principal advantages of these algorithms over previous ones (e.g., + * Vincenty, 1975) are + * - accurate to round off for |f| < 1/50; + * - the solution of the inverse problem is always found; + * - differential and integral properties of geodesics are computed. + * + * The shortest path between two points on the ellipsoid at (\e lat1, \e + * lon1) and (\e lat2, \e lon2) is called the geodesic. Its length is + * \e s12 and the geodesic from point 1 to point 2 has forward azimuths + * \e azi1 and \e azi2 at the two end points. + * + * Traditionally two geodesic problems are considered: + * - the direct problem -- given \e lat1, \e lon1, \e s12, and \e azi1, + * determine \e lat2, \e lon2, and \e azi2. This is solved by the function + * geod_direct(). + * - the inverse problem -- given \e lat1, \e lon1, and \e lat2, \e lon2, + * determine \e s12, \e azi1, and \e azi2. This is solved by the function + * geod_inverse(). + * + * The ellipsoid is specified by its equatorial radius \e a (typically in + * meters) and flattening \e f. The routines are accurate to round off with + * double precision arithmetic provided that |f| < 1/50; for the + * WGS84 ellipsoid, the errors are less than 15 nanometers. (Reasonably + * accurate results are obtained for |f| < 1/5.) For a prolate + * ellipsoid, specify \e f < 0. + * + * The routines also calculate several other quantities of interest + * - \e S12 is the area between the geodesic from point 1 to point 2 and the + * equator; i.e., it is the area, measured counter-clockwise, of the + * quadrilateral with corners (\e lat1,\e lon1), (0,\e lon1), (0,\e lon2), + * and (\e lat2,\e lon2). + * - \e m12, the reduced length of the geodesic is defined such that if + * the initial azimuth is perturbed by \e dazi1 (radians) then the + * second point is displaced by \e m12 \e dazi1 in the direction + * perpendicular to the geodesic. On a curved surface the reduced + * length obeys a symmetry relation, \e m12 + \e m21 = 0. On a flat + * surface, we have \e m12 = \e s12. + * - \e M12 and \e M21 are geodesic scales. If two geodesics are + * parallel at point 1 and separated by a small distance \e dt, then + * they are separated by a distance \e M12 \e dt at point 2. \e M21 + * is defined similarly (with the geodesics being parallel to one + * another at point 2). On a flat surface, we have \e M12 = \e M21 + * = 1. + * - \e a12 is the arc length on the auxiliary sphere. This is a + * construct for converting the problem to one in spherical + * trigonometry. \e a12 is measured in degrees. The spherical arc + * length from one equator crossing to the next is always 180°. + * + * If points 1, 2, and 3 lie on a single geodesic, then the following + * addition rules hold: + * - \e s13 = \e s12 + \e s23 + * - \e a13 = \e a12 + \e a23 + * - \e S13 = \e S12 + \e S23 + * - \e m13 = \e m12 \e M23 + \e m23 \e M21 + * - \e M13 = \e M12 \e M23 − (1 − \e M12 \e M21) \e + * m23 / \e m12 + * - \e M31 = \e M32 \e M21 − (1 − \e M23 \e M32) \e + * m12 / \e m23 + * + * The shortest distance returned by the solution of the inverse problem is + * (obviously) uniquely defined. However, in a few special cases there are + * multiple azimuths which yield the same shortest distance. Here is a + * catalog of those cases: + * - \e lat1 = −\e lat2 (with neither point at a pole). If \e azi1 = \e + * azi2, the geodesic is unique. Otherwise there are two geodesics + * and the second one is obtained by setting [\e azi1, \e azi2] = [\e + * azi2, \e azi1], [\e M12, \e M21] = [\e M21, \e M12], \e S12 = + * −\e S12. (This occurs when the longitude difference is near + * ±180° for oblate ellipsoids.) + * - \e lon2 = \e lon1 ± 180° (with neither point at a pole). If + * \e azi1 = 0° or ±180°, the geodesic is unique. + * Otherwise there are two geodesics and the second one is obtained by + * setting [\e azi1, \e azi2] = [−\e azi1, −\e azi2], \e + * S12 = −\e S12. (This occurs when \e lat2 is near + * −\e lat1 for prolate ellipsoids.) + * - Points 1 and 2 at opposite poles. There are infinitely many + * geodesics which can be generated by setting [\e azi1, \e azi2] = + * [\e azi1, \e azi2] + [\e d, −\e d], for arbitrary \e d. (For + * spheres, this prescription applies when points 1 and 2 are + * antipodal.) + * - \e s12 = 0 (coincident points). There are infinitely many geodesics + * which can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e + * azi2] + [\e d, \e d], for arbitrary \e d. + * + * These routines are a simple transcription of the corresponding C++ classes + * in GeographicLib. The "class + * data" is represented by the structs geod_geodesic, geod_geodesicline, + * geod_polygon and pointers to these objects are passed as initial arguments + * to the member functions. Most of the internal comments have been retained. + * However, in the process of transcription some documentation has been lost + * and the documentation for the C++ classes, GeographicLib::Geodesic, + * GeographicLib::GeodesicLine, and GeographicLib::PolygonArea, should be + * consulted. The C++ code remains the "reference implementation". Think + * twice about restructuring the internals of the C code since this may make + * porting fixes from the C++ code more difficult. + * + * Copyright (c) Charles Karney (2012-2013) and licensed + * under the MIT/X11 License. For more information, see + * http://geographiclib.sourceforge.net/ + * + * This library was distributed with + * GeographicLib 1.32. + **********************************************************************/ + +#if !defined(GEODESIC_H) +#define GEODESIC_H 1 + +/** + * The major version of the geodesic library. (This tracks the version of + * GeographicLib.) + **********************************************************************/ +#define GEODESIC_VERSION_MAJOR 1 +/** + * The minor version of the geodesic library. (This tracks the version of + * GeographicLib.) + **********************************************************************/ +#define GEODESIC_VERSION_MINOR 32 +/** + * The patch level of the geodesic library. (This tracks the version of + * GeographicLib.) + **********************************************************************/ +#define GEODESIC_VERSION_PATCH 0 + +#if defined(__cplusplus) +extern "C" { +#endif + + /** + * The struct containing information about the ellipsoid. This must be + * initialized by geod_init() before use. + **********************************************************************/ + struct geod_geodesic { + double a; /**< the equatorial radius */ + double f; /**< the flattening */ + /**< @cond SKIP */ + double f1, e2, ep2, n, b, c2, etol2; + double A3x[6], C3x[15], C4x[21]; + /**< @endcond */ + }; + + /** + * The struct containing information about a single geodesic. This must be + * initialized by geod_lineinit() before use. + **********************************************************************/ + struct geod_geodesicline { + double lat1; /**< the starting latitude */ + double lon1; /**< the starting longitude */ + double azi1; /**< the starting azimuth */ + double a; /**< the equatorial radius */ + double f; /**< the flattening */ + /**< @cond SKIP */ + double b, c2, f1, salp0, calp0, k2, + salp1, calp1, ssig1, csig1, dn1, stau1, ctau1, somg1, comg1, + A1m1, A2m1, A3c, B11, B21, B31, A4, B41; + double C1a[6+1], C1pa[6+1], C2a[6+1], C3a[6], C4a[6]; + /**< @endcond */ + unsigned caps; /**< the capabilities */ + }; + + /** + * The struct for accumulating information about a geodesic polygon. This is + * used for computing the perimeter and area of a polygon. This must be + * initialized by geod_polygon_init() before use. + **********************************************************************/ + struct geod_polygon { + double lat; /**< the current latitude */ + double lon; /**< the current longitude */ + /**< @cond SKIP */ + double lat0; + double lon0; + double A[2]; + double P[2]; + int polyline; + int crossings; + /**< @endcond */ + unsigned num; /**< the number of points so far */ + }; + + /** + * Initialize a geod_geodesic object. + * + * @param[out] g a pointer to the object to be initialized. + * @param[in] a the equatorial radius (meters). + * @param[in] f the flattening. + **********************************************************************/ + void geod_init(struct geod_geodesic* g, double a, double f); + + /** + * Initialize a geod_geodesicline object. + * + * @param[out] l a pointer to the object to be initialized. + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] caps bitor'ed combination of geod_mask() values specifying the + * capabilities the geod_geodesicline object should possess, i.e., which + * quantities can be returned in calls to geod_position() and + * geod_genposition(). + * + * \e g must have been initialized with a call to geod_init(). \e lat1 + * should be in the range [−90°, 90°]; \e lon1 and \e azi1 + * should be in the range [−540°, 540°). + * + * The geod_mask values are [see geod_mask()]: + * - \e caps |= GEOD_LATITUDE for the latitude \e lat2; this is + * added automatically, + * - \e caps |= GEOD_LONGITUDE for the latitude \e lon2, + * - \e caps |= GEOD_AZIMUTH for the latitude \e azi2; this is + * added automatically, + * - \e caps |= GEOD_DISTANCE for the distance \e s12, + * - \e caps |= GEOD_REDUCEDLENGTH for the reduced length \e m12, + * - \e caps |= GEOD_GEODESICSCALE for the geodesic scales \e M12 + * and \e M21, + * - \e caps |= GEOD_AREA for the area \e S12, + * - \e caps |= GEOD_DISTANCE_IN permits the length of the + * geodesic to be given in terms of \e s12; without this capability the + * length can only be specified in terms of arc length. + * . + * A value of \e caps = 0 is treated as GEOD_LATITUDE | GEOD_LONGITUDE | + * GEOD_AZIMUTH | GEOD_DISTANCE_IN (to support the solution of the "standard" + * direct problem). + **********************************************************************/ + void geod_lineinit(struct geod_geodesicline* l, + const struct geod_geodesic* g, + double lat1, double lon1, double azi1, unsigned caps); + + /** + * Solve the direct geodesic problem. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @param[out] plat2 pointer to the latitude of point 2 (degrees). + * @param[out] plon2 pointer to the longitude of point 2 (degrees). + * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). + * + * \e g must have been initialized with a call to geod_init(). \e lat1 + * should be in the range [−90°, 90°]; \e lon1 and \e azi1 + * should be in the range [−540°, 540°). The values of \e lon2 + * and \e azi2 returned are in the range [−180°, 180°). Any of + * the "return" arguments \e plat2, etc., may be replaced by 0, if you do not + * need some quantities computed. + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), and + * taking the limit ε → 0+. An arc length greater that 180° + * signifies a geodesic which is not a shortest path. (For a prolate + * ellipsoid, an additional condition is necessary for a shortest path: the + * longitudinal extent must not exceed of 180°.) + * + * Example, determine the point 10000 km NE of JFK: + @code + struct geod_geodesic g; + double lat, lon; + geod_init(&g, 6378137, 1/298.257223563); + geod_direct(&g, 40.64, -73.78, 45.0, 10e6, &lat, &lon, 0); + printf("%.5f %.5f\n", lat, lon); + @endcode + **********************************************************************/ + void geod_direct(const struct geod_geodesic* g, + double lat1, double lon1, double azi1, double s12, + double* plat2, double* plon2, double* pazi2); + + /** + * Solve the inverse geodesic problem. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[out] ps12 pointer to the distance between point 1 and point 2 + * (meters). + * @param[out] pazi1 pointer to the azimuth at point 1 (degrees). + * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). + * + * \e g must have been initialized with a call to geod_init(). \e lat1 + * and \e lat2 should be in the range [−90°, 90°]; \e lon1 and + * \e lon2 should be in the range [−540°, 540°). The values of + * \e azi1 and \e azi2 returned are in the range [−180°, 180°). + * Any of the "return" arguments \e ps12, etc., may be replaced by 0, if you + * do not need some quantities computed. + * + * If either point is at a pole, the azimuth is defined by keeping the + * longitude fixed, writing \e lat = ±(90° − ε), and + * taking the limit ε → 0+. + * + * The solution to the inverse problem is found using Newton's method. If + * this fails to converge (this is very unlikely in geodetic applications + * but does occur for very eccentric ellipsoids), then the bisection method + * is used to refine the solution. + * + * Example, determine the distance between JFK and Singapore Changi Airport: + @code + struct geod_geodesic g; + double s12; + geod_init(&g, 6378137, 1/298.257223563); + geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, 0, 0); + printf("%.3f\n", s12); + @endcode + **********************************************************************/ + void geod_inverse(const struct geod_geodesic* g, + double lat1, double lon1, double lat2, double lon2, + double* ps12, double* pazi1, double* pazi2); + + /** + * Compute the position along a geod_geodesicline. + * + * @param[in] l a pointer to the geod_geodesicline object specifying the + * geodesic line. + * @param[in] s12 distance between point 1 and point 2 (meters); it can be + * negative. + * @param[out] plat2 pointer to the latitude of point 2 (degrees). + * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires + * that \e l was initialized with \e caps |= GEOD_LONGITUDE. + * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). + * + * \e l must have been initialized with a call to geod_lineinit() with \e + * caps |= GEOD_DISTANCE_IN. The values of \e lon2 and \e azi2 returned are + * in the range [−180°, 180°). Any of the "return" arguments + * \e plat2, etc., may be replaced by 0, if you do not need some quantities + * computed. + * + * Example, compute way points between JFK and Singapore Changi Airport + * the "obvious" way using geod_direct(): + @code + struct geod_geodesic g; + double s12, azi1, lat[101],lon[101]; + int i; + geod_init(&g, 6378137, 1/298.257223563); + geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0); + for (i = 0; i < 101; ++i) { + geod_direct(&g, 40.64, -73.78, azi1, i * s12 * 0.01, lat + i, lon + i, 0); + printf("%.5f %.5f\n", lat[i], lon[i]); + } + @endcode + * A faster way using geod_position(): + @code + struct geod_geodesic g; + struct geod_geodesicline l; + double s12, azi1, lat[101],lon[101]; + int i; + geod_init(&g, 6378137, 1/298.257223563); + geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0); + geod_lineinit(&l, &g, 40.64, -73.78, azi1, 0); + for (i = 0; i < 101; ++i) { + geod_position(&l, i * s12 * 0.01, lat + i, lon + i, 0); + printf("%.5f %.5f\n", lat[i], lon[i]); + } + @endcode + **********************************************************************/ + void geod_position(const struct geod_geodesicline* l, double s12, + double* plat2, double* plon2, double* pazi2); + + /** + * The general direct geodesic problem. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] azi1 azimuth at point 1 (degrees). + * @param[in] arcmode flag determining the meaning of the \e + * s12_a12. + * @param[in] s12_a12 if \e arcmode is 0, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be negative. + * @param[out] plat2 pointer to the latitude of point 2 (degrees). + * @param[out] plon2 pointer to the longitude of point 2 (degrees). + * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). + * @param[out] ps12 pointer to the distance between point 1 and point 2 + * (meters). + * @param[out] pm12 pointer to the reduced length of geodesic (meters). + * @param[out] pM12 pointer to the geodesic scale of point 2 relative to + * point 1 (dimensionless). + * @param[out] pM21 pointer to the geodesic scale of point 1 relative to + * point 2 (dimensionless). + * @param[out] pS12 pointer to the area under the geodesic + * (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e g must have been initialized with a call to geod_init(). \e lat1 + * should be in the range [−90°, 90°]; \e lon1 and \e azi1 + * should be in the range [−540°, 540°). The function value \e + * a12 equals \e s12_a12 is \e arcmode is non-zero. Any of the "return" + * arguments \e plat2, etc., may be replaced by 0, if you do not need some + * quantities computed. + **********************************************************************/ + double geod_gendirect(const struct geod_geodesic* g, + double lat1, double lon1, double azi1, + int arcmode, double s12_a12, + double* plat2, double* plon2, double* pazi2, + double* ps12, double* pm12, double* pM12, double* pM21, + double* pS12); + + /** + * The general inverse geodesic calculation. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] lat1 latitude of point 1 (degrees). + * @param[in] lon1 longitude of point 1 (degrees). + * @param[in] lat2 latitude of point 2 (degrees). + * @param[in] lon2 longitude of point 2 (degrees). + * @param[out] ps12 pointer to the distance between point 1 and point 2 + * (meters). + * @param[out] pazi1 pointer to the azimuth at point 1 (degrees). + * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). + * @param[out] pm12 pointer to the reduced length of geodesic (meters). + * @param[out] pM12 pointer to the geodesic scale of point 2 relative to + * point 1 (dimensionless). + * @param[out] pM21 pointer to the geodesic scale of point 1 relative to + * point 2 (dimensionless). + * @param[out] pS12 pointer to the area under the geodesic + * (meters2). + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e g must have been initialized with a call to geod_init(). \e lat1 + * and \e lat2 should be in the range [−90°, 90°]; \e lon1 and + * \e lon2 should be in the range [−540°, 540°). Any of the + * "return" arguments \e ps12, etc., may be replaced by 0, if you do not need + * some quantities computed. + **********************************************************************/ + double geod_geninverse(const struct geod_geodesic* g, + double lat1, double lon1, double lat2, double lon2, + double* ps12, double* pazi1, double* pazi2, + double* pm12, double* pM12, double* pM21, + double* pS12); + + /** + * The general position function. + * + * @param[in] l a pointer to the geod_geodesicline object specifying the + * geodesic line. + * @param[in] arcmode flag determining the meaning of the second parameter; + * if arcmode is 0, then \e l must have been initialized with \e caps |= + * GEOD_DISTANCE_IN. + * @param[in] s12_a12 if \e arcmode is 0, this is the distance between + * point 1 and point 2 (meters); otherwise it is the arc length between + * point 1 and point 2 (degrees); it can be negative. + * @param[out] plat2 pointer to the latitude of point 2 (degrees). + * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires + * that \e l was initialized with \e caps |= GEOD_LONGITUDE. + * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees). + * @param[out] ps12 pointer to the distance between point 1 and point 2 + * (meters); requires that \e l was initialized with \e caps |= + * GEOD_DISTANCE. + * @param[out] pm12 pointer to the reduced length of geodesic (meters); + * requires that \e l was initialized with \e caps |= GEOD_REDUCEDLENGTH. + * @param[out] pM12 pointer to the geodesic scale of point 2 relative to + * point 1 (dimensionless); requires that \e l was initialized with \e caps + * |= GEOD_GEODESICSCALE. + * @param[out] pM21 pointer to the geodesic scale of point 1 relative to + * point 2 (dimensionless); requires that \e l was initialized with \e caps + * |= GEOD_GEODESICSCALE. + * @param[out] pS12 pointer to the area under the geodesic + * (meters2); requires that \e l was initialized with \e caps |= + * GEOD_AREA. + * @return \e a12 arc length of between point 1 and point 2 (degrees). + * + * \e l must have been initialized with a call to geod_lineinit() with \e + * caps |= GEOD_DISTANCE_IN. The values of \e lon2 and \e azi2 returned are + * in the range [−180°, 180°). Any of the "return" arguments + * \e plat2, etc., may be replaced by 0, if you do not need some quantities + * computed. Requesting a value which \e l is not capable of computing is + * not an error; the corresponding argument will not be altered. + * + * Example, compute way points between JFK and Singapore Changi Airport + * using geod_genposition(). In this example, the points are evenly space in + * arc length (and so only approximately equally space in distance). This is + * faster than using geod_position() would be appropriate if drawing the path + * on a map. + @code + struct geod_geodesic g; + struct geod_geodesicline l; + double a12, azi1, lat[101],lon[101]; + int i; + geod_init(&g, 6378137, 1/298.257223563); + a12 = geod_geninverse(&g, 40.64, -73.78, 1.36, 103.99, + 0, &azi1, 0, 0, 0, 0, 0); + geod_lineinit(&l, &g, 40.64, -73.78, azi1, GEOD_LATITUDE | GEOD_LONGITUDE); + for (i = 0; i < 101; ++i) { + geod_genposition(&l, 1, i * a12 * 0.01, + lat + i, lon + i, 0, 0, 0, 0, 0, 0); + printf("%.5f %.5f\n", lat[i], lon[i]); + } + @endcode + **********************************************************************/ + double geod_genposition(const struct geod_geodesicline* l, + int arcmode, double s12_a12, + double* plat2, double* plon2, double* pazi2, + double* ps12, double* pm12, + double* pM12, double* pM21, + double* pS12); + + /** + * Initialize a geod_polygon object. + * + * @param[out] p a pointer to the object to be initialized. + * @param[in] polylinep non-zero if a polyline instead of a polygon. + * + * If \e polylinep is zero, then the sequence of vertices and edges added by + * geod_polygon_addpoint() and geod_polygon_addedge() define a polygon and + * the perimeter and area are returned by geod_polygon_compute(). If \e + * polylinep is non-zero, then the vertices and edges define a polyline and + * only the perimeter is returned by geod_polygon_compute(). + * + * An example of the use of this function is given in the documentation for + * geod_polygon_compute(). + **********************************************************************/ + void geod_polygon_init(struct geod_polygon* p, int polylinep); + + /** + * Add a point to the polygon or polyline. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in,out] p a pointer to the geod_polygon object specifying the + * polygon. + * @param[in] lat the latitude of the point (degrees). + * @param[in] lon the longitude of the point (degrees). + * + * \e g and \e p must have been initialized with calls to geod_init() and + * geod_polygon_init(), respectively. The same \e g must be used for all the + * points and edges in a polygon. \e lat should be in the range + * [−90°, 90°] and \e lon should be in the range + * [−540°, 540°). + * + * An example of the use of this function is given in the documentation for + * geod_polygon_compute(). + **********************************************************************/ + void geod_polygon_addpoint(const struct geod_geodesic* g, + struct geod_polygon* p, + double lat, double lon); + + /** + * Add an edge to the polygon or polyline. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in,out] p a pointer to the geod_polygon object specifying the + * polygon. + * @param[in] azi azimuth at current point (degrees). + * @param[in] s distance from current point to next point (meters). + * + * \e g and \e p must have been initialized with calls to geod_init() and + * geod_polygon_init(), respectively. The same \e g must be used for all the + * points and edges in a polygon. \e azi should be in the range + * [−540°, 540°). This does nothing if no points have been + * added yet. The \e lat and \e lon fields of \e p give the location of + * the new vertex. + **********************************************************************/ + void geod_polygon_addedge(const struct geod_geodesic* g, + struct geod_polygon* p, + double azi, double s); + + /** + * Return the results for a polygon. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] p a pointer to the geod_polygon object specifying the polygon. + * @param[in] reverse if non-zero then clockwise (instead of + * counter-clockwise) traversal counts as a positive area. + * @param[in] sign if non-zero then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] pA pointer to the area of the polygon (meters2); + * only set if \e polyline is non-zero in the call to geod_polygon_init(). + * @param[out] pP pointer to the perimeter of the polygon or length of the + * polyline (meters). + * @return the number of points. + * + * Only simple polygons (which are not self-intersecting) are allowed. + * There's no need to "close" the polygon by repeating the first vertex. Set + * \e pA or \e pP to zero, if you do not want the corresponding quantity + * returned. + * + * Example, compute the perimeter and area of the geodesic triangle with + * vertices (0°N,0°E), (0°N,90°E), (90°N,0°E). + @code + double A, P; + int n; + struct geod_geodesic g; + struct geod_polygon p; + geod_init(&g, 6378137, 1/298.257223563); + geod_polygon_init(&p, 0); + + geod_polygon_addpoint(&g, &p, 0, 0); + geod_polygon_addpoint(&g, &p, 0, 90); + geod_polygon_addpoint(&g, &p, 90, 0); + n = geod_polygon_compute(&g, &p, 0, 1, &A, &P); + printf("%d %.8f %.3f\n", n, P, A); + @endcode + **********************************************************************/ + unsigned geod_polygon_compute(const struct geod_geodesic* g, + const struct geod_polygon* p, + int reverse, int sign, + double* pA, double* pP); + + /** + * Return the results assuming a tentative final test point is added; + * however, the data for the test point is not saved. This lets you report a + * running result for the perimeter and area as the user moves the mouse + * cursor. Ordinary floating point arithmetic is used to accumulate the data + * for the test point; thus the area and perimeter returned are less accurate + * than if geod_polygon_addpoint() and geod_polygon_compute() are used. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] p a pointer to the geod_polygon object specifying the polygon. + * @param[in] lat the latitude of the test point (degrees). + * @param[in] lon the longitude of the test point (degrees). + * @param[in] reverse if non-zero then clockwise (instead of + * counter-clockwise) traversal counts as a positive area. + * @param[in] sign if non-zero then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] pA pointer to the area of the polygon (meters2); + * only set if \e polyline is non-zero in the call to geod_polygon_init(). + * @param[out] pP pointer to the perimeter of the polygon or length of the + * polyline (meters). + * @return the number of points. + * + * \e lat should be in the range [−90°, 90°] and \e + * lon should be in the range [−540°, 540°). + **********************************************************************/ + unsigned geod_polygon_testpoint(const struct geod_geodesic* g, + const struct geod_polygon* p, + double lat, double lon, + int reverse, int sign, + double* pA, double* pP); + + /** + * Return the results assuming a tentative final test point is added via an + * azimuth and distance; however, the data for the test point is not saved. + * This lets you report a running result for the perimeter and area as the + * user moves the mouse cursor. Ordinary floating point arithmetic is used + * to accumulate the data for the test point; thus the area and perimeter + * returned are less accurate than if geod_polygon_addedge() and + * geod_polygon_compute() are used. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] p a pointer to the geod_polygon object specifying the polygon. + * @param[in] azi azimuth at current point (degrees). + * @param[in] s distance from current point to final test point (meters). + * @param[in] reverse if non-zero then clockwise (instead of + * counter-clockwise) traversal counts as a positive area. + * @param[in] sign if non-zero then return a signed result for the area if + * the polygon is traversed in the "wrong" direction instead of returning + * the area for the rest of the earth. + * @param[out] pA pointer to the area of the polygon (meters2); + * only set if \e polyline is non-zero in the call to geod_polygon_init(). + * @param[out] pP pointer to the perimeter of the polygon or length of the + * polyline (meters). + * @return the number of points. + * + * \e azi should be in the range [−540°, 540°). + **********************************************************************/ + unsigned geod_polygon_testedge(const struct geod_geodesic* g, + const struct geod_polygon* p, + double azi, double s, + int reverse, int sign, + double* pA, double* pP); + + /** + * A simple interface for computing the area of a geodesic polygon. + * + * @param[in] g a pointer to the geod_geodesic object specifying the + * ellipsoid. + * @param[in] lats an array of latitudes of the polygon vertices (degrees). + * @param[in] lons an array of longitudes of the polygon vertices (degrees). + * @param[in] n the number of vertices. + * @param[out] pA pointer to the area of the polygon (meters2). + * @param[out] pP pointer to the perimeter of the polygon (meters). + * + * \e lats should be in the range [−90°, 90°]; \e lons should + * be in the range [−540°, 540°). + * + * Only simple polygons (which are not self-intersecting) are allowed. + * There's no need to "close" the polygon by repeating the first vertex. The + * area returned is signed with counter-clockwise traversal being treated as + * positive. + * + * Example, compute the area of Antarctic: + @code + double + lats[] = {-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7, + -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7}, + lons[] = {-74, -102, -102, -131, -163, 163, 172, 140, 113, + 88, 59, 25, -4, -14, -33, -46, -61}; + struct geod_geodesic g; + double A, P; + geod_init(&g, 6378137, 1/298.257223563); + geod_polygonarea(&g, lats, lons, (sizeof lats) / (sizeof lats[0]), &A, &P); + printf("%.0f %.2f\n", A, P); + @endcode + **********************************************************************/ + void geod_polygonarea(const struct geod_geodesic* g, + double lats[], double lons[], int n, + double* pA, double* pP); + + /** + * mask values for the the \e caps argument to geod_lineinit(). + **********************************************************************/ + enum geod_mask { + GEOD_NONE = 0U, /**< Calculate nothing */ + GEOD_LATITUDE = 1U<<7 | 0U, /**< Calculate latitude */ + GEOD_LONGITUDE = 1U<<8 | 1U<<3, /**< Calculate longitude */ + GEOD_AZIMUTH = 1U<<9 | 0U, /**< Calculate azimuth */ + GEOD_DISTANCE = 1U<<10 | 1U<<0, /**< Calculate distance */ + GEOD_DISTANCE_IN = 1U<<11 | 1U<<0 | 1U<<1, /**< Allow distance as input */ + GEOD_REDUCEDLENGTH= 1U<<12 | 1U<<0 | 1U<<2, /**< Calculate reduced length */ + GEOD_GEODESICSCALE= 1U<<13 | 1U<<0 | 1U<<2, /**< Calculate geodesic scale */ + GEOD_AREA = 1U<<14 | 1U<<4, /**< Calculate reduced length */ + GEOD_ALL = 0x7F80U| 0x1FU /**< Calculate everything */ + }; + +#if defined(__cplusplus) +} +#endif + +#endif diff --git a/gtsam/3rdparty/GeographicLib/legacy/C/inverse.c b/gtsam/3rdparty/GeographicLib/legacy/C/inverse.c new file mode 100644 index 000000000..5e96a8ea1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/C/inverse.c @@ -0,0 +1,32 @@ +/** + * @file inverse.c + * @brief A test program for geod_inverse() + **********************************************************************/ + +#include +#include "geodesic.h" + +#if defined(_MSC_VER) +/* Squelch warnings about scanf */ +# pragma warning (disable: 4996) +#endif + +/** + * A simple program to solve the inverse geodesic problem. + * + * This program reads in lines with lat1, lon1, lat2, lon2 and prints out lines + * with azi1, azi2, s12 (for the WGS84 ellipsoid). + **********************************************************************/ + +int main() { + double a = 6378137, f = 1/298.257223563; /* WGS84 */ + double lat1, lon1, azi1, lat2, lon2, azi2, s12; + struct geod_geodesic g; + + geod_init(&g, a, f); + while (scanf("%lf %lf %lf %lf\n", &lat1, &lon1, &lat2, &lon2) == 4) { + geod_inverse(&g, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2); + printf("%.15f %.15f %.10f\n", azi1, azi2, s12); + } + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/legacy/C/planimeter.c b/gtsam/3rdparty/GeographicLib/legacy/C/planimeter.c new file mode 100644 index 000000000..12661efd1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/C/planimeter.c @@ -0,0 +1,37 @@ +/** + * @file planimeter.c + * @brief A test program for geod_polygon_compute() + **********************************************************************/ + +#include +#include "geodesic.h" + +#if defined(_MSC_VER) +/* Squelch warnings about scanf */ +# pragma warning (disable: 4996) +#endif + +/** + * A simple program to compute the area of a geodesic polygon. + * + * This program reads in lines with lat, lon for each vertex + * of a polygon. At the end of input, the program prints the number of + * vertices, the perimeter of the polygon and its area (for the WGS84 + * ellipsoid). + **********************************************************************/ + +int main() { + double a = 6378137, f = 1/298.257223563; /* WGS84 */ + double lat, lon, A, P; + int n; + struct geod_geodesic g; + struct geod_polygon p; + geod_init(&g, a, f); + geod_polygon_init(&p, 0); + + while (scanf("%lf %lf\n", &lat, &lon) == 2) + geod_polygon_addpoint(&g, &p, lat, lon); + n = geod_polygon_compute(&g, &p, 0, 1, &A, &P); + printf("%d %.8f %.3f\n", n, P, A); + return 0; +} diff --git a/gtsam/3rdparty/GeographicLib/legacy/Fortran/00README.txt b/gtsam/3rdparty/GeographicLib/legacy/Fortran/00README.txt new file mode 100644 index 000000000..ecc402784 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/Fortran/00README.txt @@ -0,0 +1,27 @@ +This is a Fortran implementation of the geodesic algorithms described in + + C. F. F. Karney, + Algorithms for geodesics, + J. Geodesy 87, 43-55 (2013); + http://dx.doi.org/10.1007/s00190-012-0578-z + Addenda: http://geographiclib.sf.net/geod-addenda.html + +For documentation, see + + http://geographiclib.sourceforge.net/html/Fortran/ + +The code in this directory is entirely self-contained. In particular, +it does not depend on the C++ classes. You can compile and link the +example programs directly with something like: + + f95 -o geodinverse geodinverse.for geodesic.for + echo 30 0 29.5 179.5 | ./geodinverse + +Alternatively, you can build the examples using cmake. For example, on +Linux systems you might do: + + mkdir BUILD + cd BUILD + cmake .. + make + echo 30 0 29.5 179.5 | ./geodinverse diff --git a/gtsam/3rdparty/GeographicLib/legacy/Fortran/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/legacy/Fortran/CMakeLists.txt new file mode 100644 index 000000000..980ff29bd --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/Fortran/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required (VERSION 2.6) + +project (GeographicLib-legacy-Fortran Fortran) + +# Set a default build type for single-configuration cmake generators if +# no build type is set. +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set (CMAKE_BUILD_TYPE Release) +endif () + +set (CMAKE_Fortran_FLAGS + "${CMAKE_Fortran_FLAGS} -Wall -Wextra -pedantic -std=f95 -fimplicit-none") + +set (TOOLS geoddirect geodinverse planimeter) + +foreach (TOOL ${TOOLS}) + add_executable (${TOOL} ${TOOL}.for geodesic.for geodesic.inc) +endforeach () diff --git a/gtsam/3rdparty/GeographicLib/legacy/Fortran/geoddirect.for b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geoddirect.for new file mode 100644 index 000000000..98c5e804b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geoddirect.for @@ -0,0 +1,35 @@ +*> @file geoddirect.for +*! @brief A test program for direct() + +*> A simple program to solve the direct geodesic problem. +*! +*! This program reads in lines with lat1, lon1, azi1, s12 and prints out +*! lines with lat2, lon2, azi2 (for the WGS84 ellipsoid). + + program geoddirect + implicit none + + include 'geodesic.inc' + + double precision a, f, lat1, lon1, azi1, lat2, lon2, azi2, s12, + + dummy + logical arcmod + integer omask + +* WGS84 values + a = 6378137d0 + f = 1/298.257223563d0 + + arcmod = .false. + omask = 0 + + 10 continue + read(*, *, end=90, err=90) lat1, lon1, azi1, s12 + call direct(a, f, lat1, lon1, azi1, s12, arcmod, + + lat2, lon2, azi2, omask, dummy, dummy, dummy, dummy, dummy) + print 20, lat2, lon2, azi2 + 20 format(f20.15, 1x, f20.15, 1x, f20.15) + go to 10 + 90 continue + stop + end diff --git a/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.for b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.for new file mode 100644 index 000000000..6501363c1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.for @@ -0,0 +1,2000 @@ +* The subroutines in this files are documented at +* http://geographiclib.sourceforge.net/html/Fortran/ +* +*> @file geodesic.for +*! @brief Implementation of geodesic routines in Fortran +*! +*! This is a Fortran implementation of the geodesic algorithms described +*! in +*! - C. F. F. Karney, +*! +*! Algorithms for geodesics, +*! J. Geodesy 87, 43--55 (2013); +*! DOI: +*! 10.1007/s00190-012-0578-z; +*! addenda: +*! geod-addenda.html. +*! . +*! The principal advantages of these algorithms over previous ones +*! (e.g., Vincenty, 1975) are +*! - accurate to round off for |f| < 1/50; +*! - the solution of the inverse problem is always found; +*! - differential and integral properties of geodesics are computed. +*! +*! The shortest path between two points on the ellipsoid at (\e lat1, \e +*! lon1) and (\e lat2, \e lon2) is called the geodesic. Its length is +*! \e s12 and the geodesic from point 1 to point 2 has forward azimuths +*! \e azi1 and \e azi2 at the two end points. +*! +*! Traditionally two geodesic problems are considered: +*! - the direct problem -- given \e lat1, \e lon1, \e s12, and \e azi1, +*! determine \e lat2, \e lon2, and \e azi2. This is solved by the +*! subroutine direct(). +*! - the inverse problem -- given \e lat1, \e lon1, \e lat2, \e lon2, +*! determine \e s12, \e azi1, and \e azi2. This is solved by the +*! subroutine invers(). +*! +*! The ellipsoid is specified by its equatorial radius \e a (typically +*! in meters) and flattening \e f. The routines are accurate to round +*! off with double precision arithmetic provided that |f| < +*! 1/50; for the WGS84 ellipsoid, the errors are less than 15 +*! nanometers. (Reasonably accurate results are obtained for |f| +*! < 1/5.) For a prolate ellipsoid, specify \e f < 0. +*! +*! The routines also calculate several other quantities of interest +*! - \e SS12 is the area between the geodesic from point 1 to point 2 +*! and the equator; i.e., it is the area, measured counter-clockwise, +*! of the geodesic quadrilateral with corners (\e lat1,\e lon1), (0,\e +*! lon1), (0,\e lon2), and (\e lat2,\e lon2). +*! - \e m12, the reduced length of the geodesic is defined such that if +*! the initial azimuth is perturbed by \e dazi1 (radians) then the +*! second point is displaced by \e m12 \e dazi1 in the direction +*! perpendicular to the geodesic. On a curved surface the reduced +*! length obeys a symmetry relation, \e m12 + \e m21 = 0. On a flat +*! surface, we have \e m12 = \e s12. +*! - \e MM12 and \e MM21 are geodesic scales. If two geodesics are +*! parallel at point 1 and separated by a small distance \e dt, then +*! they are separated by a distance \e MM12 \e dt at point 2. \e MM21 +*! is defined similarly (with the geodesics being parallel to one +*! another at point 2). On a flat surface, we have \e MM12 = \e MM21 +*! = 1. +*! - \e a12 is the arc length on the auxiliary sphere. This is a +*! construct for converting the problem to one in spherical +*! trigonometry. \e a12 is measured in degrees. The spherical arc +*! length from one equator crossing to the next is always 180°. +*! +*! If points 1, 2, and 3 lie on a single geodesic, then the following +*! addition rules hold: +*! - \e s13 = \e s12 + \e s23 +*! - \e a13 = \e a12 + \e a23 +*! - \e SS13 = \e SS12 + \e SS23 +*! - \e m13 = \e m12 \e MM23 + \e m23 \e MM21 +*! - \e MM13 = \e MM12 \e MM23 − (1 − \e MM12 \e MM21) \e +*! m23 / \e m12 +*! - \e MM31 = \e MM32 \e MM21 − (1 − \e MM23 \e MM32) \e +*! m12 / \e m23 +*! +*! The shortest distance returned by the solution of the inverse problem +*! is (obviously) uniquely defined. However, in a few special cases +*! there are multiple azimuths which yield the same shortest distance. +*! Here is a catalog of those cases: +*! - \e lat1 = −\e lat2 (with neither point at a pole). If \e azi1 = \e +*! azi2, the geodesic is unique. Otherwise there are two geodesics +*! and the second one is obtained by setting [\e azi1, \e azi2] = [\e +*! azi2, \e azi1], [\e MM12, \e MM21] = [\e MM21, \e MM12], \e SS12 = +*! −\e SS12. (This occurs when the longitude difference is near +*! ±180° for oblate ellipsoids.) +*! - \e lon2 = \e lon1 ± 180° (with neither point at a pole). If +*! \e azi1 = 0° or ±180°, the geodesic is unique. +*! Otherwise there are two geodesics and the second one is obtained by +*! setting [\e azi1, \e azi2] = [−\e azi1, −\e azi2], \e +*! SS12 = −\e SS12. (This occurs when \e lat2 is near +*! −\e lat1 for prolate ellipsoids.) +*! - Points 1 and 2 at opposite poles. There are infinitely many +*! geodesics which can be generated by setting [\e azi1, \e azi2] = +*! [\e azi1, \e azi2] + [\e d, −\e d], for arbitrary \e d. (For +*! spheres, this prescription applies when points 1 and 2 are +*! antipodal.) +*! - \e s12 = 0 (coincident points). There are infinitely many +*! geodesics which can be generated by setting [\e azi1, \e azi2] = +*! [\e azi1, \e azi2] + [\e d, \e d], for arbitrary \e d. +*! +*! These routines are a simple transcription of the corresponding C++ +*! classes in GeographicLib. +*! Because of the limitations of Fortran 77, the classes have been +*! replaced by simple subroutines with no attempt to save "state" across +*! subroutine calls. Most of the internal comments have been retained. +*! However, in the process of transcription some documentation has been +*! lost and the documentation for the C++ classes, +*! GeographicLib::Geodesic, GeographicLib::GeodesicLine, and +*! GeographicLib::PolygonArea, should be consulted. The C++ code +*! remains the "reference implementation". Think twice about +*! restructuring the internals of the Fortran code since this may make +*! porting fixes from the C++ code more difficult. +*! +*! Copyright (c) Charles Karney (2012-2013) and +*! licensed under the MIT/X11 License. For more information, see +*! http://geographiclib.sourceforge.net/ +*! +*! This library was distributed with +*! GeographicLib 1.31. + +*> Solve the direct geodesic problem +*! +*! @param[in] a the equatorial radius (meters). +*! @param[in] f the flattening of the ellipsoid. Setting \e f = 0 gives +*! a sphere. Negative \e f gives a prolate ellipsoid. +*! @param[in] lat1 latitude of point 1 (degrees). +*! @param[in] lon1 longitude of point 1 (degrees). +*! @param[in] azi1 azimuth at point 1 (degrees). +*! @param[in] s12a12 if \e arcmod is false, this is the distance between +*! point 1 and point 2 (meters); otherwise it is the arc length +*! between point 1 and point 2 (degrees); it can be negative. +*! @param[in] arcmod logical flag determining the meaning of the \e +*! s12a12. +*! @param[out] lat2 latitude of point 2 (degrees). +*! @param[out] lon2 longitude of point 2 (degrees). +*! @param[out] azi2 (forward) azimuth at point 2 (degrees). +*! @param[in] omask a bitor'ed combination of mask values +*! specifying which of the following parameters should be set. +*! @param[out] a12s12 if \e arcmod is false, this is the arc length +*! between point 1 and point 2 (degrees); otherwise it is the distance +*! between point 1 and point 2 (meters). +*! @param[out] m12 reduced length of geodesic (meters). +*! @param[out] MM12 geodesic scale of point 2 relative to point 1 +*! (dimensionless). +*! @param[out] MM21 geodesic scale of point 1 relative to point 2 +*! (dimensionless). +*! @param[out] SS12 area under the geodesic (meters2). +*! +*! \e omask is an integer in [0, 16) whose binary bits are interpreted +*! as follows +*! - 1 return \e a12 +*! - 2 return \e m12 +*! - 4 return \e MM12 and \e MM21 +*! - 8 return \e SS12 +*! +*! \e lat1 should be in the range [−90°, 90°]; \e lon1 and +*! \e azi1 should be in the range [−540°, 540°). The +*! values of \e lon2 and \e azi2 returned are in the range +*! [−180°, 180°). +*! +*! If either point is at a pole, the azimuth is defined by keeping the +*! longitude fixed, writing \e lat = \e lat = ±(90° − +*! ε), and taking the limit ε → 0+. An arc length +*! greater that 180° signifies a geodesic which is not a shortest +*! path. (For a prolate ellipsoid, an additional condition is necessary +*! for a shortest path: the longitudinal extent must not exceed of +*! 180°.) + + subroutine direct(a, f, lat1, lon1, azi1, s12a12, arcmod, + + lat2, lon2, azi2, omask, a12s12, m12, MM12, MM21, SS12) +* input + double precision a, f, lat1, lon1, azi1, s12a12 + logical arcmod + integer omask +* output + double precision lat2, lon2, azi2 +* optional output + double precision a12s12, m12, MM12, MM21, SS12 + + integer ord, nC1, nC1p, nC2, nA3, nA3x, nC3, nC3x, nC4, nC4x + parameter (ord = 6, nC1 = ord, nC1p = ord, + + nC2 = ord, nA3 = ord, nA3x = nA3, + + nC3 = ord, nC3x = (nC3 * (nC3 - 1)) / 2, + + nC4 = ord, nC4x = (nC4 * (nC4 + 1)) / 2) + double precision A3x(0:nA3x-1), C3x(0:nC3x-1), C4x(0:nC4x-1), + + C1a(nC1), C1pa(nC1p), C2a(nC2), C3a(nC3-1), C4a(0:nC4-1) + + double precision csmgt, atanhx, hypotx, + + AngNm, AngNm2, AngRnd, TrgSum, A1m1f, A2m1f, A3f + logical arcp, redlp, scalp, areap + double precision e2, f1, ep2, n, b, c2, + + lon1x, azi1x, phi, alp1, salp0, calp0, k2, eps, + + salp1, calp1, ssig1, csig1, cbet1, sbet1, dn1, somg1, comg1, + + salp2, calp2, ssig2, csig2, sbet2, cbet2, dn2, somg2, comg2, + + ssig12, csig12, salp12, calp12, omg12, lam12, lon12, + + sig12, stau1, ctau1, tau12, s12a, t, s, c, serr, + + A1m1, A2m1, A3c, A4, AB1, AB2, + + B11, B12, B21, B22, B31, B41, B42, J12 + + double precision dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh + integer digits, maxit1, maxit2 + logical init + common /geocom/ dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh, digits, maxit1, maxit2, init + + if (.not.init) call geoini + + e2 = f * (2 - f) + ep2 = e2 / (1 - e2) + f1 = 1 - f + n = f / (2 - f) + b = a * f1 + c2 = 0 + + arcp = mod(omask/1, 2) == 1 + redlp = mod(omask/2, 2) == 1 + scalp = mod(omask/4, 2) == 1 + areap = mod(omask/8, 2) == 1 + + if (areap) then + if (e2 .eq. 0) then + c2 = a**2 + else if (e2 .gt. 0) then + c2 = (a**2 + b**2 * atanhx(sqrt(e2)) / sqrt(e2)) / 2 + else + c2 = (a**2 + b**2 * atan(sqrt(abs(e2))) / sqrt(abs(e2))) / 2 + end if + end if + + call A3cof(n, A3x) + call C3cof(n, C3x) + if (areap) call C4cof(n, C4x) + +* Guard against underflow in salp0 + azi1x = AngRnd(AngNm(azi1)) + lon1x = AngNm(lon1) + +* alp1 is in [0, pi] + alp1 = azi1x * degree +* Enforce sin(pi) == 0 and cos(pi/2) == 0. Better to face the ensuing +* problems directly than to skirt them. + salp1 = csmgt(0d0, sin(alp1), azi1x .eq. -180) + calp1 = csmgt(0d0, cos(alp1), abs(azi1x) .eq. 90) + + phi = lat1 * degree +* Ensure cbet1 = +dbleps at poles + sbet1 = f1 * sin(phi) + cbet1 = csmgt(tiny, cos(phi), abs(lat1) .eq. 90) + call Norm(sbet1, cbet1) + dn1 = sqrt(1 + ep2 * sbet1**2) + +* Evaluate alp0 from sin(alp1) * cos(bet1) = sin(alp0), +* alp0 in [0, pi/2 - |bet1|] + salp0 = salp1 * cbet1 +* Alt: calp0 = hypot(sbet1, calp1 * cbet1). The following +* is slightly better (consider the case salp1 = 0). + calp0 = hypotx(calp1, salp1 * sbet1) +* Evaluate sig with tan(bet1) = tan(sig1) * cos(alp1). +* sig = 0 is nearest northward crossing of equator. +* With bet1 = 0, alp1 = pi/2, we have sig1 = 0 (equatorial line). +* With bet1 = pi/2, alp1 = -pi, sig1 = pi/2 +* With bet1 = -pi/2, alp1 = 0 , sig1 = -pi/2 +* Evaluate omg1 with tan(omg1) = sin(alp0) * tan(sig1). +* With alp0 in (0, pi/2], quadrants for sig and omg coincide. +* No atan2(0,0) ambiguity at poles since cbet1 = +dbleps. +* With alp0 = 0, omg1 = 0 for alp1 = 0, omg1 = pi for alp1 = pi. + ssig1 = sbet1 + somg1 = salp0 * sbet1 + csig1 = csmgt(cbet1 * calp1, 1d0, sbet1 .ne. 0 .or. calp1 .ne. 0) + comg1 = csig1 +* sig1 in (-pi, pi] + call Norm(ssig1, csig1) +* Geodesic::Norm(somg1, comg1); -- don't need to normalize! + + k2 = calp0**2 * ep2 + eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2) + + A1m1 = A1m1f(eps) + call C1f(eps, C1a) + B11 = TrgSum(.true., ssig1, csig1, C1a, nC1) + s = sin(B11) + c = cos(B11) +* tau1 = sig1 + B11 + stau1 = ssig1 * c + csig1 * s + ctau1 = csig1 * c - ssig1 * s +* Not necessary because C1pa reverts C1a +* B11 = -TrgSum(true, stau1, ctau1, C1pa, nC1p) + + if (.not. arcmod) call C1pf(eps, C1pa) + + if (redlp .or. scalp) then + A2m1 = A2m1f(eps) + call C2f(eps, C2a) + B21 = TrgSum(.true., ssig1, csig1, C2a, nC2) + else +* Suppress bogus warnings about unitialized variables + A2m1 = 0 + B21 = 0 + end if + + call C3f(eps, C3x, C3a) + A3c = -f * salp0 * A3f(eps, A3x) + B31 = TrgSum(.true., ssig1, csig1, C3a, nC3-1) + + if (areap) then + call C4f(eps, C4x, C4a) +* Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0) + A4 = a**2 * calp0 * salp0 * e2 + B41 = TrgSum(.false., ssig1, csig1, C4a, nC4) + else +* Suppress bogus warnings about unitialized variables + A4 = 0 + B41 = 0 + end if + + if (arcmod) then +* Interpret s12a12 as spherical arc length + sig12 = s12a12 * degree + s12a = abs(s12a12) + s12a = s12a - 180 * aint(s12a / 180) + ssig12 = csmgt(0d0, sin(sig12), s12a .eq. 0) + csig12 = csmgt(0d0, cos(sig12), s12a .eq. 90) +* Suppress bogus warnings about unitialized variables + B12 = 0 + else +* Interpret s12a12 as distance + tau12 = s12a12 / (b * (1 + A1m1)) + s = sin(tau12) + c = cos(tau12) +* tau2 = tau1 + tau12 + B12 = - TrgSum(.true., + + stau1 * c + ctau1 * s, ctau1 * c - stau1 * s, C1pa, nC1p) + sig12 = tau12 - (B12 - B11) + ssig12 = sin(sig12) + csig12 = cos(sig12) + if (abs(f) .gt. 0.01d0) then +* Reverted distance series is inaccurate for |f| > 1/100, so correct +* sig12 with 1 Newton iteration. The following table shows the +* approximate maximum error for a = WGS_a() and various f relative to +* GeodesicExact. +* erri = the error in the inverse solution (nm) +* errd = the error in the direct solution (series only) (nm) +* errda = the error in the direct solution (series + 1 Newton) (nm) +* +* f erri errd errda +* -1/5 12e6 1.2e9 69e6 +* -1/10 123e3 12e6 765e3 +* -1/20 1110 108e3 7155 +* -1/50 18.63 200.9 27.12 +* -1/100 18.63 23.78 23.37 +* -1/150 18.63 21.05 20.26 +* 1/150 22.35 24.73 25.83 +* 1/100 22.35 25.03 25.31 +* 1/50 29.80 231.9 30.44 +* 1/20 5376 146e3 10e3 +* 1/10 829e3 22e6 1.5e6 +* 1/5 157e6 3.8e9 280e6 + ssig2 = ssig1 * csig12 + csig1 * ssig12 + csig2 = csig1 * csig12 - ssig1 * ssig12 + B12 = TrgSum(.true., ssig2, csig2, C1a, nC1) + serr = (1 + A1m1) * (sig12 + (B12 - B11)) - s12a12 / b + sig12 = sig12 - serr / sqrt(1 + k2 * ssig2**2) + ssig12 = sin(sig12) + csig12 = cos(sig12) +* Update B12 below + end if + end if + +* sig2 = sig1 + sig12 + ssig2 = ssig1 * csig12 + csig1 * ssig12 + csig2 = csig1 * csig12 - ssig1 * ssig12 + dn2 = sqrt(1 + k2 * ssig2**2) + if (arcmod .or. abs(f) .gt. 0.01d0) + + B12 = TrgSum(.true., ssig2, csig2, C1a, nC1) + AB1 = (1 + A1m1) * (B12 - B11) + +* sin(bet2) = cos(alp0) * sin(sig2) + sbet2 = calp0 * ssig2 +* Alt: cbet2 = hypot(csig2, salp0 * ssig2) + cbet2 = hypotx(salp0, calp0 * csig2) + if (cbet2 .eq. 0) then +* I.e., salp0 = 0, csig2 = 0. Break the degeneracy in this case + cbet2 = tiny + csig2 = cbet2 + end if +* tan(omg2) = sin(alp0) * tan(sig2) +* No need to normalize + somg2 = salp0 * ssig2 + comg2 = csig2 +* tan(alp0) = cos(sig2)*tan(alp2) +* No need to normalize + salp2 = salp0 + calp2 = calp0 * csig2 +* omg12 = omg2 - omg1 + omg12 = atan2(somg2 * comg1 - comg2 * somg1, + + comg2 * comg1 + somg2 * somg1) + + lam12 = omg12 + A3c * + + ( sig12 + (TrgSum(.true., ssig2, csig2, C3a, nC3-1) + + - B31)) + lon12 = lam12 / degree +* Use Math::AngNm2 because longitude might have wrapped multiple +* times. + lon12 = AngNm2(lon12) + lon2 = AngNm(lon1x + lon12) + lat2 = atan2(sbet2, f1 * cbet2) / degree +* minus signs give range [-180, 180). 0- converts -0 to +0. + azi2 = 0 - atan2(-salp2, calp2) / degree + + if (redlp .or. scalp) then + B22 = TrgSum(.true., ssig2, csig2, C2a, nC2) + AB2 = (1 + A2m1) * (B22 - B21) + J12 = (A1m1 - A2m1) * sig12 + (AB1 - AB2) + end if +* Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure +* accurate cancellation in the case of coincident points. + if (redlp) m12 = b * ((dn2 * (csig1 * ssig2) - + + dn1 * (ssig1 * csig2)) - csig1 * csig2 * J12) + if (scalp) then + t = k2 * (ssig2 - ssig1) * (ssig2 + ssig1) / (dn1 + dn2) + MM12 = csig12 + (t * ssig2 - csig2 * J12) * ssig1 / dn1 + MM21 = csig12 - (t * ssig1 - csig1 * J12) * ssig2 / dn2 + end if + + if (areap) then + B42 = TrgSum(.false., ssig2, csig2, C4a, nC4) + if (calp0 .eq. 0 .or. salp0 .eq. 0) then +* alp12 = alp2 - alp1, used in atan2 so no need to normalized + salp12 = salp2 * calp1 - calp2 * salp1 + calp12 = calp2 * calp1 + salp2 * salp1 +* The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz +* salp12 = -0 and alp12 = -180. However this depends on the sign being +* attached to 0 correctly. The following ensures the correct behavior. + if (salp12 .eq. 0 .and. calp12 .lt. 0) then + salp12 = tiny * calp1 + calp12 = -1 + end if + else +* tan(alp) = tan(alp0) * sec(sig) +* tan(alp2-alp1) = (tan(alp2) -tan(alp1)) / (tan(alp2)*tan(alp1)+1) +* = calp0 * salp0 * (csig1-csig2) / (salp0^2 + calp0^2 * csig1*csig2) +* If csig12 > 0, write +* csig1 - csig2 = ssig12 * (csig1 * ssig12 / (1 + csig12) + ssig1) +* else +* csig1 - csig2 = csig1 * (1 - csig12) + ssig12 * ssig1 +* No need to normalize + salp12 = calp0 * salp0 * + + csmgt(csig1 * (1 - csig12) + ssig12 * ssig1, + + ssig12 * (csig1 * ssig12 / (1 + csig12) + ssig1), + + csig12 .le. 0) + calp12 = salp0**2 + calp0**2 * csig1 * csig2 + end if + SS12 = c2 * atan2(salp12, calp12) + A4 * (B42 - B41) + end if + + if (arcp) a12s12 = csmgt(b * ((1 + A1m1) * sig12 + AB1), + + sig12 / degree, arcmod) + + return + end + +*> Solve the inverse geodesic problem. +*! +*! @param[in] a the equatorial radius (meters). +*! @param[in] f the flattening of the ellipsoid. Setting \e f = 0 gives +*! a sphere. Negative \e f gives a prolate ellipsoid. +*! @param[in] lat1 latitude of point 1 (degrees). +*! @param[in] lon1 longitude of point 1 (degrees). +*! @param[in] lat2 latitude of point 2 (degrees). +*! @param[in] lon2 longitude of point 2 (degrees). +*! @param[out] s12 distance between point 1 and point 2 (meters). +*! @param[out] azi1 azimuth at point 1 (degrees). +*! @param[out] azi2 (forward) azimuth at point 2 (degrees). +*! @param[in] omask a bitor'ed combination of mask values +*! specifying which of the following parameters should be set. +*! @param[out] a12 arc length of between point 1 and point 2 (degrees). +*! @param[out] m12 reduced length of geodesic (meters). +*! @param[out] MM12 geodesic scale of point 2 relative to point 1 +*! (dimensionless). +*! @param[out] MM21 geodesic scale of point 1 relative to point 2 +*! (dimensionless). +*! @param[out] SS12 area under the geodesic (meters2). +*! +*! \e omask is an integer in [0, 16) whose binary bits are interpreted +*! as follows +*! - 1 return \e a12 +*! - 2 return \e m12 +*! - 4 return \e MM12 and \e MM21 +*! - 8 return \e SS12 +*! +*! \e lat1 and \e lat2 should be in the range [−90°, 90°]; +*! \e lon1 and \e lon2 should be in the range [−540°, +*! 540°). The values of \e azi1 and \e azi2 returned are in the +*! range [−180°, 180°). +*! +*! If either point is at a pole, the azimuth is defined by keeping the +*! longitude fixed, writing \e lat = ±(90° − +*! ε), and taking the limit ε → 0+. +*! +*! The solution to the inverse problem is found using Newton's method. +*! If this fails to converge (this is very unlikely in geodetic +*! applications but does occur for very eccentric ellipsoids), then the +*! bisection method is used to refine the solution. + + subroutine invers(a, f, lat1, lon1, lat2, lon2, + + s12, azi1, azi2, omask, a12, m12, MM12, MM21, SS12) +* input + double precision a, f, lat1, lon1, lat2, lon2 + integer omask +* output + double precision s12, azi1, azi2 +* optional output + double precision a12, m12, MM12, MM21, SS12 + + integer ord, nC1, nC2, nA3, nA3x, nC3, nC3x, nC4, nC4x + parameter (ord = 6, nC1 = ord, nC2 = ord, nA3 = ord, nA3x = nA3, + + nC3 = ord, nC3x = (nC3 * (nC3 - 1)) / 2, + + nC4 = ord, nC4x = (nC4 * (nC4 + 1)) / 2) + double precision A3x(0:nA3x-1), C3x(0:nC3x-1), C4x(0:nC4x-1), + + C1a(nC1), C2a(nC2), C3a(nC3-1), C4a(0:nC4-1) + + double precision csmgt, atanhx, hypotx, + + AngNm, AngDif, AngRnd, TrgSum, Lam12f, InvSta + integer latsgn, lonsgn, swapp, numit + logical arcp, redlp, scalp, areap, merid, tripn, tripb + + double precision e2, f1, ep2, n, b, c2, + + lat1x, lat2x, phi, salp0, calp0, k2, eps, + + salp1, calp1, ssig1, csig1, cbet1, sbet1, dbet1, dn1, + + salp2, calp2, ssig2, csig2, sbet2, cbet2, dbet2, dn2, + + slam12, clam12, salp12, calp12, omg12, lam12, lon12, + + salp1a, calp1a, salp1b, calp1b, + + dalp1, sdalp1, cdalp1, nsalp1, alp12, somg12, domg12, + + sig12, v, dv, dnm, dummy, + + A4, B41, B42, s12x, m12x, a12x + + double precision dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh + integer digits, maxit1, maxit2 + logical init + common /geocom/ dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh, digits, maxit1, maxit2, init + + if (.not.init) call geoini + + f1 = 1 - f + e2 = f * (2 - f) + ep2 = e2 / f1**2 + n = f / ( 2 - f) + b = a * f1 + c2 = 0 + + arcp = mod(omask/1, 2) == 1 + redlp = mod(omask/2, 2) == 1 + scalp = mod(omask/4, 2) == 1 + areap = mod(omask/8, 2) == 1 + + if (areap) then + if (e2 .eq. 0) then + c2 = a**2 + else if (e2 .gt. 0) then + c2 = (a**2 + b**2 * atanhx(sqrt(e2)) / sqrt(e2)) / 2 + else + c2 = (a**2 + b**2 * atan(sqrt(abs(e2))) / sqrt(abs(e2))) / 2 + end if + end if + + call A3cof(n, A3x) + call C3cof(n, C3x) + if (areap) call C4cof(n, C4x) + +* Compute longitude difference (AngDiff does this carefully). Result is +* in [-180, 180] but -180 is only for west-going geodesics. 180 is for +* east-going and meridional geodesics. + lon12 = AngDif(AngNm(lon1), AngNm(lon2)) +* If very close to being on the same half-meridian, then make it so. + lon12 = AngRnd(lon12) +* Make longitude difference positive. + if (lon12 .ge. 0) then + lonsgn = 1 + else + lonsgn = -1 + end if + lon12 = lon12 * lonsgn +* If really close to the equator, treat as on equator. + lat1x = AngRnd(lat1) + lat2x = AngRnd(lat2) +* Swap points so that point with higher (abs) latitude is point 1 + if (abs(lat1x) .ge. abs(lat2x)) then + swapp = 1 + else + swapp = -1 + end if + if (swapp .lt. 0) then + lonsgn = -lonsgn + call swap(lat1x, lat2x) + end if +* Make lat1 <= 0 + if (lat1x .lt. 0) then + latsgn = 1 + else + latsgn = -1 + end if + lat1x = lat1x * latsgn + lat2x = lat2x * latsgn +* Now we have +* +* 0 <= lon12 <= 180 +* -90 <= lat1 <= 0 +* lat1 <= lat2 <= -lat1 +* +* longsign, swapp, latsgn register the transformation to bring the +* coordinates to this canonical form. In all cases, 1 means no change +* was made. We make these transformations so that there are few cases +* to check, e.g., on verifying quadrants in atan2. In addition, this +* enforces some symmetries in the results returned. + + phi = lat1x * degree +* Ensure cbet1 = +dbleps at poles + sbet1 = f1 * sin(phi) + cbet1 = csmgt(tiny, cos(phi), lat1x .eq. -90) + call Norm(sbet1, cbet1) + + phi = lat2x * degree +* Ensure cbet2 = +dbleps at poles + sbet2 = f1 * sin(phi) + cbet2 = csmgt(tiny, cos(phi), abs(lat2x) .eq. 90) + call Norm(sbet2, cbet2) + +* If cbet1 < -sbet1, then cbet2 - cbet1 is a sensitive measure of the +* |bet1| - |bet2|. Alternatively (cbet1 >= -sbet1), abs(sbet2) + sbet1 +* is a better measure. This logic is used in assigning calp2 in +* Lambda12. Sometimes these quantities vanish and in that case we force +* bet2 = +/- bet1 exactly. An example where is is necessary is the +* inverse problem 48.522876735459 0 -48.52287673545898293 +* 179.599720456223079643 which failed with Visual Studio 10 (Release and +* Debug) + + if (cbet1 .lt. -sbet1) then + if (cbet2 .eq. cbet1) sbet2 = sign(sbet1, sbet2) + else + if (abs(sbet2) .eq. -sbet1) cbet2 = cbet1 + end if + + dn1 = sqrt(1 + ep2 * sbet1**2) + dn2 = sqrt(1 + ep2 * sbet2**2) + + lam12 = lon12 * degree + slam12 = sin(lam12) + if (lon12 .eq. 180) slam12 = 0 +* lon12 == 90 isn't interesting + clam12 = cos(lam12) + +* Suppress bogus warnings about unitialized variables + a12x = 0 + merid = lat1x .eq. -90 .or. slam12 == 0 + + if (merid) then + +* Endpoints are on a single full meridian, so the geodesic might lie on +* a meridian. + +* Head to the target longitude + calp1 = clam12 + salp1 = slam12 +* At the target we're heading north + calp2 = 1 + salp2 = 0 + +* tan(bet) = tan(sig) * cos(alp) + ssig1 = sbet1 + csig1 = calp1 * cbet1 + ssig2 = sbet2 + csig2 = calp2 * cbet2 + +* sig12 = sig2 - sig1 + sig12 = atan2(max(csig1 * ssig2 - ssig1 * csig2, 0d0), + + csig1 * csig2 + ssig1 * ssig2) + call Lengs(n, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, + + cbet1, cbet2, s12x, m12x, dummy, + + scalp, MM12, MM21, ep2, C1a, C2a) + +* Add the check for sig12 since zero length geodesics might yield m12 < +* 0. Test case was +* +* echo 20.001 0 20.001 0 | Geod -i +* +* In fact, we will have sig12 > pi/2 for meridional geodesic which is +* not a shortest path. + if (sig12 .lt. 1 .or. m12x .ge. 0) then + m12x = m12x * b + s12x = s12x * b + a12x = sig12 / degree + else +* m12 < 0, i.e., prolate and too close to anti-podal + merid = .false. + end if + end if + +* Mimic the way Lambda12 works with calp1 = 0 + if (.not. merid .and. sbet1 .eq. 0 .and. + + (f .le. 0 .or. lam12 .le. pi - f * pi)) then + +* Geodesic runs along equator + calp1 = 0 + calp2 = 0 + salp1 = 1 + salp2 = 1 + s12x = a * lam12 + sig12 = lam12 / f1 + omg12 = sig12 + m12x = b * sin(sig12) + if (scalp) then + MM12 = cos(sig12) + MM21 = MM12 + end if + a12x = lon12 / f1 + else if (.not. merid) then +* Now point1 and point2 belong within a hemisphere bounded by a +* meridian and geodesic is neither meridional or equatorial. + +* Figure a starting point for Newton's method + sig12 = InvSta(sbet1, cbet1, dn1, sbet2, cbet2, dn2, lam12, + + f, A3x, salp1, calp1, salp2, calp2, dnm, C1a, C2a) + + if (sig12 .ge. 0) then +* Short lines (InvSta sets salp2, calp2, dnm) + s12x = sig12 * b * dnm + m12x = dnm**2 * b * sin(sig12 / dnm) + if (scalp) then + MM12 = cos(sig12 / dnm) + MM21 = MM12 + end if + a12x = sig12 / degree + omg12 = lam12 / (f1 * dnm) + else + +* Newton's method. This is a straightforward solution of f(alp1) = +* lambda12(alp1) - lam12 = 0 with one wrinkle. f(alp) has exactly one +* root in the interval (0, pi) and its derivative is positive at the +* root. Thus f(alp) is positive for alp > alp1 and negative for alp < +* alp1. During the course of the iteration, a range (alp1a, alp1b) is +* maintained which brackets the root and with each evaluation of +* f(alp) the range is shrunk, if possible. Newton's method is +* restarted whenever the derivative of f is negative (because the new +* value of alp1 is then further from the solution) or if the new +* estimate of alp1 lies outside (0,pi); in this case, the new starting +* guess is taken to be (alp1a + alp1b) / 2. + +* Bracketing range + salp1a = tiny + calp1a = 1 + salp1b = tiny + calp1b = -1 + tripn = .false. + tripb = .false. + do 10 numit = 0, maxit2-1 +* the WGS84 test set: mean = 1.47, sd = 1.25, max = 16 +* WGS84 and random input: mean = 2.85, sd = 0.60 + v = Lam12f(sbet1, cbet1, dn1, sbet2, cbet2, dn2, + + salp1, calp1, f, A3x, C3x, salp2, calp2, sig12, + + ssig1, csig1, ssig2, csig2, + + eps, omg12, numit .lt. maxit1, dv, + + C1a, C2a, C3a) - lam12 +* 2 * tol0 is approximately 1 ulp for a number in [0, pi]. +* Reversed test to allow escape with NaNs + if (tripb .or. + + .not. (abs(v) .ge. csmgt(8d0, 2d0, tripn) * tol0)) + + go to 20 +* Update bracketing values + if (v .gt. 0 .and. (numit .gt. maxit1 .or. + + calp1/salp1 .gt. calp1b/salp1b)) then + salp1b = salp1 + calp1b = calp1 + else if (v .lt. 0 .and. (numit .gt. maxit1 .or. + + calp1/salp1 .lt. calp1a/salp1a)) then + salp1a = salp1 + calp1a = calp1 + end if + if (numit .lt. maxit1 .and. dv .gt. 0) then + dalp1 = -v/dv + sdalp1 = sin(dalp1) + cdalp1 = cos(dalp1) + nsalp1 = salp1 * cdalp1 + calp1 * sdalp1 + if (nsalp1 .gt. 0 .and. abs(dalp1) .lt. pi) then + calp1 = calp1 * cdalp1 - salp1 * sdalp1 + salp1 = nsalp1 + call Norm(salp1, calp1) +* In some regimes we don't get quadratic convergence because +* slope -> 0. So use convergence conditions based on dbleps +* instead of sqrt(dbleps). + tripn = abs(v) .le. 16 * tol0 + go to 10 + end if + end if +* Either dv was not postive or updated value was outside legal +* range. Use the midpoint of the bracket as the next estimate. +* This mechanism is not needed for the WGS84 ellipsoid, but it does +* catch problems with more eccentric ellipsoids. Its efficacy is +* such for the WGS84 test set with the starting guess set to alp1 = +* 90deg: +* the WGS84 test set: mean = 5.21, sd = 3.93, max = 24 +* WGS84 and random input: mean = 4.74, sd = 0.99 + salp1 = (salp1a + salp1b)/2 + calp1 = (calp1a + calp1b)/2 + call Norm(salp1, calp1) + tripn = .false. + tripb = abs(salp1a - salp1) + (calp1a - calp1) .lt. tolb + + .or. abs(salp1 - salp1b) + (calp1 - calp1b) .lt. tolb + 10 continue + 20 continue + call Lengs(eps, sig12, ssig1, csig1, dn1, + + ssig2, csig2, dn2, cbet1, cbet2, s12x, m12x, dummy, + + scalp, MM12, MM21, ep2, C1a, C2a) + m12x = m12x * b + s12x = s12x * b + a12x = sig12 / degree + omg12 = lam12 - omg12 + end if + end if + +* Convert -0 to 0 + s12 = 0 + s12x + if (redlp) m12 = 0 + m12x + + if (areap) then +* From Lambda12: sin(alp1) * cos(bet1) = sin(alp0) + salp0 = salp1 * cbet1 + calp0 = hypotx(calp1, salp1 * sbet1) + if (calp0 .ne. 0 .and. salp0 .ne. 0) then +* From Lambda12: tan(bet) = tan(sig) * cos(alp) + ssig1 = sbet1 + csig1 = calp1 * cbet1 + ssig2 = sbet2 + csig2 = calp2 * cbet2 + k2 = calp0**2 * ep2 + eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2) +* Multiplier = a^2 * e^2 * cos(alpha0) * sin(alpha0). + A4 = a**2 * calp0 * salp0 * e2 + call Norm(ssig1, csig1) + call Norm(ssig2, csig2) + call C4f(eps, C4x, C4a) + B41 = TrgSum(.false., ssig1, csig1, C4a, nC4) + B42 = TrgSum(.false., ssig2, csig2, C4a, nC4) + SS12 = A4 * (B42 - B41) + else +* Avoid problems with indeterminate sig1, sig2 on equator + SS12 = 0 + end if + + if (.not. merid .and. omg12 .lt. 0.75d0 * pi + + .and. sbet2 - sbet1 .lt. 1.75d0) then +* Use tan(Gamma/2) = tan(omg12/2) +* * (tan(bet1/2)+tan(bet2/2))/(1+tan(bet1/2)*tan(bet2/2)) +* with tan(x/2) = sin(x)/(1+cos(x)) + somg12 = sin(omg12) + domg12 = 1 + cos(omg12) + dbet1 = 1 + cbet1 + dbet2 = 1 + cbet2 + alp12 = 2 * atan2(somg12 * (sbet1 * dbet2 + sbet2 * dbet1), + + domg12 * ( sbet1 * sbet2 + dbet1 * dbet2 ) ) + else +* alp12 = alp2 - alp1, used in atan2 so no need to normalize + salp12 = salp2 * calp1 - calp2 * salp1 + calp12 = calp2 * calp1 + salp2 * salp1 +* The right thing appears to happen if alp1 = +/-180 and alp2 = 0, viz +* salp12 = -0 and alp12 = -180. However this depends on the sign +* being attached to 0 correctly. The following ensures the correct +* behavior. + if (salp12 .eq. 0 .and. calp12 .lt. 0) then + salp12 = tiny * calp1 + calp12 = -1 + end if + alp12 = atan2(salp12, calp12) + end if + SS12 = SS12 + c2 * alp12 + SS12 = SS12 * swapp * lonsgn * latsgn +* Convert -0 to 0 + SS12 = 0 + SS12 + end if + +* Convert calp, salp to azimuth accounting for lonsgn, swapp, latsgn. + if (swapp .lt. 0) then + call swap(salp1, salp2) + call swap(calp1, calp2) + if (scalp) call swap(MM12, MM21) + end if + + salp1 = salp1 * swapp * lonsgn + calp1 = calp1 * swapp * latsgn + salp2 = salp2 * swapp * lonsgn + calp2 = calp2 * swapp * latsgn + +* minus signs give range [-180, 180). 0- converts -0 to +0. + azi1 = 0 - atan2(-salp1, calp1) / degree + azi2 = 0 - atan2(-salp2, calp2) / degree + + if (arcp) a12 = a12x + + return + end + +*> Determine the area of a geodesic polygon +*! +*! @param[in] a the equatorial radius (meters). +*! @param[in] f the flattening of the ellipsoid. Setting \e f = 0 gives +*! a sphere. Negative \e f gives a prolate ellipsoid. +*! @param[in] lats an array of the latitudes of the vertices (degrees). +*! @param[in] lons an array of the longitudes of the vertices (degrees). +*! @param[in] n the number of vertices +*! @param[out] AA the (signed) area of the polygon (meters2) +*! @param[out] PP the perimeter of the polygon +*! +*! \e lats should be in the range [−90°, 90°]; \e lons +*! should be in the range [−540°, 540°). +*! +*! Only simple polygons (which are not self-intersecting) are allowed. +*! There's no need to "close" the polygon by repeating the first vertex. +*! The area returned is signed with counter-clockwise traversal being +*! treated as positive. + + subroutine area(a, f, lats, lons, n, AA, PP) +* input + integer n + double precision a, f, lats(n), lons(n) +* output + double precision AA, PP + + integer i, omask, cross, trnsit + double precision s12, azi1, azi2, dummy, SS12, b, e2, c2, area0, + + atanhx, Aacc(2), Pacc(2) + + double precision dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh + integer digits, maxit1, maxit2 + logical init + common /geocom/ dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh, digits, maxit1, maxit2, init + + omask = 8 + call accini(Aacc) + call accini(Pacc) + cross = 0 + do 10 i = 0, n-1 + call invers(a, f, lats(i+1), lons(i+1), + + lats(mod(i+1,n)+1), lons(mod(i+1,n)+1), + + s12, azi1, azi2, omask, dummy, dummy, dummy, dummy, SS12) + call accadd(Pacc, s12) + call accadd(Aacc, -SS12) + cross = cross + trnsit(lons(i+1), lons(mod(i+1,n)+1)) + 10 continue + PP = Pacc(1) + b = a * (1 - f) + e2 = f * (2 - f) + if (e2 .eq. 0) then + c2 = a**2 + else if (e2 .gt. 0) then + c2 = (a**2 + b**2 * atanhx(sqrt(e2)) / sqrt(e2)) / 2 + else + c2 = (a**2 + b**2 * atan(sqrt(abs(e2))) / sqrt(abs(e2))) / 2 + end if + area0 = 4 * pi * c2 + if (mod(abs(cross), 2) .eq. 1) then + if (Aacc(1) .lt. 0) then + call accadd(Aacc, +area0/2) + else + call accadd(Aacc, -area0/2) + end if + end if + if (Aacc(1) .gt. area0/2) then + call accadd(Aacc, -area0) + else if (Aacc(1) .le. -area0/2) then + call accadd(Aacc, +area0) + end if + AA = Aacc(1) + + return + end + +*> @cond SKIP + + block data geodat + double precision dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh + integer digits, maxit1, maxit2 + logical init + data init /.false./ + common /geocom/ dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh, digits, maxit1, maxit2, init + end + + subroutine geoini + double precision dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh + integer digits, maxit1, maxit2 + logical init + common /geocom/ dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh, digits, maxit1, maxit2, init + + digits = 53 + dblmin = 0.5d0**1022 + dbleps = 0.5d0**(digits-1) + + pi = atan2(0.0d0, -1.0d0) + degree = pi/180 + tiny = sqrt(dblmin) + tol0 = dbleps +* Increase multiplier in defn of tol1 from 100 to 200 to fix inverse +* case 52.784459512564 0 -52.784459512563990912 179.634407464943777557 +* which otherwise failed for Visual Studio 10 (Release and Debug) + tol1 = 200 * tol0 + tol2 = sqrt(tol0) +* Check on bisection interval + tolb = tol0 * tol2 + xthrsh = 1000 * tol2 + maxit1 = 20 + maxit2 = maxit1 + digits + 10 + + init = .true. + + return + end + + subroutine Lengs(eps, sig12, + + ssig1, csig1, dn1, ssig2, csig2, dn2, + + cbet1, cbet2, s12b, m12b, m0, + + scalp, MM12, MM21, ep2, C1a, C2a) +* input + double precision eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, + + cbet1, cbet2, ep2 + logical scalp +* output + double precision s12b, m12b, m0 +* optional output + double precision MM12, MM21 +* temporary storage + double precision C1a(*), C2a(*) + + integer ord, nC1, nC2 + parameter (ord = 6, nC1 = ord, nC2 = ord) + + double precision A1m1f, A2m1f, TrgSum + double precision A1m1, AB1, A2m1, AB2, J12, csig12, t + +* Return m12b = (reduced length)/b; also calculate s12b = distance/b, +* and m0 = coefficient of secular term in expression for reduced length. + call C1f(eps, C1a) + call C2f(eps, C2a) + + A1m1 = A1m1f(eps) + AB1 = (1 + A1m1) * (TrgSum(.true., ssig2, csig2, C1a, nC1) - + + TrgSum(.true., ssig1, csig1, C1a, nC1)) + A2m1 = A2m1f(eps) + AB2 = (1 + A2m1) * (TrgSum(.true., ssig2, csig2, C2a, nC2) - + + TrgSum(.true., ssig1, csig1, C2a, nC2)) + m0 = A1m1 - A2m1 + J12 = m0 * sig12 + (AB1 - AB2) +* Missing a factor of b. +* Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure +* accurate cancellation in the case of coincident points. + m12b = dn2 * (csig1 * ssig2) - dn1 * (ssig1 * csig2) - + + csig1 * csig2 * J12 +* Missing a factor of b + s12b = (1 + A1m1) * sig12 + AB1 + if (scalp) then + csig12 = csig1 * csig2 + ssig1 * ssig2 + t = ep2 * (cbet1 - cbet2) * (cbet1 + cbet2) / (dn1 + dn2) + MM12 = csig12 + (t * ssig2 - csig2 * J12) * ssig1 / dn1 + MM21 = csig12 - (t * ssig1 - csig1 * J12) * ssig2 / dn2 + end if + + return + end + + double precision function Astrd(x, y) +* Solve k^4+2*k^3-(x^2+y^2-1)*k^2-2*y^2*k-y^2 = 0 for positive root k. +* This solution is adapted from Geocentric::Reverse. +* input + double precision x, y + + double precision cbrt, csmgt + double precision k, p, q, r, S, r2, r3, disc, u, + + T3, T, ang, v, uv, w + + p = x**2 + q = y**2 + r = (p + q - 1) / 6 + if ( .not. (q .eq. 0 .and. r .lt. 0) ) then +* Avoid possible division by zero when r = 0 by multiplying equations +* for s and t by r^3 and r, resp. +* S = r^3 * s + S = p * q / 4 + r2 = r**2 + r3 = r * r2 +* The discrimant of the quadratic equation for T3. This is zero on +* the evolute curve p^(1/3)+q^(1/3) = 1 + disc = S * (S + 2 * r3) + u = r + if (disc .ge. 0) then + T3 = S + r3 +* Pick the sign on the sqrt to maximize abs(T3). This minimizes loss +* of precision due to cancellation. The result is unchanged because +* of the way the T is used in definition of u. +* T3 = (r * t)^3 + T3 = T3 + csmgt(-sqrt(disc), sqrt(disc), T3 .lt. 0) +* N.B. cbrt always returns the real root. cbrt(-8) = -2. +* T = r * t + T = cbrt(T3) +* T can be zero; but then r2 / T -> 0. + if (T .ne. 0) u = u + T + r2 / T + else +* T is complex, but the way u is defined the result is real. + ang = atan2(sqrt(-disc), -(S + r3)) +* There are three possible cube roots. We choose the root which +* avoids cancellation. Note that disc < 0 implies that r < 0. + u = u + 2 * r * cos(ang / 3) + end if +* guaranteed positive + v = sqrt(u**2 + q) +* Avoid loss of accuracy when u < 0. +* u+v, guaranteed positive + uv = csmgt(q / (v - u), u + v, u .lt. 0) +* positive? + w = (uv - q) / (2 * v) +* Rearrange expression for k to avoid loss of accuracy due to +* subtraction. Division by 0 not possible because uv > 0, w >= 0. +* guaranteed positive + k = uv / (sqrt(uv + w**2) + w) + else +* q == 0 && r <= 0 +* y = 0 with |x| <= 1. Handle this case directly. +* for y small, positive root is k = abs(y)/sqrt(1-x^2) + k = 0 + end if + Astrd = k + + return + end + + double precision function InvSta(sbet1, cbet1, dn1, + + sbet2, cbet2, dn2, lam12, f, A3x, + + salp1, calp1, salp2, calp2, dnm, + + C1a, C2a) +* Return a starting point for Newton's method in salp1 and calp1 +* (function value is -1). If Newton's method doesn't need to be used, +* return also salp2, calp2, and dnm and function value is sig12. +* input + double precision sbet1, cbet1, dn1, sbet2, cbet2, dn2, lam12, + + f, A3x(*) +* output + double precision salp1, calp1, salp2, calp2, dnm +* temporary + double precision C1a(*), C2a(*) + + double precision csmgt, hypotx, A3f, Astrd + logical shortp + double precision f1, e2, ep2, n, etol2, k2, eps, sig12, + + sbet12, cbet12, sbt12a, omg12, somg12, comg12, ssig12, csig12, + + x, y, lamscl, betscl, cbt12a, bt12a, m12b, m0, dummy, + + k, omg12a, sbetm2 + + double precision dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh + integer digits, maxit1, maxit2 + logical init + common /geocom/ dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh, digits, maxit1, maxit2, init + + f1 = 1 - f + e2 = f * (2 - f) + ep2 = e2 / (1 - e2) + n = f / (2 - f) +* The sig12 threshold for "really short". Using the auxiliary sphere +* solution with dnm computed at (bet1 + bet2) / 2, the relative error in +* the azimuth consistency check is sig12^2 * abs(f) * min(1, 1-f/2) / 2. +* (Error measured for 1/100 < b/a < 100 and abs(f) >= 1/1000. For a +* given f and sig12, the max error occurs for lines near the pole. If +* the old rule for computing dnm = (dn1 + dn2)/2 is used, then the error +* increases by a factor of 2.) Setting this equal to epsilon gives +* sig12 = etol2. Here 0.1 is a safety factor (error decreased by 100) +* and max(0.001, abs(f)) stops etol2 getting too large in the nearly +* spherical case. + etol2 = 0.1d0 * tol2 / + + sqrt( max(0.001d0, abs(f)) * min(1d0, 1 - f/2) / 2 ) + +* Return value + sig12 = -1 +* bet12 = bet2 - bet1 in [0, pi); bt12a = bet2 + bet1 in (-pi, 0] + sbet12 = sbet2 * cbet1 - cbet2 * sbet1 + cbet12 = cbet2 * cbet1 + sbet2 * sbet1 + sbt12a = sbet2 * cbet1 + cbet2 * sbet1 + + shortp = cbet12 .ge. 0 .and. sbet12 .lt. 0.5d0 .and. + + cbet2 * lam12 .lt. 0.5d0 + + omg12 = lam12 + if (shortp) then + sbetm2 = (sbet1 + sbet2)**2 +* sin((bet1+bet2)/2)^2 +* = (sbet1 + sbet2)^2 / ((sbet1 + sbet2)^2 + (cbet1 + cbet2)^2) + sbetm2 = sbetm2 / (sbetm2 + (cbet1 + cbet2)**2) + dnm = sqrt(1 + ep2 * sbetm2) + omg12 = omg12 / (f1 * dnm) + end if + somg12 = sin(omg12) + comg12 = cos(omg12) + + salp1 = cbet2 * somg12 + calp1 = csmgt(sbet12 + cbet2 * sbet1 * somg12**2 / (1 + comg12), + + sbt12a - cbet2 * sbet1 * somg12**2 / (1 - comg12), + + comg12 .ge. 0) + + ssig12 = hypotx(salp1, calp1) + csig12 = sbet1 * sbet2 + cbet1 * cbet2 * comg12 + + if (shortp .and. ssig12 .lt. etol2) then +* really short lines + salp2 = cbet1 * somg12 + calp2 = sbet12 - cbet1 * sbet2 * + + csmgt(somg12**2 / (1 + comg12), 1 - comg12, comg12 .ge. 0) + call Norm(salp2, calp2) +* Set return value + sig12 = atan2(ssig12, csig12) + else if (abs(n) .gt. 0.1d0 .or. csig12 .ge. 0 .or. + + ssig12 .ge. 6 * abs(n) * pi * cbet1**2) then +* Nothing to do, zeroth order spherical approximation is OK + continue + else +* Scale lam12 and bet2 to x, y coordinate system where antipodal point +* is at origin and singular point is at y = 0, x = -1. + if (f .ge. 0) then +* x = dlong, y = dlat + k2 = sbet1**2 * ep2 + eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2) + lamscl = f * cbet1 * A3f(eps, A3x) * pi + betscl = lamscl * cbet1 + x = (lam12 - pi) / lamscl + y = sbt12a / betscl + else +* f < 0: x = dlat, y = dlong + cbt12a = cbet2 * cbet1 - sbet2 * sbet1 + bt12a = atan2(sbt12a, cbt12a) +* In the case of lon12 = 180, this repeats a calculation made in +* Inverse. + call Lengs(n, pi + bt12a, + + sbet1, -cbet1, dn1, sbet2, cbet2, dn2, + + cbet1, cbet2, dummy, m12b, m0, .false., + + dummy, dummy, ep2, C1a, C2a) + x = -1 + m12b / (cbet1 * cbet2 * m0 * pi) + betscl = csmgt(sbt12a / x, -f * cbet1**2 * pi, + + x .lt. -0.01d0) + lamscl = betscl / cbet1 + y = (lam12 - pi) / lamscl + end if + + if (y .gt. -tol1 .and. x .gt. -1 - xthrsh) then +* strip near cut + if (f .ge. 0) then + salp1 = min(1d0, -x) + calp1 = - sqrt(1 - salp1**2) + else + calp1 = max(csmgt(0d0, 1d0, x .gt. -tol1), x) + salp1 = sqrt(1 - calp1**2) + end if + else +* Estimate alp1, by solving the astroid problem. +* +* Could estimate alpha1 = theta + pi/2, directly, i.e., +* calp1 = y/k; salp1 = -x/(1+k); for f >= 0 +* calp1 = x/(1+k); salp1 = -y/k; for f < 0 (need to check) +* +* However, it's better to estimate omg12 from astroid and use +* spherical formula to compute alp1. This reduces the mean number of +* Newton iterations for astroid cases from 2.24 (min 0, max 6) to 2.12 +* (min 0 max 5). The changes in the number of iterations are as +* follows: +* +* change percent +* 1 5 +* 0 78 +* -1 16 +* -2 0.6 +* -3 0.04 +* -4 0.002 +* +* The histogram of iterations is (m = number of iterations estimating +* alp1 directly, n = number of iterations estimating via omg12, total +* number of trials = 148605): +* +* iter m n +* 0 148 186 +* 1 13046 13845 +* 2 93315 102225 +* 3 36189 32341 +* 4 5396 7 +* 5 455 1 +* 6 56 0 +* +* Because omg12 is near pi, estimate work with omg12a = pi - omg12 + k = Astrd(x, y) + omg12a = lamscl * + + csmgt(-x * k/(1 + k), -y * (1 + k)/k, f .ge. 0) + somg12 = sin(omg12a) + comg12 = -cos(omg12a) +* Update spherical estimate of alp1 using omg12 instead of lam12 + salp1 = cbet2 * somg12 + calp1 = sbt12a - cbet2 * sbet1 * somg12**2 / (1 - comg12) + end if + end if +* Sanity check on starting guess + if (salp1 .gt. 0) then + call Norm(salp1, calp1) + else + salp1 = 1 + calp1 = 0 + end if + InvSta = sig12 + + return + end + + double precision function Lam12f(sbet1, cbet1, dn1, + + sbet2, cbet2, dn2, salp1, calp1, f, A3x, C3x, salp2, calp2, + + sig12, ssig1, csig1, ssig2, csig2, eps, domg12, diffp, dlam12, + + C1a, C2a, C3a) +* input + double precision sbet1, cbet1, dn1, sbet2, cbet2, dn2, + + salp1, calp1, f, A3x(*), C3x(*) + logical diffp +* output + double precision salp2, calp2, sig12, ssig1, csig1, ssig2, csig2, + + eps, domg12 +* optional output + double precision dlam12 +* temporary + double precision C1a(*), C2a(*), C3a(*) + + integer ord, nC3 + parameter (ord = 6, nC3 = ord) + + double precision csmgt, hypotx, A3f, TrgSum + + double precision f1, e2, ep2, salp0, calp0, + + somg1, comg1, somg2, comg2, omg12, lam12, B312, h0, k2, dummy + + double precision dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh + integer digits, maxit1, maxit2 + logical init + common /geocom/ dblmin, dbleps, pi, degree, tiny, + + tol0, tol1, tol2, tolb, xthrsh, digits, maxit1, maxit2, init + + f1 = 1 - f + e2 = f * (2 - f) + ep2 = e2 / (1 - e2) +* Break degeneracy of equatorial line. This case has already been +* handled. + if (sbet1 .eq. 0 .and. calp1 .eq. 0) calp1 = -tiny + +* sin(alp1) * cos(bet1) = sin(alp0) + salp0 = salp1 * cbet1 +* calp0 > 0 + calp0 = hypotx(calp1, salp1 * sbet1) + +* tan(bet1) = tan(sig1) * cos(alp1) +* tan(omg1) = sin(alp0) * tan(sig1) = tan(omg1)=tan(alp1)*sin(bet1) + ssig1 = sbet1 + somg1 = salp0 * sbet1 + csig1 = calp1 * cbet1 + comg1 = csig1 + call Norm(ssig1, csig1) +* Norm(somg1, comg1); -- don't need to normalize! + +* Enforce symmetries in the case abs(bet2) = -bet1. Need to be careful +* about this case, since this can yield singularities in the Newton +* iteration. +* sin(alp2) * cos(bet2) = sin(alp0) + salp2 = csmgt(salp0 / cbet2, salp1, cbet2 .ne. cbet1) +* calp2 = sqrt(1 - sq(salp2)) +* = sqrt(sq(calp0) - sq(sbet2)) / cbet2 +* and subst for calp0 and rearrange to give (choose positive sqrt +* to give alp2 in [0, pi/2]). + calp2 = csmgt(sqrt((calp1 * cbet1)**2 + + + csmgt((cbet2 - cbet1) * (cbet1 + cbet2), + + (sbet1 - sbet2) * (sbet1 + sbet2), + + cbet1 .lt. -sbet1)) / cbet2, + + abs(calp1), cbet2 .ne. cbet1 .or. abs(sbet2) .ne. -sbet1) +* tan(bet2) = tan(sig2) * cos(alp2) +* tan(omg2) = sin(alp0) * tan(sig2). + ssig2 = sbet2 + somg2 = salp0 * sbet2 + csig2 = calp2 * cbet2 + comg2 = csig2 + call Norm(ssig2, csig2) +* Norm(somg2, comg2); -- don't need to normalize! + +* sig12 = sig2 - sig1, limit to [0, pi] + sig12 = atan2(max(csig1 * ssig2 - ssig1 * csig2, 0d0), + + csig1 * csig2 + ssig1 * ssig2) + +* omg12 = omg2 - omg1, limit to [0, pi] + omg12 = atan2(max(comg1 * somg2 - somg1 * comg2, 0d0), + + comg1 * comg2 + somg1 * somg2) + k2 = calp0**2 * ep2 + eps = k2 / (2 * (1 + sqrt(1 + k2)) + k2) + call C3f(eps, C3x, C3a) + B312 = (TrgSum(.true., ssig2, csig2, C3a, nC3-1) - + + TrgSum(.true., ssig1, csig1, C3a, nC3-1)) + h0 = -f * A3f(eps, A3x) + domg12 = salp0 * h0 * (sig12 + B312) + lam12 = omg12 + domg12 + + if (diffp) then + if (calp2 .eq. 0) then + dlam12 = - 2 * f1 * dn1 / sbet1 + else + call Lengs(eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, + + cbet1, cbet2, dummy, dlam12, dummy, + + .false., dummy, dummy, ep2, C1a, C2a) + dlam12 = dlam12 * f1 / (calp2 * cbet2) + end if + end if + Lam12f = lam12 + + return + end + + double precision function A3f(eps, A3x) +* Evaluate sum(A3x[k] * eps^k, k, 0, nA3x-1) by Horner's method + integer ord, nA3, nA3x + parameter (ord = 6, nA3 = ord, nA3x = nA3) + +* input + double precision eps +* output + double precision A3x(0: nA3x-1) + + integer i + A3f = 0 + do 10 i = nA3x-1, 0, -1 + A3f = eps * A3f + A3x(i) + 10 continue + + return + end + + subroutine C3f(eps, C3x, c) +* Evaluate C3 coeffs by Horner's method +* Elements c[1] thru c[nC3-1] are set + integer ord, nC3, nC3x + parameter (ord = 6, nC3 = ord, nC3x = (nC3 * (nC3 - 1)) / 2) + +* input + double precision eps, C3x(0:nC3x-1) +* output + double precision c(nC3-1) + + integer i, j, k + double precision t, mult + + j = nC3x + do 20 k = nC3-1, 1 , -1 + t = 0 + do 10 i = nC3 - k, 1, -1 + j = j - 1 + t = eps * t + C3x(j) + 10 continue + c(k) = t + 20 continue + + mult = 1 + do 30 k = 1, nC3-1 + mult = mult * eps + c(k) = c(k) * mult + 30 continue + + return + end + + subroutine C4f(eps, C4x, c) +* Evaluate C4 coeffs by Horner's method +* Elements c[0] thru c[nC4-1] are set + integer ord, nC4, nC4x + parameter (ord = 6, nC4 = ord, nC4x = (nC4 * (nC4 + 1)) / 2) + +* input + double precision eps, C4x(0:nC4x-1) +*output + double precision c(0:nC4-1) + + integer i, j, k + double precision t, mult + + j = nC4x + do 20 k = nC4-1, 0, -1 + t = 0 + do 10 i = nC4 - k, 1, -1 + j = j - 1 + t = eps * t + C4x(j) + 10 continue + c(k) = t + 20 continue + + mult = 1 + do 30 k = 1, nC4-1 + mult = mult * eps + c(k) = c(k) * mult + 30 continue + + return + end + +* Generated by Maxima on 2010-09-04 10:26:17-04:00 + + double precision function A1m1f(eps) +* The scale factor A1-1 = mean value of (d/dsigma)I1 - 1 +* input + double precision eps + + double precision eps2, t + + eps2 = eps**2 + t = eps2*(eps2*(eps2+4)+64)/256 + A1m1f = (t + eps) / (1 - eps) + + return + end + + subroutine C1f(eps, c) +* The coefficients C1[l] in the Fourier expansion of B1 + integer ord, nC1 + parameter (ord = 6, nC1 = ord) + +* input + double precision eps +* output + double precision c(nC1) + + double precision eps2, d + + eps2 = eps**2 + d = eps + c(1) = d*((6-eps2)*eps2-16)/32 + d = d * eps + c(2) = d*((64-9*eps2)*eps2-128)/2048 + d = d * eps + c(3) = d*(9*eps2-16)/768 + d = d * eps + c(4) = d*(3*eps2-5)/512 + d = d * eps + c(5) = -7*d/1280 + d = d * eps + c(6) = -7*d/2048 + + return + end + + subroutine C1pf(eps, c) +* The coefficients C1p[l] in the Fourier expansion of B1p + integer ord, nC1p + parameter (ord = 6, nC1p = ord) + +* input + double precision eps +* output + double precision c(nC1p) + + double precision eps2, d + + eps2 = eps**2 + d = eps + c(1) = d*(eps2*(205*eps2-432)+768)/1536 + d = d * eps + c(2) = d*(eps2*(4005*eps2-4736)+3840)/12288 + d = d * eps + c(3) = d*(116-225*eps2)/384 + d = d * eps + c(4) = d*(2695-7173*eps2)/7680 + d = d * eps + c(5) = 3467*d/7680 + d = d * eps + c(6) = 38081*d/61440 + + return + end + +* The scale factor A2-1 = mean value of (d/dsigma)I2 - 1 + double precision function A2m1f(eps) +* input + double precision eps + + double precision eps2, t + + eps2 = eps**2 + t = eps2*(eps2*(25*eps2+36)+64)/256 + A2m1f = t * (1 - eps) - eps + + return + end + + subroutine C2f(eps, c) +* The coefficients C2[l] in the Fourier expansion of B2 + integer ord, nC2 + parameter (ord = 6, nC2 = ord) + +* input + double precision eps +* output + double precision c(nC2) + + double precision eps2, d + + eps2 = eps**2 + d = eps + c(1) = d*(eps2*(eps2+2)+16)/32 + d = d * eps + c(2) = d*(eps2*(35*eps2+64)+384)/2048 + d = d * eps + c(3) = d*(15*eps2+80)/768 + d = d * eps + c(4) = d*(7*eps2+35)/512 + d = d * eps + c(5) = 63*d/1280 + d = d * eps + c(6) = 77*d/2048 + + return + end + + subroutine A3cof(n, A3x) +* The scale factor A3 = mean value of (d/dsigma)I3 + integer ord, nA3, nA3x + parameter (ord = 6, nA3 = ord, nA3x = nA3) + +* input + double precision n +* output + double precision A3x(0:nA3x-1) + + A3x(0) = 1 + A3x(1) = (n-1)/2 + A3x(2) = (n*(3*n-1)-2)/8 + A3x(3) = ((-n-3)*n-1)/16 + A3x(4) = (-2*n-3)/64 + A3x(5) = -3/128d0 + + return + end + + subroutine C3cof(n, C3x) +* The coefficients C3[l] in the Fourier expansion of B3 + integer ord, nC3, nC3x + parameter (ord = 6, nC3 = ord, nC3x = (nC3 * (nC3 - 1)) / 2) + +* input + double precision n +* output + double precision C3x(0:nC3x-1) + + C3x(0) = (1-n)/4 + C3x(1) = (1-n*n)/8 + C3x(2) = ((3-n)*n+3)/64 + C3x(3) = (2*n+5)/128 + C3x(4) = 3/128d0 + C3x(5) = ((n-3)*n+2)/32 + C3x(6) = ((-3*n-2)*n+3)/64 + C3x(7) = (n+3)/128 + C3x(8) = 5/256d0 + C3x(9) = (n*(5*n-9)+5)/192 + C3x(10) = (9-10*n)/384 + C3x(11) = 7/512d0 + C3x(12) = (7-14*n)/512 + C3x(13) = 7/512d0 + C3x(14) = 21/2560d0 + + return + end + +* Generated by Maxima on 2012-10-19 08:02:34-04:00 + + subroutine C4cof(n, C4x) +* The coefficients C4[l] in the Fourier expansion of I4 + integer ord, nC4, nC4x + parameter (ord = 6, nC4 = ord, nC4x = (nC4 * (nC4 + 1)) / 2) + +* input + double precision n +* output + double precision C4x(0:nC4x-1) + + C4x(0) = (n*(n*(n*(n*(100*n+208)+572)+3432)-12012)+30030)/45045 + C4x(1) = (n*(n*(n*(64*n+624)-4576)+6864)-3003)/15015 + C4x(2) = (n*((14144-10656*n)*n-4576)-858)/45045 + C4x(3) = ((-224*n-4784)*n+1573)/45045 + C4x(4) = (1088*n+156)/45045 + C4x(5) = 97/15015d0 + C4x(6) = (n*(n*((-64*n-624)*n+4576)-6864)+3003)/135135 + C4x(7) = (n*(n*(5952*n-11648)+9152)-2574)/135135 + C4x(8) = (n*(5792*n+1040)-1287)/135135 + C4x(9) = (468-2944*n)/135135 + C4x(10) = 1/9009d0 + C4x(11) = (n*((4160-1440*n)*n-4576)+1716)/225225 + C4x(12) = ((4992-8448*n)*n-1144)/225225 + C4x(13) = (1856*n-936)/225225 + C4x(14) = 8/10725d0 + C4x(15) = (n*(3584*n-3328)+1144)/315315 + C4x(16) = (1024*n-208)/105105 + C4x(17) = -136/63063d0 + C4x(18) = (832-2560*n)/405405 + C4x(19) = -128/135135d0 + C4x(20) = 128/99099d0 + + return + end + + double precision function sumx(u, v, t) +* input + double precision u, v +* output + double precision t + + double precision up, vpp + sumx = u + v + up = sumx - v + vpp = sumx - up + up = up - u + vpp = vpp - v + t = -(up + vpp) + + return + end + + double precision function AngNm(x) +* input + double precision x + + if (x .ge. 180) then + AngNm = x - 360 + else if (x .lt. -180) then + AngNm = x + 360 + else + AngNm = x + end if + + return + end + + double precision function AngNm2(x) +* input + double precision x + + double precision AngNm + AngNm2 = mod(x, 360d0) + AngNm2 = AngNm(AngNm2) + + return + end + + double precision function AngDif(x, y) +* Compute y - x. x and y must both lie in [-180, 180]. The result is +* equivalent to computing the difference exactly, reducing it to (-180, +* 180] and rounding the result. Note that this prescription allows -180 +* to be returned (e.g., if x is tiny and negative and y = 180). +* input + double precision x, y + + double precision d, t, sumx + d = sumx(-x, y, t) + if ((d - 180d0) + t .gt. 0d0) then + d = d - 360d0 + else if ((d + 180d0) + t .le. 0d0) then + d = d + 360d0 + end if + AngDif = d + t + + return + end + + double precision function AngRnd(x) +* The makes the smallest gap in x = 1/16 - nextafter(1/16, 0) = 1/2^57 +* for reals = 0.7 pm on the earth if x is an angle in degrees. (This +* is about 1000 times more resolution than we get with angles around 90 +* degrees.) We use this to avoid having to deal with near singular +* cases when x is non-zero but tiny (e.g., 1.0e-200). +* input + double precision x + + double precision y, z + z = 1/16d0 + y = abs(x) +* The compiler mustn't "simplify" z - (z - y) to y + if (y .lt. z) y = z - (z - y) + AngRnd = sign(y, x) + + return + end + + subroutine swap(x, y) +* input/output + double precision x, y + + double precision z + z = x + x = y + y = z + + return + end + + double precision function hypotx(x, y) +* input + double precision x, y + + hypotx = sqrt(x**2 + y**2) + + return + end + + subroutine Norm(sinx, cosx) +* input/output + double precision sinx, cosx + + double precision hypotx, r + r = hypotx(sinx, cosx) + sinx = sinx/r + cosx = cosx/r + + return + end + + double precision function log1px(x) +* input + double precision x + + double precision csmgt, y, z + y = 1 + x + z = y - 1 + log1px = csmgt(x, x * log(y) / z, z .eq. 0) + + return + end + + double precision function atanhx(x) +* input + double precision x + + double precision log1px, y + y = abs(x) + y = log1px(2 * y/(1 - y))/2 + atanhx = sign(y, x) + + return + end + + double precision function cbrt(x) +* input + double precision x + + cbrt = sign(abs(x)**(1/3d0), x) + + return + end + + double precision function csmgt(x, y, p) +* input + double precision x, y + logical p + + if (p) then + csmgt = x + else + csmgt = y + end if + + return + end + + double precision function TrgSum(sinp, sinx, cosx, c, n) +* Evaluate +* y = sinp ? sum(c[i] * sin( 2*i * x), i, 1, n) : +* sum(c[i] * cos((2*i-1) * x), i, 1, n) +* using Clenshaw summation. +* Approx operation count = (n + 5) mult and (2 * n + 2) add +* input + logical sinp + integer n + double precision sinx, cosx, c(n) + + double precision ar, y0, y1 + integer n2, k + +* 2 * cos(2 * x) + ar = 2 * (cosx - sinx) * (cosx + sinx) +* accumulators for sum + if (mod(n, 2) .eq. 1) then + y0 = c(n) + n2 = n - 1 + else + y0 = 0 + n2 = n + end if + y1 = 0 +* Now n2 is even + do 10 k = n2, 1, -2 +* Unroll loop x 2, so accumulators return to their original role + y1 = ar * y0 - y1 + c(k) + y0 = ar * y1 - y0 + c(k-1) + 10 continue + if (sinp) then +* sin(2 * x) * y0 + TrgSum = 2 * sinx * cosx * y0 + else +* cos(x) * (y0 - y1) + TrgSum = cosx * (y0 - y1) + end if + + return + end + + integer function trnsit(lon1, lon2) +* input + double precision lon1, lon2 + + double precision lon1x, lon2x, lon12, AngNm, AngDif + lon1x = AngNm(lon1) + lon2x = AngNm(lon2) + lon12 = AngDif(lon1x, lon2x) + trnsit = 0 + if (lon1x .lt. 0 .and. lon2x .ge. 0 .and. lon12 .gt. 0) then + trnsit = 1 + else if (lon2x .lt. 0 .and. lon1x .ge. 0 .and. lon12 .lt. 0) then + trnsit = -1 + end if + + return + end + + subroutine accini(s) +* Initialize an accumulator; this is an array with two elements. +* input/output + double precision s(2) + + s(1) = 0 + s(2) = 0 + + return + end + + subroutine accadd(s, y) +* Add y to an accumulator. +* input + double precision y +* input/output + double precision s(2) + + double precision z, u, sumx + z = sumx(y, s(2), u) + s(1) = sumx(z, s(1), s(2)) + if (s(1) .eq. 0) then + s(1) = u + else + s(2) = s(2) + u + end if + + return + end + +* Table of name abbreviations to conform to the 6-char limit +* A3coeff A3cof +* C3coeff C3cof +* C4coeff C4cof +* AngNormalize AngNm +* AngNormalize2 AngNm2 +* AngDiff AngDif +* AngRound AngRnd +* arcmode arcmod +* Astroid Astrd +* betscale betscl +* lamscale lamscl +* cbet12a cbt12a +* sbet12a sbt12a +* epsilon dbleps +* realmin dblmin +* geodesic geod +* inverse invers +* InverseStart InvSta +* Lambda12 Lam12f +* latsign latsgn +* lonsign lonsgn +* Lengths Lengs +* meridian merid +* outmask omask +* shortline shortp +* SinCosNorm Norm +* SinCosSeries TrgSum +* xthresh xthrsh +* transit trnsit +*> @endcond SKIP diff --git a/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.inc b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.inc new file mode 100644 index 000000000..9b68660c0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.inc @@ -0,0 +1,35 @@ +*> @file geodesic.inc +*! @brief The interface file for the geodesic routines in Fortran +*! +*! Optinally insert \code +*! include 'geodesic.inc' \endcode +*! into the declaration portion of a subroutine that uses this library. +*! +*! See geodesic.for for documentation on these routines. + + interface + + subroutine direct(a, f, lat1, lon1, azi1, s12a12, arcmod, + + lat2, lon2, azi2, omask, a12s12, m12, MM12, MM21, SS12) + double precision, intent(in) :: a, f, lat1, lon1, azi1, s12a12 + logical, intent(in) :: arcmod + integer, intent(in) :: omask + double precision, intent(out) :: lat2, lon2, azi2 + double precision, intent(out) :: a12s12, m12, MM12, MM21, SS12 + end subroutine direct + + subroutine invers(a, f, lat1, lon1, lat2, lon2, + + s12, azi1, azi2, omask, a12, m12, MM12, MM21, SS12) + double precision, intent(in) :: a, f, lat1, lon1, lat2, lon2 + integer, intent(in) :: omask + double precision, intent(out) :: s12, azi1, azi2 + double precision, intent(out) :: a12, m12, MM12, MM21, SS12 + end subroutine invers + + subroutine area(a, f, lats, lons, n, AA, PP) + integer, intent(in) :: n + double precision, intent(in) :: a, f, lats(n), lons(n) + double precision, intent(out) :: AA, PP + end subroutine area + + end interface diff --git a/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodinverse.for b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodinverse.for new file mode 100644 index 000000000..a9883b86e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodinverse.for @@ -0,0 +1,33 @@ +*> @file geodinverse.for +*! @brief A test program for invers() + +*> A simple program to solve the inverse geodesic problem. +*! +*! This program reads in lines with lat1, lon1, lon2, lat2 and prints +*! out lines with azi1, azi2, s12 (for the WGS84 ellipsoid). + + program geodinverse + implicit none + + include 'geodesic.inc' + + double precision a, f, lat1, lon1, azi1, lat2, lon2, azi2, s12, + + dummy + integer omask + +* WGS84 values + a = 6378137d0 + f = 1/298.257223563d0 + + omask = 0 + + 10 continue + read(*, *, end=90, err=90) lat1, lon1, lat2, lon2 + call invers(a, f, lat1, lon1, lat2, lon2, + + s12, azi1, azi2, omask, dummy, dummy, dummy, dummy, dummy) + print 20, azi1, azi2, s12 + 20 format(f20.15, 1x, f20.15, 1x, f19.10) + go to 10 + 90 continue + stop + end diff --git a/gtsam/3rdparty/GeographicLib/legacy/Fortran/planimeter.for b/gtsam/3rdparty/GeographicLib/legacy/Fortran/planimeter.for new file mode 100644 index 000000000..9c22a91b3 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/legacy/Fortran/planimeter.for @@ -0,0 +1,36 @@ +*> @file planimeter.for +*! @brief A test program for area() + +*> A simple program to compute the area of a geodesic polygon. +*! +*! This program reads in up to 100000 lines with lat, lon for each vertex +*! of a polygon. At the end of input, the program prints the number of +*! vertices, the perimeter of the polygon and its area (for the WGS84 +*! ellipsoid). + + program planimeter + implicit none + + include 'geodesic.inc' + + integer maxpts + parameter (maxpts = 100000) + double precision a, f, lats(maxpts), lons(maxpts), S, P + integer n + +* WGS84 values + a = 6378137d0 + f = 1/298.257223563d0 + + n = 0 + 10 continue + if (n .ge. maxpts) go to 20 + read(*, *, end=20, err=20) lats(n+1), lons(n+1) + n = n+1 + go to 10 + 20 continue + call area(a, f, lats, lons, n, S, P) + print 30, n, P, S + 30 format(i6, 1x, f20.8, 1x, f20.3) + stop + end diff --git a/gtsam/3rdparty/GeographicLib/ltmain.sh b/gtsam/3rdparty/GeographicLib/ltmain.sh new file mode 100644 index 000000000..63ae69dc6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/ltmain.sh @@ -0,0 +1,9655 @@ + +# libtool (GNU libtool) 2.4.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --no-warn don't display warning messages +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.4.2 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . +# GNU libtool home page: . +# General help using GNU software: . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.4.2 +TIMESTAMP="" +package_revision=1.3337 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} +: ${Xsed="$SED -e 1s/^X//"} + +# Global variables: +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +exit_status=$EXIT_SUCCESS + +# Make sure IFS has a sensible default +lt_nl=' +' +IFS=" $lt_nl" + +dirname="s,/[^/]*$,," +basename="s,^.*/,," + +# func_dirname file append nondir_replacement +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +func_dirname () +{ + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} # func_dirname may be replaced by extended shell implementation + + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$basename"` +} # func_basename may be replaced by extended shell implementation + + +# func_dirname_and_basename file append nondir_replacement +# perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# Implementation must be kept synchronized with func_dirname +# and func_basename. For efficiency, we do not delegate to +# those functions but instead duplicate the functionality here. +func_dirname_and_basename () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} # func_dirname_and_basename may be replaced by extended shell implementation + + +# func_stripname prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# func_strip_suffix prefix name +func_stripname () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname may be replaced by extended shell implementation + + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS="$save_IFS" + test -x "$progdir/$progname" && break + done + IFS="$save_IFS" + test -n "$progdir" || progdir=`pwd` + progpath="$progdir/$progname" + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed="${SED}"' -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' + +# Sed substitution that converts a w32 file name or path +# which contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-`\' parameter expansions in output of double_quote_subst that were +# `\'-ed in input to the same. If an odd number of `\' preceded a '$' +# in input to double_quote_subst, that '$' was protected from expansion. +# Since each input `\' is now two `\'s, look for any number of runs of +# four `\'s followed by two `\'s and then a '$'. `\' that '$'. +bs='\\' +bs2='\\\\' +bs4='\\\\\\\\' +dollar='\$' +sed_double_backslash="\ + s/$bs4/&\\ +/g + s/^$bs2$dollar/$bs&/ + s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g + s/\n//g" + +# Standard options: +opt_dry_run=false +opt_help=false +opt_quiet=false +opt_verbose=false +opt_warning=: + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" +} + +# func_verbose arg... +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $opt_verbose && func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 + + # bash bug again: + : +} + +# func_fatal_error arg... +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + +# func_fatal_help arg... +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + func_error ${1+"$@"} + func_fatal_error "$help" +} +help="Try \`$progname --help' for more information." ## default + + +# func_grep expression filename +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_mkdir_p directory-path +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + my_directory_path="$1" + my_dir_list= + + if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then + + # Protect directory names starting with `-' + case $my_directory_path in + -*) my_directory_path="./$my_directory_path" ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$my_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + my_dir_list="$my_directory_path:$my_dir_list" + + # If the last portion added has no slash in it, the list is done + case $my_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + +# func_tr_sh +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $opt_debug + + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $opt_debug + + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $opt_debug + + $SED -n '/^# Usage:/,/# Report bugs to/ { + :print + s/^# // + s/^# *$// + s*\$progname*'$progname'* + s*\$host*'"$host"'* + s*\$SHELL*'"$SHELL"'* + s*\$LTCC*'"$LTCC"'* + s*\$LTCFLAGS*'"$LTCFLAGS"'* + s*\$LD*'"$LD"'* + s/\$with_gnu_ld/'"$with_gnu_ld"'/ + s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ + p + d + } + /^# .* home page:/b print + /^# General help using/b print + ' < "$progpath" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $opt_debug + + func_error "missing argument for $1." + exit_cmd=exit +} + + +# func_split_short_opt shortopt +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +func_split_short_opt () +{ + my_sed_short_opt='1s/^\(..\).*$/\1/;q' + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' + + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` +} # func_split_short_opt may be replaced by extended shell implementation + + +# func_split_long_opt longopt +# Set func_split_long_opt_name and func_split_long_opt_arg shell +# variables after splitting LONGOPT at the `=' sign. +func_split_long_opt () +{ + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' + my_sed_long_arg='1s/^--[^=]*=//' + + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` +} # func_split_long_opt may be replaced by extended shell implementation + +exit_cmd=: + + + + + +magic="%%%MAGIC variable%%%" +magic_exe="%%%MAGIC EXE variable%%%" + +# Global variables. +nonopt= +preserve_args= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "${1}=\$${1}\${2}" +} # func_append may be replaced by extended shell implementation + +# func_append_quoted var value +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +func_append_quoted () +{ + func_quote_for_eval "${2}" + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" +} # func_append_quoted may be replaced by extended shell implementation + + +# func_arith arithmetic-term... +func_arith () +{ + func_arith_result=`expr "${@}"` +} # func_arith may be replaced by extended shell implementation + + +# func_len string +# STRING may not start with a hyphen. +func_len () +{ + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` +} # func_len may be replaced by extended shell implementation + + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} # func_lo2o may be replaced by extended shell implementation + + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` +} # func_xform may be replaced by extended shell implementation + + +# func_fatal_configuration arg... +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_error ${1+"$@"} + func_error "See the $PACKAGE documentation for more information." + func_fatal_error "Fatal configuration error." +} + + +# func_config +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + +# func_features +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + +# func_enable_tag tagname +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname="$1" + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf="/$re_begincf/,/$re_endcf/p" + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + +# func_check_version_match +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# Shorthand for --mode=foo, only valid as the first argument +case $1 in +clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; +compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; +execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; +finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; +install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; +link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; +esac + + + +# Option defaults: +opt_debug=: +opt_dry_run=false +opt_config=false +opt_preserve_dup_deps=false +opt_features=false +opt_finish=false +opt_help=false +opt_help_all=false +opt_silent=: +opt_warning=: +opt_verbose=: +opt_silent=false +opt_verbose=false + + +# Parse options once, thoroughly. This comes as soon as possible in the +# script to make things like `--version' happen as quickly as we can. +{ + # this just eases exit handling + while test $# -gt 0; do + opt="$1" + shift + case $opt in + --debug|-x) opt_debug='set -x' + func_echo "enabling shell trace mode" + $opt_debug + ;; + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + --config) + opt_config=: +func_config + ;; + --dlopen|-dlopen) + optarg="$1" + opt_dlopen="${opt_dlopen+$opt_dlopen +}$optarg" + shift + ;; + --preserve-dup-deps) + opt_preserve_dup_deps=: + ;; + --features) + opt_features=: +func_features + ;; + --finish) + opt_finish=: +set dummy --mode finish ${1+"$@"}; shift + ;; + --help) + opt_help=: + ;; + --help-all) + opt_help_all=: +opt_help=': help-all' + ;; + --mode) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_mode="$optarg" +case $optarg in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $opt" + exit_cmd=exit + break + ;; +esac + shift + ;; + --no-silent|--no-quiet) + opt_silent=false +func_append preserve_args " $opt" + ;; + --no-warning|--no-warn) + opt_warning=false +func_append preserve_args " $opt" + ;; + --no-verbose) + opt_verbose=false +func_append preserve_args " $opt" + ;; + --silent|--quiet) + opt_silent=: +func_append preserve_args " $opt" + opt_verbose=false + ;; + --verbose|-v) + opt_verbose=: +func_append preserve_args " $opt" +opt_silent=false + ;; + --tag) + test $# = 0 && func_missing_arg $opt && break + optarg="$1" + opt_tag="$optarg" +func_append preserve_args " $opt $optarg" +func_enable_tag "$optarg" + shift + ;; + + -\?|-h) func_usage ;; + --help) func_help ;; + --version) func_version ;; + + # Separate optargs to long options: + --*=*) + func_split_long_opt "$opt" + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-n*|-v*) + func_split_short_opt "$opt" + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) break ;; + -*) func_fatal_help "unrecognized option \`$opt'" ;; + *) set dummy "$opt" ${1+"$@"}; shift; break ;; + esac + done + + # Validate options: + + # save first non-option argument + if test "$#" -gt 0; then + nonopt="$opt" + shift + fi + + # preserve --debug + test "$opt_debug" = : || func_append preserve_args " --debug" + + case $host in + *cygwin* | *mingw* | *pw32* | *cegcc*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + func_fatal_configuration "not configured to build any kind of library" + fi + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then + func_error "unrecognized option \`-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$progname --help --mode=$opt_mode' for more information." + } + + + # Bail if the options were screwed + $exit_cmd $EXIT_FAILURE +} + + + + +## ----------- ## +## Main. ## +## ----------- ## + +# func_lalib_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool `.la' library or `.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if `file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case "$lalib_p_line" in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test "$lalib_p" = yes +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + func_lalib_p "$1" +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $opt_debug + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$save_ifs + eval cmd=\"$cmd\" + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# `FILE.' does not work on cygwin managed mounts. +func_source () +{ + $opt_debug + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case "$lt_sysroot:$1" in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result="=$func_stripname_result" + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$lt_sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $opt_debug + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result="" + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result" ; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $opt_debug + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $opt_debug + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $opt_debug + if test -z "$2" && test -n "$1" ; then + func_error "Could not determine host file name corresponding to" + func_error " \`$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result="$1" + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $opt_debug + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " \`$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result="$3" + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $opt_debug + case $4 in + $1 ) func_to_host_path_result="$3$func_to_host_path_result" + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via `$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $opt_debug + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $opt_debug + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result="$1" +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result="$func_convert_core_msys_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $opt_debug + func_to_host_file_result="$1" + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result="$func_cygpath_result" + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via `$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $opt_debug + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd="func_convert_path_${func_stripname_result}" + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $opt_debug + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result="$1" +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_msys_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $opt_debug + func_to_host_path_result="$1" + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result="$func_cygpath_result" + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_mode_compile arg... +func_mode_compile () +{ + $opt_debug + # Get the compilation command and the source file. + base_compile= + srcfile="$nonopt" # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg="$arg" + arg_mode=normal + ;; + + target ) + libobj="$arg" + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify \`-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs="$IFS"; IFS=',' + for arg in $args; do + IFS="$save_ifs" + func_append_quoted lastarg "$arg" + done + IFS="$save_ifs" + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg="$srcfile" + srcfile="$arg" + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with \`-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj="$func_basename_result" + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from \`$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_for_eval "$libobj" + test "X$libobj" != "X$func_quote_for_eval_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test "$pic_mode" != no; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test "$suppress_opt" = yes; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + if test "$pic_mode" != yes; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test "$compiler_c_o" = yes; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test "$need_locks" = warn && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$opt_mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "\`$file' was not linked with \`-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir="$func_dirname_result" + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir="$func_dirname_result" + ;; + + *) + func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if test "X$opt_dry_run" = Xfalse; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd="\$cmd$args" + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "\`$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument \`$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $opt_debug + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + func_append install_prog "$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + func_append install_prog " $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + func_append install_shared_prog " $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + func_append install_shared_prog " -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "\`$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest="$destfile" + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to \`$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + func_basename "$file" + destfile="$func_basename_result" + destfile="$destdir/$destfile" + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext="" + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=".exe" + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script \`$wrapper'" + + finalize=yes + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run \`$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test "$opt_mode" = install && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $opt_debug + my_outputname="$1" + my_originator="$2" + my_pic_p="${3-no}" + my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms="${my_outputname}S.c" + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${my_outputname}.nm" + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$outputname.exp" + $opt_dry_run || { + $RM $export_symbols + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from \`$dlprefile'" + func_basename "$dlprefile" + name="$func_basename_result" + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename="" + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname" ; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename="$func_basename_result" + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename" ; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[]; +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{\ + { \"$my_originator\", (void *) 0 }," + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + if test "X$my_pic_p" != Xno; then + pic_flag_for_symtable=" $pic_flag" + fi + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' + + # Transform the symbol file into the correct name. + symfileobj="$output_objdir/${my_outputname}S.$objext" + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $opt_debug + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $opt_debug + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive which possess that section. Heuristic: eliminate + # all those which have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $opt_debug + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $opt_debug + if func_cygming_gnu_implib_p "$1" ; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1" ; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result="" + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $opt_debug + f_ex_an_ar_dir="$1"; shift + f_ex_an_ar_oldlib="$1" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols="$arg" + test -f "$arg" \ + || func_fatal_error "symbol file \`$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir="$arg" + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file \`$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + precious_regex) + precious_files_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg="$arg" + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "\`-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between \`-L' and \`$1'" + else + func_fatal_error "need path for \`-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of \`$dir'" + dir="$absdir" + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test "X$arg" = "X-lc" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test "X$arg" = "X-lc" && continue + ;; + esac + elif test "X$arg" = "X-lc_r"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module="${wl}-multi_module" + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "\`-no-install' is ignored for $host" + func_warning "assuming \`-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $func_quote_for_eval_result" + func_append compiler_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs="$IFS"; IFS=',' + for flag in $args; do + IFS="$save_ifs" + func_quote_for_eval "$flag" + func_append arg " $wl$func_quote_for_eval_result" + func_append compiler_flags " $wl$func_quote_for_eval_result" + func_append linker_flags " $func_quote_for_eval_result" + done + IFS="$save_ifs" + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test "$pic_object" = none && + test "$non_pic_object" = none; then + func_fatal_error "cannot find name of object for \`$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + if test "$pic_object" != none; then + # Prepend the subdirectory the object is found in. + pic_object="$xdir$pic_object" + + if test "$prev" = dlfiles; then + if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg="$pic_object" + fi + + # Non-PIC object. + if test "$non_pic_object" != none; then + # Prepend the subdirectory the object is found in. + non_pic_object="$xdir$non_pic_object" + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test "$pic_object" = none ; then + arg="$non_pic_object" + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object="$pic_object" + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir="$func_dirname_result" + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "\`$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the \`$prevarg' option requires an argument" + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname="$func_basename_result" + libobjs_save="$libobjs" + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps ; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=no + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test "$linkmode,$pass" = "lib,link"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs="$tmp_deplibs" + fi + + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan"; then + libs="$deplibs" + deplibs= + fi + if test "$linkmode" = prog; then + case $pass in + dlopen) libs="$dlfiles" ;; + dlpreopen) libs="$dlprefiles" ;; + link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; + esac + fi + if test "$linkmode,$pass" = "lib,dlpreopen"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs="$dlprefiles" + fi + if test "$pass" = dlopen; then + # Collect dlpreopened libraries + save_deplibs="$deplibs" + deplibs= + fi + + for deplib in $libs; do + lib= + found=no + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test "$linkmode" != lib && test "$linkmode" != prog; then + func_warning "\`-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test "$linkmode" = lib; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib="$searchdir/lib${name}${search_ext}" + if test -f "$lib"; then + if test "$search_ext" = ".la"; then + found=yes + else + found=no + fi + break 2 + fi + done + done + if test "$found" != yes; then + # deplib doesn't seem to be a libtool library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + else # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll="$l" + done + if test "X$ll" = "X$old_library" ; then # only static version available + found=no + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + lib=$ladir/$old_library + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + fi + ;; # -l + *.ltframework) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test "$pass" = conv && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + if test "$pass" = scan; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=no + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" + fi + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "\`$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir="$func_dirname_result" + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test "$prefer_static_libs" = yes || + test "$prefer_static_libs,$installed" = "built,no"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib="$l" + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + + # This library was specified with -dlopen. + if test "$pass" = dlopen; then + if test -z "$libdir"; then + func_fatal_error "cannot -dlopen a convenience library: \`$lib'" + fi + if test -z "$dlname" || + test "$dlopen_support" != yes || + test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of \`$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir="$ladir" + fi + ;; + esac + func_basename "$lib" + laname="$func_basename_result" + + # Find the relevant object directory and library name. + if test "X$installed" = Xyes; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$lt_sysroot$libdir" + absdir="$lt_sysroot$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test "$pass" = dlpreopen; then + if test -z "$libdir" && test "$linkmode" = prog; then + func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" + fi + case "$host" in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if test "$linkalldeplibs" = yes; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule="" + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule="$dlpremoduletest" + break + fi + done + if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then + echo + if test "$linkmode" = prog; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test "$linkmode" = lib && + test "$hardcode_into_libs" = yes; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname="$1" + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname="$dlname" + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc*) + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + func_basename "$soroot" + soname="$func_basename_result" + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from \`$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for \`$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test "$linkmode" = prog || test "$opt_mode" != relink; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test "$hardcode_direct" = no; then + add="$dir/$linklib" + case $host in + *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; + *-*-sysv4*uw2*) add_dir="-L$dir" ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir="-L$dir" ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we can not + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null ; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library" ; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add="$dir/$old_library" + fi + elif test -n "$old_library"; then + add="$dir/$old_library" + fi + fi + esac + elif test "$hardcode_minus_L" = no; then + case $host in + *-*-sunos*) add_shlibpath="$dir" ;; + esac + add_dir="-L$dir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = no; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + relink) + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$dir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$absdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$opt_mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + test "$hardcode_direct_absolute" = no; then + add="$libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + add_dir="-L$libdir" + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system can not link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps ; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path="$deplib" ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of \`$dir'" + absdir="$dir" + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names" ; then + for tmp in $deplibrary_names ; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl" ; then + depdepl="$absdir/$objdir/$depdepl" + darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" + path= + fi + fi + ;; + *) + path="-L$absdir/$objdir" + ;; + esac + else + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "\`$deplib' seems to be moved" + + path="-L$absdir" + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test "$pass" = link; then + if test "$linkmode" = "prog"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + fi + if test "$linkmode" = prog || test "$linkmode" = lib; then + dlprefiles="$newdlprefiles" + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "\`-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "\`-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form `libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test "$module" = no && \ + func_fatal_help "libtool library \`$output' must begin with \`lib'" + + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test "$deplibs_check_method" != pass_all; then + func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test "$dlself" != no && \ + func_warning "\`-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test "$#" -gt 1 && \ + func_warning "ignoring multiple \`-rpath's for a libtool library" + + install_libdir="$1" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + # Some compilers have problems with a `.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "\`-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "\`-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + shift + IFS="$save_ifs" + + test -n "$7" && \ + func_fatal_help "too many parameters to \`-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major="$1" + number_minor="$2" + number_revision="$3" + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # which has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|linux|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + func_append verstring ":${current}.0" + ;; + + qnx) + major=".$current" + versuffix=".$current" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 filesystems. + func_arith $current - $age + major=$func_arith_result + versuffix="-$major" + ;; + + *) + func_fatal_configuration "unknown library version type \`$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring="0.0" + ;; + esac + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + func_warning "undefined symbols not allowed in $host shared libraries" + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + fi + + func_generate_dlsyms "$libname" "$libname" "yes" + func_append libobjs " $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$opt_mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test "$build_libtool_need_lc" = "yes"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Remove ${wl} instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname="$1" + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib="$output_objdir/$realname" + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + if test "x`$SED 1q $export_symbols`" != xEXPORTS; then + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols="$export_symbols" + export_symbols= + always_export_symbols=yes + fi + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs="$IFS"; IFS='~' + for cmd1 in $cmds; do + IFS="$save_ifs" + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test "$try_normal_branch" = yes \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=${output_objdir}/${output_la}.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS="$save_ifs" + if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs="$tmp_deplibs" + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test "$compiler_needs_object" = yes && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test "X$skipped_export" != "X:" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then + output=${output_objdir}/${output_la}.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test "$compiler_needs_object" = yes; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test "X$objlist" = X || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + if ${skipped_export-false}; then + func_verbose "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + fi + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs="$IFS"; IFS='~' + for cmd in $concat_cmds; do + IFS="$save_ifs" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + if ${skipped_export-false}; then + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols="$export_symbols" + test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + fi + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test "$module" = yes && test -n "$module_cmds" ; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + $opt_silent || { + func_quote_for_expand "$cmd" + eval "func_echo $func_quote_for_expand_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS="$save_ifs" + + # Restore the uninstalled library and exit + if test "$opt_mode" = relink; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + func_warning "\`-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "\`-l' and \`-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "\`-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "\`-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "\`-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object \`$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec and hope we can get by with + # turning comma into space.. + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " ${wl}-bind_at_load" + func_append finalize_command " ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.${objext}"; then + func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' + fi + + exit $exit_status + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + func_append oldobjs " $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop="$output_objdir/${outputname}x" + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase="$func_basename_result" + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + func_resolve_sysroot "$deplib" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs="$newdependency_libs" + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name="$func_basename_result" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "\`$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles="$newdlprefiles" + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && + func_mode_link ${1+"$@"} + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $opt_debug + RM="$nonopt" + files= + rmforce= + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=yes ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + odir="$objdir" + else + odir="$dir/$objdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$opt_mode" = uninstall && odir="$dir" + + # Remember odir for removal later, being careful to avoid duplicates + if test "$opt_mode" = clean; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case "$opt_mode" in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && + test "$pic_object" != none; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$opt_mode" = clean ; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + func_append rmfiles " $odir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$opt_mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# in which we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: +# vi:sw=2 + diff --git a/gtsam/3rdparty/GeographicLib/m4/libtool.m4 b/gtsam/3rdparty/GeographicLib/m4/libtool.m4 new file mode 100644 index 000000000..56666f0ec --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/m4/libtool.m4 @@ -0,0 +1,7986 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010, 2011 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_REPLACE_SHELLFNS + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test $_lt_result -eq 0; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test "${lt_cv_aix_libpath+set}" = set; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[ --with-sysroot[=DIR] Search for dependent libraries within DIR + (or the compiler's sysroot if not specified).], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case ${with_sysroot} in #( + yes) + if test "$GCC" = yes; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([${with_sysroot}]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and in which our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD="${LD-ld}_sol2" + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks="$enable_libtool_lock" +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +: ${AR_FLAGS=cru} +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -eq 0; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test "$ac_status" -ne 0; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test "x$lt_cv_ar_at_file" = xno; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8 ; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl*) + # Native MSVC + libname_spec='$name' + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + library_names_spec='${libname}.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec="$LIB" + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC wrapper + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + : ${lt_cv_path_NM=no} +fi]) +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh + # decide which to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd="$ECHO" + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test "x$lt_cv_path_mainfest_tool" != xyes; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ +" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ +" s[1]~/^[@?]/{print s[1], s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +/* DATA imports from DLLs on WIN32 con't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined(__osf__) +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl*) + # Native MSVC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS="$save_LDFLAGS"]) + if test "$lt_cv_irix_exported_symbol" = yes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + fi + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test "$GCC" = yes; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting ${shlibpath_var} if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl*) + # Native MSVC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; + else + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile="$lt_outputfile.exe" + lt_tool_outputfile="$lt_tool_outputfile.exe" + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test "$_lt_caught_CXX_error" != yes + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case ${2} in + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case ${prev}${p} in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test "$pre_test_object_deps_done" = no; then + case ${prev} in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +linux*) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" + CFLAGS="$lt_save_CFLAGS" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)="$LD" +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,b/c, \ + && eval 'test $(( 1 + 1 )) -eq 2 \ + && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) +# ------------------------------------------------------ +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. +m4_defun([_LT_PROG_FUNCTION_REPLACE], +[dnl { +sed -e '/^$1 ()$/,/^} # $1 /c\ +$1 ()\ +{\ +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") +test 0 -eq $? || _lt_function_replace_fail=: +]) + + +# _LT_PROG_REPLACE_SHELLFNS +# ------------------------- +# Replace existing portable implementations of several shell functions with +# equivalent extended shell implementations where those features are available.. +m4_defun([_LT_PROG_REPLACE_SHELLFNS], +[if test x"$xsi_shell" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}"]) + + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary parameter first. + func_stripname_result=${3} + func_stripname_result=${func_stripname_result#"${1}"} + func_stripname_result=${func_stripname_result%"${2}"}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl + func_split_long_opt_name=${1%%=*} + func_split_long_opt_arg=${1#*=}]) + + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) + + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac]) + + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) + + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) + + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) +fi + +if test x"$lt_shell_append" = xyes; then + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) + + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl + func_quote_for_eval "${2}" +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) + + # Save a `func_append' function call where possible by direct use of '+=' + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +else + # Save a `func_append' function call even when '+=' is not available + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ + && mv -f "$cfgfile.tmp" "$cfgfile" \ + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") + test 0 -eq $? || _lt_function_replace_fail=: +fi + +if test x"$_lt_function_replace_fail" = x":"; then + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) +fi +]) + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine which file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/gtsam/3rdparty/GeographicLib/m4/ltoptions.m4 b/gtsam/3rdparty/GeographicLib/m4/ltoptions.m4 new file mode 100644 index 000000000..5d9acd8e2 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/m4/ltoptions.m4 @@ -0,0 +1,384 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for lt_pkg in $withval; do + IFS="$lt_save_ifs" + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/gtsam/3rdparty/GeographicLib/m4/ltsugar.m4 b/gtsam/3rdparty/GeographicLib/m4/ltsugar.m4 new file mode 100644 index 000000000..9000a057d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/m4/ltsugar.m4 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/gtsam/3rdparty/GeographicLib/m4/ltversion.m4 b/gtsam/3rdparty/GeographicLib/m4/ltversion.m4 new file mode 100644 index 000000000..07a8602d4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/m4/ltversion.m4 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 3337 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.2]) +m4_define([LT_PACKAGE_REVISION], [1.3337]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.2' +macro_revision='1.3337' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/gtsam/3rdparty/GeographicLib/m4/lt~obsolete.m4 b/gtsam/3rdparty/GeographicLib/m4/lt~obsolete.m4 new file mode 100644 index 000000000..c573da90c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/m4/lt~obsolete.m4 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/gtsam/3rdparty/GeographicLib/man/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/man/CMakeLists.txt new file mode 100644 index 000000000..d8af12998 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/CMakeLists.txt @@ -0,0 +1,94 @@ +# The man pages are maintained as .pod (plain old documentatoin) files. +# In maintainer mode, there are used to create real man pages (extension +# .1), usage files (extension .usage) for including in the tool itself, +# and html versions of the man pages (extension .1.html) for use from +# the doxygen generated documentation + +# Only the maintainer tries to generate the derived files and the .usage +# files are in the build tree. For non-maintainers, the .usages files +# are in the source tree. +if (MAINTAINER) + add_custom_target (distrib-man) + add_custom_target (man ALL) +endif () + +set (MANPAGES) +set (USAGE) +set (HTMLMAN) + +# Loop over the tools building up lists of the derived files. Also in +# maintainer mode, specify how the derived files are created. The sed +# replacements for the .1.html files glue in a style sheet and implement +# cross-referencing between the tools. The .usage files are generated +# by a shell script makeusage.sh. +foreach (TOOL ${TOOLS}) + set (MANPAGES ${MANPAGES} ${CMAKE_CURRENT_BINARY_DIR}/${TOOL}.1) + set (USAGE ${USAGE} ${CMAKE_CURRENT_BINARY_DIR}/${TOOL}.usage) + set (HTMLMAN ${HTMLMAN} ${CMAKE_CURRENT_BINARY_DIR}/${TOOL}.1.html) + if (MAINTAINER) + add_custom_command (OUTPUT ${TOOL}.1 + COMMAND pod2man --center=\"GeographicLib Utilities\" + --release=\"GeographicLib ${PROJECT_VERSION}\" + ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.pod > ${TOOL}.1 + COMMENT "Building man page for ${TOOL}" + MAIN_DEPENDENCY ${TOOL}.pod) + add_custom_command (OUTPUT ${TOOL}.1.html + COMMAND + pod2html --noindex ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.pod | + sed -e 's%%%' + -e 's%\\\([^<>]*\\\)\(\\\(.\\\)\)%&%'g > ${TOOL}.1.html && + cp ${TOOL}.1.html ../doc/html-stage/ + COMMENT "Building html version of man page for ${TOOL}" + MAIN_DEPENDENCY ${TOOL}.pod) + add_custom_command (OUTPUT ${TOOL}.usage + COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/makeusage.sh + ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.pod ${PROJECT_VERSION} + > ${TOOL}.usage + COMMENT "Building usage code for ${TOOL}" + MAIN_DEPENDENCY ${TOOL}.pod) + else () + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.usage) + file (COPY ${TOOL}.usage DESTINATION .) + else () + configure_file (dummy.usage.in ${TOOL}.usage @ONLY) + endif () + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.1) + file (COPY ${TOOL}.1 DESTINATION .) + else () + configure_file (dummy.1.in ${TOOL}.1 @ONLY) + endif () + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.1.html) + file (COPY ${TOOL}.1.html DESTINATION .) + else () + configure_file (dummy.1.html.in ${TOOL}.1.html @ONLY) + endif () + if (DOXYGEN_FOUND) + file (COPY ${CMAKE_CURRENT_BINARY_DIR}/${TOOL}.1.html + DESTINATION ../doc/html-stage) + endif () + endif () +endforeach () + +# Add the extra maintainer tasks into the dependency list. The +# distrib-man target copies the derived documentation files into the +# source tree. +if (MAINTAINER) + add_custom_target (manpages ALL DEPENDS ${MANPAGES} + COMMENT "Building all the man pages") + add_custom_target (usage ALL DEPENDS ${USAGE} + COMMENT "Converting the man pages to online usage") + add_custom_target (htmlman ALL DEPENDS ${HTMLMAN} + COMMENT "Building html versions of the man pages") + add_dependencies (man manpages usage htmlman) + add_dependencies (distrib-man man) + add_custom_command (TARGET distrib-man + COMMAND + for f in ${MANPAGES} ${USAGE} ${HTMLMAN}\; do + cmp "$$f" ${CMAKE_CURRENT_SOURCE_DIR}/`basename "$$f" ` + >/dev/null 2>&1 || + install -m 644 "$$f" ${CMAKE_CURRENT_SOURCE_DIR}\; done + COMMENT "Installing man documentation page in source tree") +endif () + +# Install the man pages. +install (FILES ${MANPAGES} DESTINATION share/man/man1) diff --git a/gtsam/3rdparty/GeographicLib/man/CartConvert.1 b/gtsam/3rdparty/GeographicLib/man/CartConvert.1 new file mode 100644 index 000000000..02dfbfa5a --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/CartConvert.1 @@ -0,0 +1,235 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "CARTCONVERT 1" +.TH CARTCONVERT 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +CartConvert \-\- convert geodetic coordinates to geocentric or local cartesian +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBCartConvert\fR [ \fB\-r\fR ] [ \fB\-l\fR \fIlat0\fR \fIlon0\fR \fIh0\fR ] [ \fB\-e\fR \fIa\fR \fIf\fR ] +[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] +[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] +[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] +[ \fB\-\-line\-separator\fR \fIlinesep\fR ] +[ \fB\-\-output\-file\fR \fIoutfile\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Convert geodetic coordinates to either geocentric or local cartesian +coordinates. Geocentric coordinates have the origin at the center of +the earth, with the \fIz\fR axis going thru the north pole, and the \fIx\fR +axis thru \fIlatitude\fR = 0, \fIlongitude\fR = 0. By default, the +conversion is to geocentric coordinates. Specifying \fB\-l\fR \fIlat0\fR +\&\fIlon0\fR \fIh0\fR causes a local coordinate system to be used with the +origin at \fIlatitude\fR = \fIlat0\fR, \fIlongitude\fR = \fIlon0\fR, \fIheight\fR = +\&\fIh0\fR, \fIz\fR normal to the ellipsoid and \fIy\fR due north. +.PP +Geodetic coordinates are provided on standard input as a set of lines +containing (blank separated) \fIlatitude\fR, \fIlongitude\fR (decimal degrees +or degrees, minutes and seconds), and \fIheight\fR above the ellipsoid +(meters). For each set of geodetic coordinates, the corresponding +cartesian coordinates \fIx\fR, \fIy\fR, \fIz\fR (meters) are printed on standard +output. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-r\fR" 4 +.IX Item "-r" +perform the reverse projection. \fIx\fR, \fIy\fR, \fIz\fR are given on standard +input and each line of standard output gives \fIlatitude\fR, \fIlongitude\fR, +\&\fIheight\fR. +.IP "\fB\-e\fR" 4 +.IX Item "-e" +specify the ellipsoid via \fIa\fR \fIf\fR; the equatorial radius is \fIa\fR and +the flattening is \fIf\fR. Setting \fIf\fR = 0 results in a sphere. Specify +\&\fIf\fR < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, +is allowed for \fIf\fR. (Also, if \fIf\fR > 1, the flattening is set to +1/\fIf\fR.) By default, the \s-1WGS84\s0 ellipsoid is used, \fIa\fR = 6378137 m, +\&\fIf\fR = 1/298.257223563. +.IP "\fB\-\-comment\-delimiter\fR" 4 +.IX Item "--comment-delimiter" +set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +print version and exit. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +print usage and exit. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +print full documentation and exit. +.IP "\fB\-\-input\-file\fR" 4 +.IX Item "--input-file" +read input from the file \fIinfile\fR instead of from standard input; a file +name of \*(L"\-\*(R" stands for standard input. +.IP "\fB\-\-input\-string\fR" 4 +.IX Item "--input-string" +read input from the string \fIinstring\fR instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in \fIinstring\fR are converted to newlines before the reading begins. +.IP "\fB\-\-line\-separator\fR" 4 +.IX Item "--line-separator" +set the line separator character to \fIlinesep\fR. By default this is a +semicolon. +.IP "\fB\-\-output\-file\fR" 4 +.IX Item "--output-file" +write output to the file \fIoutfile\fR instead of to standard output; a +file name of \*(L"\-\*(R" stands for standard output. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +.Vb 6 +\& echo 33.3 44.4 6000 | CartConvert +\& => 3816209.60 3737108.55 3485109.57 +\& echo 33.3 44.4 6000 | CartConvert \-l 33 44 20 +\& => 37288.97 33374.29 5783.64 +\& echo 30000 30000 0 | CartConvert \-r +\& => 6.483 45 \-6335709.73 +.Ve +.SH "ERRORS" +.IX Header "ERRORS" +An illegal line of input will print an error message to standard output +beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBCartConvert\fR to return an exit +code of 1. However, an error does not cause \fBCartConvert\fR to +terminate; following lines will be converted. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +The algorithm for converting geocentric to geodetic coordinates is given +in Appendix B of C. F. F. Karney, \fIGeodesics on an ellipsoid of +revolution\fR, Feb. 2011; preprint . +.SH "AUTHOR" +.IX Header "AUTHOR" +\&\fBCartConvert\fR was written by Charles Karney. +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBCartConvert\fR was added to GeographicLib, +, in 2009\-02. Prior to 2009\-03 it was +called ECEFConvert. diff --git a/gtsam/3rdparty/GeographicLib/man/CartConvert.1.html b/gtsam/3rdparty/GeographicLib/man/CartConvert.1.html new file mode 100644 index 000000000..38dcd6af1 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/CartConvert.1.html @@ -0,0 +1,124 @@ + + + + + + + + + + + + + +

NAME

+ +

CartConvert -- convert geodetic coordinates to geocentric or local cartesian

+ +

SYNOPSIS

+ +

CartConvert [ -r ] [ -l lat0 lon0 h0 ] [ -e a f ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]

+ +

DESCRIPTION

+ +

Convert geodetic coordinates to either geocentric or local cartesian coordinates. Geocentric coordinates have the origin at the center of the earth, with the z axis going thru the north pole, and the x axis thru latitude = 0, longitude = 0. By default, the conversion is to geocentric coordinates. Specifying -l lat0 lon0 h0 causes a local coordinate system to be used with the origin at latitude = lat0, longitude = lon0, height = h0, z normal to the ellipsoid and y due north.

+ +

Geodetic coordinates are provided on standard input as a set of lines containing (blank separated) latitude, longitude (decimal degrees or degrees, minutes and seconds), and height above the ellipsoid (meters). For each set of geodetic coordinates, the corresponding cartesian coordinates x, y, z (meters) are printed on standard output.

+ +

OPTIONS

+ +
+ +
-r
+
+ +

perform the reverse projection. x, y, z are given on standard input and each line of standard output gives latitude, longitude, height.

+ +
+
-e
+
+ +

specify the ellipsoid via a f; the equatorial radius is a and the flattening is f. Setting f = 0 results in a sphere. Specify f < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By default, the WGS84 ellipsoid is used, a = 6378137 m, f = 1/298.257223563.

+ +
+
--comment-delimiter
+
+ +

set the comment delimiter to commentdelim (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).

+ +
+
--version
+
+ +

print version and exit.

+ +
+
-h
+
+ +

print usage and exit.

+ +
+
--help
+
+ +

print full documentation and exit.

+ +
+
--input-file
+
+ +

read input from the file infile instead of from standard input; a file name of "-" stands for standard input.

+ +
+
--input-string
+
+ +

read input from the string instring instead of from standard input. All occurrences of the line separator character (default is a semicolon) in instring are converted to newlines before the reading begins.

+ +
+
--line-separator
+
+ +

set the line separator character to linesep. By default this is a semicolon.

+ +
+
--output-file
+
+ +

write output to the file outfile instead of to standard output; a file name of "-" stands for standard output.

+ +
+
+ +

EXAMPLES

+ +
   echo 33.3 44.4 6000 | CartConvert
+   => 3816209.60 3737108.55 3485109.57
+   echo 33.3 44.4 6000 | CartConvert -l 33 44 20
+   => 37288.97 33374.29 5783.64
+   echo 30000 30000 0 | CartConvert -r
+   => 6.483 45 -6335709.73
+ +

ERRORS

+ +

An illegal line of input will print an error message to standard output beginning with ERROR: and causes CartConvert to return an exit code of 1. However, an error does not cause CartConvert to terminate; following lines will be converted.

+ +

SEE ALSO

+ +

The algorithm for converting geocentric to geodetic coordinates is given in Appendix B of C. F. F. Karney, Geodesics on an ellipsoid of revolution, Feb. 2011; preprint http://arxiv.org/abs/1102.1215.

+ +

AUTHOR

+ +

CartConvert was written by Charles Karney.

+ +

HISTORY

+ +

CartConvert was added to GeographicLib, http://geographiclib.sf.net, in 2009-02. Prior to 2009-03 it was called ECEFConvert.

+ + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/man/CartConvert.pod b/gtsam/3rdparty/GeographicLib/man/CartConvert.pod new file mode 100644 index 000000000..d68f42a27 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/CartConvert.pod @@ -0,0 +1,124 @@ +=head1 NAME + +CartConvert -- convert geodetic coordinates to geocentric or local cartesian + +=head1 SYNOPSIS + +B [ B<-r> ] [ B<-l> I I I ] [ B<-e> I I ] +[ B<--comment-delimiter> I ] +[ B<--version> | B<-h> | B<--help> ] +[ B<--input-file> I | B<--input-string> I ] +[ B<--line-separator> I ] +[ B<--output-file> I ] + +=head1 DESCRIPTION + +Convert geodetic coordinates to either geocentric or local cartesian +coordinates. Geocentric coordinates have the origin at the center of +the earth, with the I axis going thru the north pole, and the I +axis thru I = 0, I = 0. By default, the +conversion is to geocentric coordinates. Specifying B<-l> I +I I causes a local coordinate system to be used with the +origin at I = I, I = I, I = +I, I normal to the ellipsoid and I due north. + +Geodetic coordinates are provided on standard input as a set of lines +containing (blank separated) I, I (decimal degrees +or degrees, minutes and seconds), and I above the ellipsoid +(meters). For each set of geodetic coordinates, the corresponding +cartesian coordinates I, I, I (meters) are printed on standard +output. + +=head1 OPTIONS + +=over + +=item B<-r> + +perform the reverse projection. I, I, I are given on standard +input and each line of standard output gives I, I, +I. + +=item B<-e> + +specify the ellipsoid via I I; the equatorial radius is I and +the flattening is I. Setting I = 0 results in a sphere. Specify +I E 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, +is allowed for I. (Also, if I E 1, the flattening is set to +1/I.) By default, the WGS84 ellipsoid is used, I = 6378137 m, +I = 1/298.257223563. + +=item B<--comment-delimiter> + +set the comment delimiter to I (e.g., "#" or "//"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). + +=item B<--version> + +print version and exit. + +=item B<-h> + +print usage and exit. + +=item B<--help> + +print full documentation and exit. + +=item B<--input-file> + +read input from the file I instead of from standard input; a file +name of "-" stands for standard input. + +=item B<--input-string> + +read input from the string I instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in I are converted to newlines before the reading begins. + +=item B<--line-separator> + +set the line separator character to I. By default this is a +semicolon. + +=item B<--output-file> + +write output to the file I instead of to standard output; a +file name of "-" stands for standard output. + +=back + +=head1 EXAMPLES + + echo 33.3 44.4 6000 | CartConvert + => 3816209.60 3737108.55 3485109.57 + echo 33.3 44.4 6000 | CartConvert -l 33 44 20 + => 37288.97 33374.29 5783.64 + echo 30000 30000 0 | CartConvert -r + => 6.483 45 -6335709.73 + +=head1 ERRORS + +An illegal line of input will print an error message to standard output +beginning with C and causes B to return an exit +code of 1. However, an error does not cause B to +terminate; following lines will be converted. + +=head1 SEE ALSO + +The algorithm for converting geocentric to geodetic coordinates is given +in Appendix B of C. F. F. Karney, I, Feb. 2011; preprint L. + +=head1 AUTHOR + +B was written by Charles Karney. + +=head1 HISTORY + +B was added to GeographicLib, +L, in 2009-02. Prior to 2009-03 it was +called ECEFConvert. diff --git a/gtsam/3rdparty/GeographicLib/man/CartConvert.usage b/gtsam/3rdparty/GeographicLib/man/CartConvert.usage new file mode 100644 index 000000000..f9f6f05ac --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/CartConvert.usage @@ -0,0 +1,113 @@ +int usage(int retval, bool brief) { + if (brief) + ( retval ? std::cerr : std::cout ) << "Usage:\n" +" CartConvert [ -r ] [ -l lat0 lon0 h0 ] [ -e a f ] [ --comment-delimiter\n" +" commentdelim ] [ --version | -h | --help ] [ --input-file infile |\n" +" --input-string instring ] [ --line-separator linesep ] [ --output-file\n" +" outfile ]\n" +"\n" +"For full documentation type:\n" +" CartConvert --help\n" +"or visit:\n" +" http://geographiclib.sf.net/1.34/CartConvert.1.html\n"; + else + ( retval ? std::cerr : std::cout ) << "Man page:\n" +"NAME\n" +" CartConvert -- convert geodetic coordinates to geocentric or local\n" +" cartesian\n" +"\n" +"SYNOPSIS\n" +" CartConvert [ -r ] [ -l lat0 lon0 h0 ] [ -e a f ] [ --comment-delimiter\n" +" commentdelim ] [ --version | -h | --help ] [ --input-file infile |\n" +" --input-string instring ] [ --line-separator linesep ] [ --output-file\n" +" outfile ]\n" +"\n" +"DESCRIPTION\n" +" Convert geodetic coordinates to either geocentric or local cartesian\n" +" coordinates. Geocentric coordinates have the origin at the center of\n" +" the earth, with the z axis going thru the north pole, and the x axis\n" +" thru latitude = 0, longitude = 0. By default, the conversion is to\n" +" geocentric coordinates. Specifying -l lat0 lon0 h0 causes a local\n" +" coordinate system to be used with the origin at latitude = lat0,\n" +" longitude = lon0, height = h0, z normal to the ellipsoid and y due\n" +" north.\n" +"\n" +" Geodetic coordinates are provided on standard input as a set of lines\n" +" containing (blank separated) latitude, longitude (decimal degrees or\n" +" degrees, minutes and seconds), and height above the ellipsoid (meters).\n" +" For each set of geodetic coordinates, the corresponding cartesian\n" +" coordinates x, y, z (meters) are printed on standard output.\n" +"\n" +"OPTIONS\n" +" -r perform the reverse projection. x, y, z are given on standard\n" +" input and each line of standard output gives latitude, longitude,\n" +" height.\n" +"\n" +" -e specify the ellipsoid via a f; the equatorial radius is a and the\n" +" flattening is f. Setting f = 0 results in a sphere. Specify f < 0\n" +" for a prolate ellipsoid. A simple fraction, e.g., 1/297, is\n" +" allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By\n" +" default, the WGS84 ellipsoid is used, a = 6378137 m, f =\n" +" 1/298.257223563.\n" +"\n" +" --comment-delimiter\n" +" set the comment delimiter to commentdelim (e.g., \"#\" or \"//\"). If\n" +" set, the input lines will be scanned for this delimiter and, if\n" +" found, the delimiter and the rest of the line will be removed prior\n" +" to processing and subsequently appended to the output line\n" +" (separated by a space).\n" +"\n" +" --version\n" +" print version and exit.\n" +"\n" +" -h print usage and exit.\n" +"\n" +" --help\n" +" print full documentation and exit.\n" +"\n" +" --input-file\n" +" read input from the file infile instead of from standard input; a\n" +" file name of \"-\" stands for standard input.\n" +"\n" +" --input-string\n" +" read input from the string instring instead of from standard input.\n" +" All occurrences of the line separator character (default is a\n" +" semicolon) in instring are converted to newlines before the reading\n" +" begins.\n" +"\n" +" --line-separator\n" +" set the line separator character to linesep. By default this is a\n" +" semicolon.\n" +"\n" +" --output-file\n" +" write output to the file outfile instead of to standard output; a\n" +" file name of \"-\" stands for standard output.\n" +"\n" +"EXAMPLES\n" +" echo 33.3 44.4 6000 | CartConvert\n" +" => 3816209.60 3737108.55 3485109.57\n" +" echo 33.3 44.4 6000 | CartConvert -l 33 44 20\n" +" => 37288.97 33374.29 5783.64\n" +" echo 30000 30000 0 | CartConvert -r\n" +" => 6.483 45 -6335709.73\n" +"\n" +"ERRORS\n" +" An illegal line of input will print an error message to standard output\n" +" beginning with \"ERROR:\" and causes CartConvert to return an exit code\n" +" of 1. However, an error does not cause CartConvert to terminate;\n" +" following lines will be converted.\n" +"\n" +"SEE ALSO\n" +" The algorithm for converting geocentric to geodetic coordinates is\n" +" given in Appendix B of C. F. F. Karney, Geodesics on an ellipsoid of\n" +" revolution, Feb. 2011; preprint .\n" +"\n" +"AUTHOR\n" +" CartConvert was written by Charles Karney.\n" +"\n" +"HISTORY\n" +" CartConvert was added to GeographicLib, ,\n" +" in 2009-02. Prior to 2009-03 it was called ECEFConvert.\n" +; + return retval; +} diff --git a/gtsam/3rdparty/GeographicLib/man/ConicProj.1 b/gtsam/3rdparty/GeographicLib/man/ConicProj.1 new file mode 100644 index 000000000..85f65f9a6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/ConicProj.1 @@ -0,0 +1,257 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "CONICPROJ 1" +.TH CONICPROJ 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +ConicProj \-\- perform conic projections +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBConicProj\fR ( \fB\-c\fR | \fB\-a\fR ) \fIlat1\fR \fIlat2\fR +[ \fB\-l\fR \fIlon0\fR ] [ \fB\-k\fR \fIk1\fR ] [ \fB\-r\fR ] +[ \fB\-e\fR \fIa\fR \fIf\fR ] +[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] +[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] +[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] +[ \fB\-\-line\-separator\fR \fIlinesep\fR ] +[ \fB\-\-output\-file\fR \fIoutfile\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Perform one of two conic projections geodesics. Convert geodetic +coordinates to either Lambert conformal conic or Albers equal area +coordinates. The standard latitudes \fIlat1\fR and \fIlat2\fR are specified +by that the \fB\-c\fR option (for Lambert conformal conic) or the \fB\-a\fR +option (for Albers equal area). At least one of these options must be +given (the last one given is used). Specify \fIlat1\fR = \fIlat2\fR, to +obtain the case with a single standard parallel. The central meridian +is given by \fIlon0\fR. The longitude of origin is given by the latitude +of minimum (azimuthal) scale for Lambert conformal conic (Albers equal +area). The (azimuthal) scale on the standard parallels is \fIk1\fR. +.PP +Geodetic coordinates are provided on standard input as a set of lines +containing (blank separated) \fIlatitude\fR and \fIlongitude\fR (decimal +degrees or degrees, minutes, seconds). For each set of geodetic +coordinates, the corresponding projected easting, \fIx\fR, and northing, +\&\fIy\fR, (meters) are printed on standard output together with the meridian +convergence \fIgamma\fR (degrees) and (azimuthal) scale \fIk\fR. For Albers +equal area, the radial scale is 1/\fIk\fR. The meridian convergence is the +bearing of the \fIy\fR axis measured clockwise from true north. +.PP +Special cases of the Lambert conformal projection are the Mercator +projection (the standard latitudes equal and opposite) and the polar +stereographic projection (both standard latitudes correspond to the same +pole). Special cases of the Albers equal area projection are the +cylindrical equal area projection (the standard latitudes equal and +opposite), the Lambert azimuthal equal area projection (both standard +latitude corresponds to the same pole), and the Lambert equal area conic +projection (one standard parallel is at a pole). +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-c\fR" 4 +.IX Item "-c" +use the Lambert conformal conic projection with standard parallels +\&\fIlat1\fR and \fIlat2\fR. +.IP "\fB\-a\fR" 4 +.IX Item "-a" +use the Albers equal area projection with standard parallels \fIlat1\fR and +\&\fIlat2\fR. +.IP "\fB\-l\fR" 4 +.IX Item "-l" +specify the longitude of origin \fIlon0\fR (degrees, default 0). +.IP "\fB\-k\fR" 4 +.IX Item "-k" +specify the (azimuthal) scale \fIk1\fR on the standard parallels (default +1). +.IP "\fB\-r\fR" 4 +.IX Item "-r" +perform the reverse projection. \fIx\fR and \fIy\fR are given on standard +input and each line of standard output gives \fIlatitude\fR, \fIlongitude\fR, +\&\fIgamma\fR, and \fIk\fR. +.IP "\fB\-e\fR" 4 +.IX Item "-e" +specify the ellipsoid via \fIa\fR \fIf\fR; the equatorial radius is \fIa\fR and +the flattening is \fIf\fR. Setting \fIf\fR = 0 results in a sphere. Specify +\&\fIf\fR < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, +is allowed for \fIf\fR. (Also, if \fIf\fR > 1, the flattening is set to +1/\fIf\fR.) By default, the \s-1WGS84\s0 ellipsoid is used, \fIa\fR = 6378137 m, +\&\fIf\fR = 1/298.257223563. +.IP "\fB\-\-comment\-delimiter\fR" 4 +.IX Item "--comment-delimiter" +set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +print version and exit. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +print usage and exit. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +print full documentation and exit. +.IP "\fB\-\-input\-file\fR" 4 +.IX Item "--input-file" +read input from the file \fIinfile\fR instead of from standard input; a file +name of \*(L"\-\*(R" stands for standard input. +.IP "\fB\-\-input\-string\fR" 4 +.IX Item "--input-string" +read input from the string \fIinstring\fR instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in \fIinstring\fR are converted to newlines before the reading begins. +.IP "\fB\-\-line\-separator\fR" 4 +.IX Item "--line-separator" +set the line separator character to \fIlinesep\fR. By default this is a +semicolon. +.IP "\fB\-\-output\-file\fR" 4 +.IX Item "--output-file" +write output to the file \fIoutfile\fR instead of to standard output; a +file name of \*(L"\-\*(R" stands for standard output. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +.Vb 4 +\& echo 39.95N 75.17W | ConicProj \-c 40d58 39d56 \-l 77d45W +\& => 220445 \-52372 1.67 1.0 +\& echo 220445 \-52372 | ConicProj \-c 40d58 39d56 \-l 77d45W \-r +\& => 39.95 \-75.17 1.67 1.0 +.Ve +.SH "ERRORS" +.IX Header "ERRORS" +An illegal line of input will print an error message to standard output +beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBConicProj\fR to return an exit +code of 1. However, an error does not cause \fBConicProj\fR to +terminate; following lines will be converted. +.SH "AUTHOR" +.IX Header "AUTHOR" +\&\fBConicProj\fR was written by Charles Karney. +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBConicProj\fR was added to GeographicLib, , +in version 1.9. diff --git a/gtsam/3rdparty/GeographicLib/man/ConicProj.1.html b/gtsam/3rdparty/GeographicLib/man/ConicProj.1.html new file mode 100644 index 000000000..e4af0e6b5 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/ConicProj.1.html @@ -0,0 +1,144 @@ + + + + + + + + + + + + + +

NAME

+ +

ConicProj -- perform conic projections

+ +

SYNOPSIS

+ +

ConicProj ( -c | -a ) lat1 lat2 [ -l lon0 ] [ -k k1 ] [ -r ] [ -e a f ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]

+ +

DESCRIPTION

+ +

Perform one of two conic projections geodesics. Convert geodetic coordinates to either Lambert conformal conic or Albers equal area coordinates. The standard latitudes lat1 and lat2 are specified by that the -c option (for Lambert conformal conic) or the -a option (for Albers equal area). At least one of these options must be given (the last one given is used). Specify lat1 = lat2, to obtain the case with a single standard parallel. The central meridian is given by lon0. The longitude of origin is given by the latitude of minimum (azimuthal) scale for Lambert conformal conic (Albers equal area). The (azimuthal) scale on the standard parallels is k1.

+ +

Geodetic coordinates are provided on standard input as a set of lines containing (blank separated) latitude and longitude (decimal degrees or degrees, minutes, seconds). For each set of geodetic coordinates, the corresponding projected easting, x, and northing, y, (meters) are printed on standard output together with the meridian convergence gamma (degrees) and (azimuthal) scale k. For Albers equal area, the radial scale is 1/k. The meridian convergence is the bearing of the y axis measured clockwise from true north.

+ +

Special cases of the Lambert conformal projection are the Mercator projection (the standard latitudes equal and opposite) and the polar stereographic projection (both standard latitudes correspond to the same pole). Special cases of the Albers equal area projection are the cylindrical equal area projection (the standard latitudes equal and opposite), the Lambert azimuthal equal area projection (both standard latitude corresponds to the same pole), and the Lambert equal area conic projection (one standard parallel is at a pole).

+ +

OPTIONS

+ +
+ +
-c
+
+ +

use the Lambert conformal conic projection with standard parallels lat1 and lat2.

+ +
+
-a
+
+ +

use the Albers equal area projection with standard parallels lat1 and lat2.

+ +
+
-l
+
+ +

specify the longitude of origin lon0 (degrees, default 0).

+ +
+
-k
+
+ +

specify the (azimuthal) scale k1 on the standard parallels (default 1).

+ +
+
-r
+
+ +

perform the reverse projection. x and y are given on standard input and each line of standard output gives latitude, longitude, gamma, and k.

+ +
+
-e
+
+ +

specify the ellipsoid via a f; the equatorial radius is a and the flattening is f. Setting f = 0 results in a sphere. Specify f < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By default, the WGS84 ellipsoid is used, a = 6378137 m, f = 1/298.257223563.

+ +
+
--comment-delimiter
+
+ +

set the comment delimiter to commentdelim (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).

+ +
+
--version
+
+ +

print version and exit.

+ +
+
-h
+
+ +

print usage and exit.

+ +
+
--help
+
+ +

print full documentation and exit.

+ +
+
--input-file
+
+ +

read input from the file infile instead of from standard input; a file name of "-" stands for standard input.

+ +
+
--input-string
+
+ +

read input from the string instring instead of from standard input. All occurrences of the line separator character (default is a semicolon) in instring are converted to newlines before the reading begins.

+ +
+
--line-separator
+
+ +

set the line separator character to linesep. By default this is a semicolon.

+ +
+
--output-file
+
+ +

write output to the file outfile instead of to standard output; a file name of "-" stands for standard output.

+ +
+
+ +

EXAMPLES

+ +
   echo 39.95N 75.17W | ConicProj -c 40d58 39d56 -l 77d45W
+   => 220445 -52372 1.67 1.0
+   echo 220445 -52372 | ConicProj -c 40d58 39d56 -l 77d45W -r
+   => 39.95 -75.17 1.67 1.0
+ +

ERRORS

+ +

An illegal line of input will print an error message to standard output beginning with ERROR: and causes ConicProj to return an exit code of 1. However, an error does not cause ConicProj to terminate; following lines will be converted.

+ +

AUTHOR

+ +

ConicProj was written by Charles Karney.

+ +

HISTORY

+ +

ConicProj was added to GeographicLib, http://geographiclib.sf.net, in version 1.9.

+ + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/man/ConicProj.pod b/gtsam/3rdparty/GeographicLib/man/ConicProj.pod new file mode 100644 index 000000000..59e256156 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/ConicProj.pod @@ -0,0 +1,149 @@ +=head1 NAME + +ConicProj -- perform conic projections + +=head1 SYNOPSIS + +B ( B<-c> | B<-a> ) I I +[ B<-l> I ] [ B<-k> I ] [ B<-r> ] +[ B<-e> I I ] +[ B<--comment-delimiter> I ] +[ B<--version> | B<-h> | B<--help> ] +[ B<--input-file> I | B<--input-string> I ] +[ B<--line-separator> I ] +[ B<--output-file> I ] + +=head1 DESCRIPTION + +Perform one of two conic projections geodesics. Convert geodetic +coordinates to either Lambert conformal conic or Albers equal area +coordinates. The standard latitudes I and I are specified +by that the B<-c> option (for Lambert conformal conic) or the B<-a> +option (for Albers equal area). At least one of these options must be +given (the last one given is used). Specify I = I, to +obtain the case with a single standard parallel. The central meridian +is given by I. The longitude of origin is given by the latitude +of minimum (azimuthal) scale for Lambert conformal conic (Albers equal +area). The (azimuthal) scale on the standard parallels is I. + +Geodetic coordinates are provided on standard input as a set of lines +containing (blank separated) I and I (decimal +degrees or degrees, minutes, seconds). For each set of geodetic +coordinates, the corresponding projected easting, I, and northing, +I, (meters) are printed on standard output together with the meridian +convergence I (degrees) and (azimuthal) scale I. For Albers +equal area, the radial scale is 1/I. The meridian convergence is the +bearing of the I axis measured clockwise from true north. + +Special cases of the Lambert conformal projection are the Mercator +projection (the standard latitudes equal and opposite) and the polar +stereographic projection (both standard latitudes correspond to the same +pole). Special cases of the Albers equal area projection are the +cylindrical equal area projection (the standard latitudes equal and +opposite), the Lambert azimuthal equal area projection (both standard +latitude corresponds to the same pole), and the Lambert equal area conic +projection (one standard parallel is at a pole). + +=head1 OPTIONS + +=over + +=item B<-c> + +use the Lambert conformal conic projection with standard parallels +I and I. + +=item B<-a> + +use the Albers equal area projection with standard parallels I and +I. + +=item B<-l> + +specify the longitude of origin I (degrees, default 0). + +=item B<-k> + +specify the (azimuthal) scale I on the standard parallels (default +1). + +=item B<-r> + +perform the reverse projection. I and I are given on standard +input and each line of standard output gives I, I, +I, and I. + +=item B<-e> + +specify the ellipsoid via I I; the equatorial radius is I and +the flattening is I. Setting I = 0 results in a sphere. Specify +I E 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, +is allowed for I. (Also, if I E 1, the flattening is set to +1/I.) By default, the WGS84 ellipsoid is used, I = 6378137 m, +I = 1/298.257223563. + +=item B<--comment-delimiter> + +set the comment delimiter to I (e.g., "#" or "//"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). + +=item B<--version> + +print version and exit. + +=item B<-h> + +print usage and exit. + +=item B<--help> + +print full documentation and exit. + +=item B<--input-file> + +read input from the file I instead of from standard input; a file +name of "-" stands for standard input. + +=item B<--input-string> + +read input from the string I instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in I are converted to newlines before the reading begins. + +=item B<--line-separator> + +set the line separator character to I. By default this is a +semicolon. + +=item B<--output-file> + +write output to the file I instead of to standard output; a +file name of "-" stands for standard output. + +=back + +=head1 EXAMPLES + + echo 39.95N 75.17W | ConicProj -c 40d58 39d56 -l 77d45W + => 220445 -52372 1.67 1.0 + echo 220445 -52372 | ConicProj -c 40d58 39d56 -l 77d45W -r + => 39.95 -75.17 1.67 1.0 + +=head1 ERRORS + +An illegal line of input will print an error message to standard output +beginning with C and causes B to return an exit +code of 1. However, an error does not cause B to +terminate; following lines will be converted. + +=head1 AUTHOR + +B was written by Charles Karney. + +=head1 HISTORY + +B was added to GeographicLib, L, +in version 1.9. diff --git a/gtsam/3rdparty/GeographicLib/man/ConicProj.usage b/gtsam/3rdparty/GeographicLib/man/ConicProj.usage new file mode 100644 index 000000000..3fbcc4481 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/ConicProj.usage @@ -0,0 +1,130 @@ +int usage(int retval, bool brief) { + if (brief) + ( retval ? std::cerr : std::cout ) << "Usage:\n" +" ConicProj ( -c | -a ) lat1 lat2 [ -l lon0 ] [ -k k1 ] [ -r ] [ -e a f ]\n" +" [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [\n" +" --input-file infile | --input-string instring ] [ --line-separator\n" +" linesep ] [ --output-file outfile ]\n" +"\n" +"For full documentation type:\n" +" ConicProj --help\n" +"or visit:\n" +" http://geographiclib.sf.net/1.34/ConicProj.1.html\n"; + else + ( retval ? std::cerr : std::cout ) << "Man page:\n" +"NAME\n" +" ConicProj -- perform conic projections\n" +"\n" +"SYNOPSIS\n" +" ConicProj ( -c | -a ) lat1 lat2 [ -l lon0 ] [ -k k1 ] [ -r ] [ -e a f ]\n" +" [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [\n" +" --input-file infile | --input-string instring ] [ --line-separator\n" +" linesep ] [ --output-file outfile ]\n" +"\n" +"DESCRIPTION\n" +" Perform one of two conic projections geodesics. Convert geodetic\n" +" coordinates to either Lambert conformal conic or Albers equal area\n" +" coordinates. The standard latitudes lat1 and lat2 are specified by\n" +" that the -c option (for Lambert conformal conic) or the -a option (for\n" +" Albers equal area). At least one of these options must be given (the\n" +" last one given is used). Specify lat1 = lat2, to obtain the case with\n" +" a single standard parallel. The central meridian is given by lon0.\n" +" The longitude of origin is given by the latitude of minimum (azimuthal)\n" +" scale for Lambert conformal conic (Albers equal area). The (azimuthal)\n" +" scale on the standard parallels is k1.\n" +"\n" +" Geodetic coordinates are provided on standard input as a set of lines\n" +" containing (blank separated) latitude and longitude (decimal degrees or\n" +" degrees, minutes, seconds). For each set of geodetic coordinates, the\n" +" corresponding projected easting, x, and northing, y, (meters) are\n" +" printed on standard output together with the meridian convergence gamma\n" +" (degrees) and (azimuthal) scale k. For Albers equal area, the radial\n" +" scale is 1/k. The meridian convergence is the bearing of the y axis\n" +" measured clockwise from true north.\n" +"\n" +" Special cases of the Lambert conformal projection are the Mercator\n" +" projection (the standard latitudes equal and opposite) and the polar\n" +" stereographic projection (both standard latitudes correspond to the\n" +" same pole). Special cases of the Albers equal area projection are the\n" +" cylindrical equal area projection (the standard latitudes equal and\n" +" opposite), the Lambert azimuthal equal area projection (both standard\n" +" latitude corresponds to the same pole), and the Lambert equal area\n" +" conic projection (one standard parallel is at a pole).\n" +"\n" +"OPTIONS\n" +" -c use the Lambert conformal conic projection with standard parallels\n" +" lat1 and lat2.\n" +"\n" +" -a use the Albers equal area projection with standard parallels lat1\n" +" and lat2.\n" +"\n" +" -l specify the longitude of origin lon0 (degrees, default 0).\n" +"\n" +" -k specify the (azimuthal) scale k1 on the standard parallels (default\n" +" 1).\n" +"\n" +" -r perform the reverse projection. x and y are given on standard\n" +" input and each line of standard output gives latitude, longitude,\n" +" gamma, and k.\n" +"\n" +" -e specify the ellipsoid via a f; the equatorial radius is a and the\n" +" flattening is f. Setting f = 0 results in a sphere. Specify f < 0\n" +" for a prolate ellipsoid. A simple fraction, e.g., 1/297, is\n" +" allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By\n" +" default, the WGS84 ellipsoid is used, a = 6378137 m, f =\n" +" 1/298.257223563.\n" +"\n" +" --comment-delimiter\n" +" set the comment delimiter to commentdelim (e.g., \"#\" or \"//\"). If\n" +" set, the input lines will be scanned for this delimiter and, if\n" +" found, the delimiter and the rest of the line will be removed prior\n" +" to processing and subsequently appended to the output line\n" +" (separated by a space).\n" +"\n" +" --version\n" +" print version and exit.\n" +"\n" +" -h print usage and exit.\n" +"\n" +" --help\n" +" print full documentation and exit.\n" +"\n" +" --input-file\n" +" read input from the file infile instead of from standard input; a\n" +" file name of \"-\" stands for standard input.\n" +"\n" +" --input-string\n" +" read input from the string instring instead of from standard input.\n" +" All occurrences of the line separator character (default is a\n" +" semicolon) in instring are converted to newlines before the reading\n" +" begins.\n" +"\n" +" --line-separator\n" +" set the line separator character to linesep. By default this is a\n" +" semicolon.\n" +"\n" +" --output-file\n" +" write output to the file outfile instead of to standard output; a\n" +" file name of \"-\" stands for standard output.\n" +"\n" +"EXAMPLES\n" +" echo 39.95N 75.17W | ConicProj -c 40d58 39d56 -l 77d45W\n" +" => 220445 -52372 1.67 1.0\n" +" echo 220445 -52372 | ConicProj -c 40d58 39d56 -l 77d45W -r\n" +" => 39.95 -75.17 1.67 1.0\n" +"\n" +"ERRORS\n" +" An illegal line of input will print an error message to standard output\n" +" beginning with \"ERROR:\" and causes ConicProj to return an exit code of\n" +" 1. However, an error does not cause ConicProj to terminate; following\n" +" lines will be converted.\n" +"\n" +"AUTHOR\n" +" ConicProj was written by Charles Karney.\n" +"\n" +"HISTORY\n" +" ConicProj was added to GeographicLib, , in\n" +" version 1.9.\n" +; + return retval; +} diff --git a/gtsam/3rdparty/GeographicLib/man/GeoConvert.1 b/gtsam/3rdparty/GeographicLib/man/GeoConvert.1 new file mode 100644 index 000000000..0dfa11283 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeoConvert.1 @@ -0,0 +1,438 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "GEOCONVERT 1" +.TH GEOCONVERT 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +GeoConvert \-\- convert geographic coordinates +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBGeoConvert\fR [ \fB\-g\fR | \fB\-d\fR | \fB\-:\fR | \fB\-u\fR | \fB\-m\fR | \fB\-c\fR ] +[ \fB\-p\fR \fIprec\fR ] [ \fB\-z\fR \fIzone\fR | \fB\-s\fR | \fB\-t\fR ] [ \fB\-n\fR ] [ \fB\-w\fR ] +[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] +[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] +[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] +[ \fB\-\-line\-separator\fR \fIlinesep\fR ] +[ \fB\-\-output\-file\fR \fIoutfile\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBGeoConvert\fR reads from standard input interpreting each line as a +geographic coordinate and prints the coordinate in the format specified +by the options on standard output. The input is interpreted in one of +three different ways depending on how many space or comma delimited +tokens there are on the line. The options \fB\-g\fR, \fB\-d\fR, \fB\-u\fR, and \fB\-m\fR +govern the format of output. In all cases, the \s-1WGS84\s0 model of the earth +is used (\fIa\fR = 6378137 m, \fIf\fR = 1/298.257223563). +.IP "\fBgeographic\fR" 4 +.IX Item "geographic" +2 tokens (output options \fB\-g\fR, \fB\-d\fR, or \fB\-:\fR) given as \fIlatitude\fR +\&\fIlongitude\fR using decimal degrees or degrees minutes seconds. d, ', +and " are used to denote degrees, minutes, and seconds, with the least +significant designator optional. (See \*(L"\s-1QUOTING\s0\*(R" for how to +quote the characters ' and " when entering coordinates on the command +line.) Various unicode characters (encoded with \s-1UTF\-8\s0) may also be used +to denote degrees, minutes, and seconds, e.g., the degree, prime, and +double prime symbols. Alternatively, : (colon) may be used to separate +the various components. Latitude is given first (unless the \fB\-w\fR +option is given); however, on input, either may be given first by +appending or prepending \fIN\fR or \fIS\fR to the latitude and \fIE\fR or \fIW\fR to +the longitude. For example, the following are all equivalent +.Sp +.Vb 5 +\& 33.3 44.4 +\& E44.4 N33.3 +\& 33d18\*(AqN 44d24\*(AqE +\& 44d24 33d18N +\& 33:18 44:24 +.Ve +.IP "\fB\s-1UTM/UPS\s0\fR" 4 +.IX Item "UTM/UPS" +3 tokens (output option \fB\-u\fR) given as \fIzone\fR+\fIhemisphere\fR \fIeasting\fR +\&\fInorthing\fR or \fIeasting\fR \fInorthing\fR \fIzone\fR+\fIhemisphere\fR, where +\&\fIhemisphere\fR is either \fIN\fR or \fIS\fR. The \fIzone\fR is absent for a \s-1UPS\s0 +specification. For example, +.Sp +.Vb 4 +\& 38N 444140.54 3684706.36 +\& 444140.54 3684706.36 38N +\& S 2173854.98 2985980.58 +\& 2173854.98 2985980.58 S +.Ve +.IP "\fB\s-1MRGS\s0\fR" 4 +.IX Item "MRGS" +1 token (output option \fB\-m\fR) is used to specify the center of an \s-1MGRS\s0 +grid square. For example, +.Sp +.Vb 2 +\& 38SMB4484 +\& 38SMB44140847064 +.Ve +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-g\fR" 4 +.IX Item "-g" +output latitude and longitude using decimal degrees. Default output mode. +.IP "\fB\-d\fR" 4 +.IX Item "-d" +output latitude and longitude using degrees, minutes, and seconds (\s-1DMS\s0). +.IP "\fB\-:\fR" 4 +.IX Item "-:" +like \fB\-d\fR, except use : as a separator instead of the d, ', and " +delimiters. +.IP "\fB\-u\fR" 4 +.IX Item "-u" +output \s-1UTM\s0 or \s-1UPS\s0. +.IP "\fB\-m\fR" 4 +.IX Item "-m" +output \s-1MGRS\s0. +.IP "\fB\-c\fR" 4 +.IX Item "-c" +output meridian convergence and scale for the corresponding \s-1UTM\s0 or +\&\s-1UPS\s0 projection. Convergence is the bearing of grid north given as +degrees clockwise from true north. +.IP "\fB\-p\fR" 4 +.IX Item "-p" +set the output precision to \fIprec\fR (default 0); \fIprec\fR is the +precision relative to 1 m. See \*(L"\s-1PRECISION\s0\*(R". +.IP "\fB\-z\fR" 4 +.IX Item "-z" +set the zone to \fIzone\fR for output. Use either 0 < \fIzone\fR <= +60 for a \s-1UTM\s0 zone or \fIzone\fR = 0 for \s-1UPS\s0. Alternatively use a +\&\fIzone\fR+\fIhemisphere\fR designation, e.g., 38N. See \*(L"\s-1ZONE\s0\*(R". +.IP "\fB\-s\fR" 4 +.IX Item "-s" +use the standard \s-1UPS\s0 and \s-1UTM\s0 zones. +.IP "\fB\-t\fR" 4 +.IX Item "-t" +similar to \fB\-s\fR but forces \s-1UPS\s0 regions to the closest \s-1UTM\s0 zone. +.IP "\fB\-n\fR" 4 +.IX Item "-n" +on input, \s-1MGRS\s0 coordinates refer to the south-west corner of the \s-1MGRS\s0 +square instead of the center; see \*(L"\s-1MGRS\s0\*(R". +.IP "\fB\-w\fR" 4 +.IX Item "-w" +on input and output, longitude precedes latitude (except that on input +this can be overridden by a hemisphere designator, \fIN\fR, \fIS\fR, \fIE\fR, +\&\fIW\fR). +.IP "\fB\-\-comment\-delimiter\fR" 4 +.IX Item "--comment-delimiter" +set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +print version and exit. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +print usage and exit. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +print full documentation and exit. +.IP "\fB\-\-input\-file\fR" 4 +.IX Item "--input-file" +read input from the file \fIinfile\fR instead of from standard input; a file +name of \*(L"\-\*(R" stands for standard input. +.IP "\fB\-\-input\-string\fR" 4 +.IX Item "--input-string" +read input from the string \fIinstring\fR instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in \fIinstring\fR are converted to newlines before the reading begins. +.IP "\fB\-\-line\-separator\fR" 4 +.IX Item "--line-separator" +set the line separator character to \fIlinesep\fR. By default this is a +semicolon. +.IP "\fB\-\-output\-file\fR" 4 +.IX Item "--output-file" +write output to the file \fIoutfile\fR instead of to standard output; a +file name of \*(L"\-\*(R" stands for standard output. +.SH "PRECISION" +.IX Header "PRECISION" +\&\fIprec\fR gives precision of the output with \fIprec\fR = 0 giving 1 m +precision, \fIprec\fR = 3 giving 1 mm precision, etc. \fIprec\fR is the number +of digits after the decimal point for \s-1UTM/UPS\s0. The number of digits per +coordinate for \s-1MGRS\s0 is 5 + \fIprec\fR. For decimal degrees, the number of +digits after the decimal point is 5 + \fIprec\fR. For \s-1DMS\s0 (degree, minute, +seconds) output, the number of digits after the decimal point in the +seconds components is 1 + \fIprec\fR; if this is negative then use minutes +(\fIprec\fR = \-2 or \-3) or degrees (\fIprec\fR <= \-4) as the least significant +component. Print convergence, resp. scale, with 5 + \fIprec\fR, resp. 7 + +\&\fIprec\fR, digits after the decimal point. The minimum value of \fIprec\fR is +\&\-5 and the maximum is 9 for \s-1UTM/UPS\s0, 9 for decimal degrees, 10 for \s-1DMS\s0, +6 for \s-1MGRS\s0, and 8 for convergence and scale. +.SH "MGRS" +.IX Header "MGRS" +\&\s-1MGRS\s0 coordinates represent a square patch of the earth, thus \f(CW\*(C`38SMB4488\*(C'\fR +is in zone \f(CW\*(C`38N\*(C'\fR with 444km <= \fIeasting\fR < 445km and 3688km <= +\&\fInorthing\fR < 3689km. Consistent with this representation, +coordinates are \fItruncated\fR (instead of \fIrounded\fR) to the requested +precision. Similarly, on input an \s-1MGRS\s0 coordinate represents the +\&\fIcenter\fR of the square (\f(CW\*(C`38N 444500 3688500\*(C'\fR in the example above). +However, if the \fB\-n\fR option is given then the south-west corner of the +square is returned instead (\f(CW\*(C`38N 444000 3688000\*(C'\fR in the example above). +.SH "ZONE" +.IX Header "ZONE" +If the input is \fBgeographic\fR, \fBGeoConvert\fR uses the standard rules of +selecting \s-1UTM\s0 vs \s-1UPS\s0 and for assigning the \s-1UTM\s0 zone (with the Norway and +Svalbard exceptions). If the input is \fB\s-1UTM/UPS\s0\fR or \fB\s-1MGRS\s0\fR, then the +choice between \s-1UTM\s0 and \s-1UPS\s0 and the \s-1UTM\s0 zone mirrors the input. The \fB\-z\fR +\&\fIzone\fR, \fB\-s\fR, and \fB\-t\fR options allow these rules to be overridden +with \fIzone\fR = 0 being used to indicate \s-1UPS\s0. For example, the point +.PP +.Vb 1 +\& 79.9S 6.1E +.Ve +.PP +corresponds to possible \s-1MGRS\s0 coordinates +.PP +.Vb 3 +\& 32CMS4324728161 (standard UTM zone = 32) +\& 31CEM6066227959 (neighboring UTM zone = 31) +\& BBZ1945517770 (neighboring UPS zone) +.Ve +.PP +then +.PP +.Vb 4 +\& echo 79.9S 6.1E | GeoConvert \-p \-3 \-m => 32CMS4328 +\& echo 31CEM6066227959 | GeoConvert \-p \-3 \-m => 31CEM6027 +\& echo 31CEM6066227959 | GeoConvert \-p \-3 \-m \-s => 32CMS4328 +\& echo 31CEM6066227959 | GeoConvert \-p \-3 \-m \-z 0 => BBZ1917 +.Ve +.PP +Is \fIzone\fR is specified with a hemisphere, then this is honored when +printing \s-1UTM\s0 coordinates: +.PP +.Vb 4 +\& echo \-1 3 | GeoConvert \-u => 31S 500000 9889470 +\& echo \-1 3 | GeoConvert \-u \-z 31 => 31S 500000 9889470 +\& echo \-1 3 | GeoConvert \-u \-z 31S => 31S 500000 9889470 +\& echo \-1 3 | GeoConvert \-u \-z 31N => 31N 500000 \-110530 +.Ve +.PP +\&\fB\s-1NOTE\s0\fR: the letter in the zone specification for \s-1UTM\s0 is a hemisphere +designator \fIN\fR or \fIS\fR and \fInot\fR an \s-1MGRS\s0 latitude band letter. +Convert the \s-1MGRS\s0 latitude band letter to a hemisphere as follows: +replace \fIC\fR thru \fIM\fR by \fIS\fR; replace \fIN\fR thru \fIX\fR by \fIN\fR. +.SH "QUOTING" +.IX Header "QUOTING" +Unfortunately the characters ' and \*(L" have special meanings in many +shells and have to be entered with care. However note (1) that the +trailing designator is optional and that (2) you can use colons as a +separator character. Thus 10d20' can be entered as 10d20 or 10:20 and +10d20'30\*(R" can be entered as 10:20:30. +.IP "Unix shells (sh, bash, tsch)" 4 +.IX Item "Unix shells (sh, bash, tsch)" +The characters ' and \*(L" can be quoted by preceding them with a \e +(backslash); or you can quote a ' with a pair of \*(R"s. The two +alternatives are illustrated by +.Sp +.Vb 2 +\& echo 10d20\e\*(Aq30\e" "20d30\*(Aq40" | GeoConvert \-d \-p \-1 +\& => 10d20\*(Aq30"N 020d30\*(Aq40"E +.Ve +.Sp +Quoting of command line arguments is similar +.Sp +.Vb 2 +\& GeoConvert \-d \-p \-1 \-\-input\-string "10d20\*(Aq30\e" 20d30\*(Aq40" +\& => 10d20\*(Aq30"N 020d30\*(Aq40"E +.Ve +.IP "Windows command shell (cmd)" 4 +.IX Item "Windows command shell (cmd)" +The ' character needs no quoting and the " character can be quoted by a +^. (This quoting is usually unnecessary because the trailing designator +can be omitted.) Thus +.Sp +.Vb 2 +\& echo 10d20\*(Aq30^" 20d30\*(Aq40 | GeoConvert \-d \-p \-1 +\& => 10d20\*(Aq30"N 020d30\*(Aq40"E +.Ve +.Sp +Use \e to quote the " character in a command line argument +.Sp +.Vb 2 +\& GeoConvert \-d \-p \-1 \-\-input\-string "10d20\*(Aq30\e" 20d30\*(Aq40" +\& => 10d20\*(Aq30"N 020d30\*(Aq40"E +.Ve +.IP "Input from a file" 4 +.IX Item "Input from a file" +No quoting need be done if the input from a file. Thus each line of the +file \f(CW\*(C`input.txt\*(C'\fR should just contain the plain coordinates. +.Sp +.Vb 1 +\& GeoConvert \-d \-p \-1 < input.txt +.Ve +.SH "EXAMPLES" +.IX Header "EXAMPLES" +.Vb 4 +\& echo 38SMB4488 | GeoConvert => 33.33424 44.40363 +\& echo 38SMB4488 | GeoConvert \-: \-p 1 => 33:20:03.25N 044:2413.06E +\& echo 38SMB4488 | GeoConvert \-u => 38N 444500 3688500 +\& echo E44d24 N33d20 | GeoConvert \-m \-p \-3 => 38SMB4488 +.Ve +.SH "ERRORS" +.IX Header "ERRORS" +An illegal line of input will print an error message to standard output +beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGeoConvert\fR to return an exit code +of 1. However, an error does not cause \fBGeoConvert\fR to terminate; +following lines will be converted. +.SH "ABBREVIATIONS" +.IX Header "ABBREVIATIONS" +.IP "\fB\s-1UTM\s0\fR" 4 +.IX Item "UTM" +Universal Transverse Mercator, +. +.IP "\fB\s-1UPS\s0\fR" 4 +.IX Item "UPS" +Universal Polar Stereographic, +. +.IP "\fB\s-1MGRS\s0\fR" 4 +.IX Item "MGRS" +Military Grid Reference System, +. +.IP "\fB\s-1WGS84\s0\fR" 4 +.IX Item "WGS84" +World Geodetic System 1984, +. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +The algorithms for the transverse Mercator projection are described in +C. F. F. Karney, \fITransverse Mercator with an accuracy of a few +nanometers\fR, J. Geodesy \fB85\fR(8), 475\-485 (Aug. 2011); \s-1DOI\s0 +http://dx.doi.org/10.1007/s00190\-011\-0445\-3 ; preprint +. +.SH "AUTHOR" +.IX Header "AUTHOR" +\&\fBGeoConvert\fR was written by Charles Karney. +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBGeoConvert\fR was added to GeographicLib, +, in 2009\-01. diff --git a/gtsam/3rdparty/GeographicLib/man/GeoConvert.1.html b/gtsam/3rdparty/GeographicLib/man/GeoConvert.1.html new file mode 100644 index 000000000..c46e2e7c0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeoConvert.1.html @@ -0,0 +1,326 @@ + + + + + + + + + + + + + +

NAME

+ +

GeoConvert -- convert geographic coordinates

+ +

SYNOPSIS

+ +

GeoConvert [ -g | -d | -: | -u | -m | -c ] [ -p prec ] [ -z zone | -s | -t ] [ -n ] [ -w ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]

+ +

DESCRIPTION

+ +

GeoConvert reads from standard input interpreting each line as a geographic coordinate and prints the coordinate in the format specified by the options on standard output. The input is interpreted in one of three different ways depending on how many space or comma delimited tokens there are on the line. The options -g, -d, -u, and -m govern the format of output. In all cases, the WGS84 model of the earth is used (a = 6378137 m, f = 1/298.257223563).

+ +
+ +
geographic
+
+ +

2 tokens (output options -g, -d, or -:) given as latitude longitude using decimal degrees or degrees minutes seconds. d, ', and " are used to denote degrees, minutes, and seconds, with the least significant designator optional. (See "QUOTING" for how to quote the characters ' and " when entering coordinates on the command line.) Various unicode characters (encoded with UTF-8) may also be used to denote degrees, minutes, and seconds, e.g., the degree, prime, and double prime symbols. Alternatively, : (colon) may be used to separate the various components. Latitude is given first (unless the -w option is given); however, on input, either may be given first by appending or prepending N or S to the latitude and E or W to the longitude. For example, the following are all equivalent

+ +
    33.3 44.4
+    E44.4 N33.3
+    33d18'N 44d24'E
+    44d24 33d18N
+    33:18 44:24
+ +
+
UTM/UPS
+
+ +

3 tokens (output option -u) given as zone+hemisphere easting northing or easting northing zone+hemisphere, where hemisphere is either N or S. The zone is absent for a UPS specification. For example,

+ +
    38N 444140.54 3684706.36
+    444140.54 3684706.36 38N
+    S 2173854.98 2985980.58
+    2173854.98 2985980.58 S
+ +
+
MRGS
+
+ +

1 token (output option -m) is used to specify the center of an MGRS grid square. For example,

+ +
    38SMB4484
+    38SMB44140847064
+ +
+
+ +

OPTIONS

+ +
+ +
-g
+
+ +

output latitude and longitude using decimal degrees. Default output mode.

+ +
+
-d
+
+ +

output latitude and longitude using degrees, minutes, and seconds (DMS).

+ +
+
-:
+
+ +

like -d, except use : as a separator instead of the d, ', and " delimiters.

+ +
+
-u
+
+ +

output UTM or UPS.

+ +
+
-m
+
+ +

output MGRS.

+ +
+
-c
+
+ +

output meridian convergence and scale for the corresponding UTM or UPS projection. Convergence is the bearing of grid north given as degrees clockwise from true north.

+ +
+
-p
+
+ +

set the output precision to prec (default 0); prec is the precision relative to 1 m. See "PRECISION".

+ +
+
-z
+
+ +

set the zone to zone for output. Use either 0 < zone <= 60 for a UTM zone or zone = 0 for UPS. Alternatively use a zone+hemisphere designation, e.g., 38N. See "ZONE".

+ +
+
-s
+
+ +

use the standard UPS and UTM zones.

+ +
+
-t
+
+ +

similar to -s but forces UPS regions to the closest UTM zone.

+ +
+
-n
+
+ +

on input, MGRS coordinates refer to the south-west corner of the MGRS square instead of the center; see "MGRS".

+ +
+
-w
+
+ +

on input and output, longitude precedes latitude (except that on input this can be overridden by a hemisphere designator, N, S, E, W).

+ +
+
--comment-delimiter
+
+ +

set the comment delimiter to commentdelim (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).

+ +
+
--version
+
+ +

print version and exit.

+ +
+
-h
+
+ +

print usage and exit.

+ +
+
--help
+
+ +

print full documentation and exit.

+ +
+
--input-file
+
+ +

read input from the file infile instead of from standard input; a file name of "-" stands for standard input.

+ +
+
--input-string
+
+ +

read input from the string instring instead of from standard input. All occurrences of the line separator character (default is a semicolon) in instring are converted to newlines before the reading begins.

+ +
+
--line-separator
+
+ +

set the line separator character to linesep. By default this is a semicolon.

+ +
+
--output-file
+
+ +

write output to the file outfile instead of to standard output; a file name of "-" stands for standard output.

+ +
+
+ +

PRECISION

+ +

prec gives precision of the output with prec = 0 giving 1 m precision, prec = 3 giving 1 mm precision, etc. prec is the number of digits after the decimal point for UTM/UPS. The number of digits per coordinate for MGRS is 5 + prec. For decimal degrees, the number of digits after the decimal point is 5 + prec. For DMS (degree, minute, seconds) output, the number of digits after the decimal point in the seconds components is 1 + prec; if this is negative then use minutes (prec = -2 or -3) or degrees (prec <= -4) as the least significant component. Print convergence, resp. scale, with 5 + prec, resp. 7 + prec, digits after the decimal point. The minimum value of prec is -5 and the maximum is 9 for UTM/UPS, 9 for decimal degrees, 10 for DMS, 6 for MGRS, and 8 for convergence and scale.

+ +

MGRS

+ +

MGRS coordinates represent a square patch of the earth, thus 38SMB4488 is in zone 38N with 444km <= easting < 445km and 3688km <= northing < 3689km. Consistent with this representation, coordinates are truncated (instead of rounded) to the requested precision. Similarly, on input an MGRS coordinate represents the center of the square (38N 444500 3688500 in the example above). However, if the -n option is given then the south-west corner of the square is returned instead (38N 444000 3688000 in the example above).

+ +

ZONE

+ +

If the input is geographic, GeoConvert uses the standard rules of selecting UTM vs UPS and for assigning the UTM zone (with the Norway and Svalbard exceptions). If the input is UTM/UPS or MGRS, then the choice between UTM and UPS and the UTM zone mirrors the input. The -z zone, -s, and -t options allow these rules to be overridden with zone = 0 being used to indicate UPS. For example, the point

+ +
   79.9S 6.1E
+ +

corresponds to possible MGRS coordinates

+ +
   32CMS4324728161 (standard UTM zone = 32)
+   31CEM6066227959 (neighboring UTM zone = 31)
+     BBZ1945517770 (neighboring UPS zone)
+ +

then

+ +
   echo 79.9S 6.1E      | GeoConvert -p -3 -m       => 32CMS4328
+   echo 31CEM6066227959 | GeoConvert -p -3 -m       => 31CEM6027
+   echo 31CEM6066227959 | GeoConvert -p -3 -m -s    => 32CMS4328
+   echo 31CEM6066227959 | GeoConvert -p -3 -m -z 0  =>   BBZ1917
+ +

Is zone is specified with a hemisphere, then this is honored when printing UTM coordinates:

+ +
   echo -1 3 | GeoConvert -u         => 31S 500000 9889470
+   echo -1 3 | GeoConvert -u -z 31   => 31S 500000 9889470
+   echo -1 3 | GeoConvert -u -z 31S  => 31S 500000 9889470
+   echo -1 3 | GeoConvert -u -z 31N  => 31N 500000 -110530
+ +

NOTE: the letter in the zone specification for UTM is a hemisphere designator N or S and not an MGRS latitude band letter. Convert the MGRS latitude band letter to a hemisphere as follows: replace C thru M by S; replace N thru X by N.

+ +

QUOTING

+ +

Unfortunately the characters ' and " have special meanings in many shells and have to be entered with care. However note (1) that the trailing designator is optional and that (2) you can use colons as a separator character. Thus 10d20' can be entered as 10d20 or 10:20 and 10d20'30" can be entered as 10:20:30.

+ +
+ +
Unix shells (sh, bash, tsch)
+
+ +

The characters ' and " can be quoted by preceding them with a \ (backslash); or you can quote a ' with a pair of "s. The two alternatives are illustrated by

+ +
   echo 10d20\'30\" "20d30'40" | GeoConvert -d -p -1
+   => 10d20'30"N 020d30'40"E
+ +

Quoting of command line arguments is similar

+ +
   GeoConvert -d -p -1 --input-string "10d20'30\" 20d30'40"
+   => 10d20'30"N 020d30'40"E
+ +
+
Windows command shell (cmd)
+
+ +

The ' character needs no quoting and the " character can be quoted by a ^. (This quoting is usually unnecessary because the trailing designator can be omitted.) Thus

+ +
   echo 10d20'30^" 20d30'40 | GeoConvert -d -p -1
+   => 10d20'30"N 020d30'40"E
+ +

Use \ to quote the " character in a command line argument

+ +
   GeoConvert -d -p -1 --input-string "10d20'30\" 20d30'40"
+   => 10d20'30"N 020d30'40"E
+ +
+
Input from a file
+
+ +

No quoting need be done if the input from a file. Thus each line of the file input.txt should just contain the plain coordinates.

+ +
  GeoConvert -d -p -1 < input.txt
+ +
+
+ +

EXAMPLES

+ +
   echo 38SMB4488 | GeoConvert         => 33.33424 44.40363
+   echo 38SMB4488 | GeoConvert -: -p 1 => 33:20:03.25N 044:2413.06E
+   echo 38SMB4488 | GeoConvert -u      => 38N 444500 3688500
+   echo E44d24 N33d20 | GeoConvert -m -p -3 => 38SMB4488
+ +

ERRORS

+ +

An illegal line of input will print an error message to standard output beginning with ERROR: and causes GeoConvert to return an exit code of 1. However, an error does not cause GeoConvert to terminate; following lines will be converted.

+ +

ABBREVIATIONS

+ +
+ +
UTM
+
+ +

Universal Transverse Mercator, http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system.

+ +
+
UPS
+
+ +

Universal Polar Stereographic, http://en.wikipedia.org/wiki/Universal_Polar_Stereographic.

+ +
+
MGRS
+
+ +

Military Grid Reference System, http://en.wikipedia.org/wiki/Military_grid_reference_system.

+ +
+
WGS84
+
+ +

World Geodetic System 1984, http://en.wikipedia.org/wiki/WGS84.

+ +
+
+ +

SEE ALSO

+ +

The algorithms for the transverse Mercator projection are described in C. F. F. Karney, Transverse Mercator with an accuracy of a few nanometers, J. Geodesy 85(8), 475-485 (Aug. 2011); DOI http://dx.doi.org/10.1007/s00190-011-0445-3; preprint http://arxiv.org/abs/1002.1417.

+ +

AUTHOR

+ +

GeoConvert was written by Charles Karney.

+ +

HISTORY

+ +

GeoConvert was added to GeographicLib, http://geographiclib.sf.net, in 2009-01.

+ + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/man/GeoConvert.pod b/gtsam/3rdparty/GeographicLib/man/GeoConvert.pod new file mode 100644 index 000000000..f3681ca2c --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeoConvert.pod @@ -0,0 +1,339 @@ +=head1 NAME + +GeoConvert -- convert geographic coordinates + +=head1 SYNOPSIS + +B [ B<-g> | B<-d> | B<-:> | B<-u> | B<-m> | B<-c> ] +[ B<-p> I ] [ B<-z> I | B<-s> | B<-t> ] [ B<-n> ] [ B<-w> ] +[ B<--comment-delimiter> I ] +[ B<--version> | B<-h> | B<--help> ] +[ B<--input-file> I | B<--input-string> I ] +[ B<--line-separator> I ] +[ B<--output-file> I ] + +=head1 DESCRIPTION + +B reads from standard input interpreting each line as a +geographic coordinate and prints the coordinate in the format specified +by the options on standard output. The input is interpreted in one of +three different ways depending on how many space or comma delimited +tokens there are on the line. The options B<-g>, B<-d>, B<-u>, and B<-m> +govern the format of output. In all cases, the WGS84 model of the earth +is used (I = 6378137 m, I = 1/298.257223563). + +=over + +=item B + +2 tokens (output options B<-g>, B<-d>, or B<-:>) given as I +I using decimal degrees or degrees minutes seconds. d, ', +and " are used to denote degrees, minutes, and seconds, with the least +significant designator optional. (See L for how to +quote the characters ' and " when entering coordinates on the command +line.) Various unicode characters (encoded with UTF-8) may also be used +to denote degrees, minutes, and seconds, e.g., the degree, prime, and +double prime symbols. Alternatively, : (colon) may be used to separate +the various components. Latitude is given first (unless the B<-w> +option is given); however, on input, either may be given first by +appending or prepending I or I to the latitude and I or I to +the longitude. For example, the following are all equivalent + + 33.3 44.4 + E44.4 N33.3 + 33d18'N 44d24'E + 44d24 33d18N + 33:18 44:24 + +=item B + +3 tokens (output option B<-u>) given as I+I I +I or I I I+I, where +I is either I or I. The I is absent for a UPS +specification. For example, + + 38N 444140.54 3684706.36 + 444140.54 3684706.36 38N + S 2173854.98 2985980.58 + 2173854.98 2985980.58 S + +=item B + +1 token (output option B<-m>) is used to specify the center of an MGRS +grid square. For example, + + 38SMB4484 + 38SMB44140847064 + +=back + +=head1 OPTIONS + +=over + +=item B<-g> + +output latitude and longitude using decimal degrees. Default output mode. + +=item B<-d> + +output latitude and longitude using degrees, minutes, and seconds (DMS). + +=item B<-:> + +like B<-d>, except use : as a separator instead of the d, ', and " +delimiters. + +=item B<-u> + +output UTM or UPS. + +=item B<-m> + +output MGRS. + +=item B<-c> + +output meridian convergence and scale for the corresponding UTM or +UPS projection. Convergence is the bearing of grid north given as +degrees clockwise from true north. + +=item B<-p> + +set the output precision to I (default 0); I is the +precision relative to 1 m. See L. + +=item B<-z> + +set the zone to I for output. Use either 0 E I E= +60 for a UTM zone or I = 0 for UPS. Alternatively use a +I+I designation, e.g., 38N. See L. + +=item B<-s> + +use the standard UPS and UTM zones. + +=item B<-t> + +similar to B<-s> but forces UPS regions to the closest UTM zone. + +=item B<-n> + +on input, MGRS coordinates refer to the south-west corner of the MGRS +square instead of the center; see L. + +=item B<-w> + +on input and output, longitude precedes latitude (except that on input +this can be overridden by a hemisphere designator, I, I, I, +I). + +=item B<--comment-delimiter> + +set the comment delimiter to I (e.g., "#" or "//"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). + +=item B<--version> + +print version and exit. + +=item B<-h> + +print usage and exit. + +=item B<--help> + +print full documentation and exit. + +=item B<--input-file> + +read input from the file I instead of from standard input; a file +name of "-" stands for standard input. + +=item B<--input-string> + +read input from the string I instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in I are converted to newlines before the reading begins. + +=item B<--line-separator> + +set the line separator character to I. By default this is a +semicolon. + +=item B<--output-file> + +write output to the file I instead of to standard output; a +file name of "-" stands for standard output. + +=back + +=head1 PRECISION + +I gives precision of the output with I = 0 giving 1 m +precision, I = 3 giving 1 mm precision, etc. I is the number +of digits after the decimal point for UTM/UPS. The number of digits per +coordinate for MGRS is 5 + I. For decimal degrees, the number of +digits after the decimal point is 5 + I. For DMS (degree, minute, +seconds) output, the number of digits after the decimal point in the +seconds components is 1 + I; if this is negative then use minutes +(I = -2 or -3) or degrees (I E= -4) as the least significant +component. Print convergence, resp. scale, with 5 + I, resp. 7 + +I, digits after the decimal point. The minimum value of I is +-5 and the maximum is 9 for UTM/UPS, 9 for decimal degrees, 10 for DMS, +6 for MGRS, and 8 for convergence and scale. + +=head1 MGRS + +MGRS coordinates represent a square patch of the earth, thus C<38SMB4488> +is in zone C<38N> with 444km E= I E 445km and 3688km E= +I E 3689km. Consistent with this representation, +coordinates are I (instead of I) to the requested +precision. Similarly, on input an MGRS coordinate represents the +I
of the square (C<38N 444500 3688500> in the example above). +However, if the B<-n> option is given then the south-west corner of the +square is returned instead (C<38N 444000 3688000> in the example above). + +=head1 ZONE + +If the input is B, B uses the standard rules of +selecting UTM vs UPS and for assigning the UTM zone (with the Norway and +Svalbard exceptions). If the input is B or B, then the +choice between UTM and UPS and the UTM zone mirrors the input. The B<-z> +I, B<-s>, and B<-t> options allow these rules to be overridden +with I = 0 being used to indicate UPS. For example, the point + + 79.9S 6.1E + +corresponds to possible MGRS coordinates + + 32CMS4324728161 (standard UTM zone = 32) + 31CEM6066227959 (neighboring UTM zone = 31) + BBZ1945517770 (neighboring UPS zone) + +then + + echo 79.9S 6.1E | GeoConvert -p -3 -m => 32CMS4328 + echo 31CEM6066227959 | GeoConvert -p -3 -m => 31CEM6027 + echo 31CEM6066227959 | GeoConvert -p -3 -m -s => 32CMS4328 + echo 31CEM6066227959 | GeoConvert -p -3 -m -z 0 => BBZ1917 + +Is I is specified with a hemisphere, then this is honored when +printing UTM coordinates: + + echo -1 3 | GeoConvert -u => 31S 500000 9889470 + echo -1 3 | GeoConvert -u -z 31 => 31S 500000 9889470 + echo -1 3 | GeoConvert -u -z 31S => 31S 500000 9889470 + echo -1 3 | GeoConvert -u -z 31N => 31N 500000 -110530 + +B: the letter in the zone specification for UTM is a hemisphere +designator I or I and I an MGRS latitude band letter. +Convert the MGRS latitude band letter to a hemisphere as follows: +replace I thru I by I; replace I thru I by I. + +=head1 QUOTING + +Unfortunately the characters ' and " have special meanings in many +shells and have to be entered with care. However note (1) that the +trailing designator is optional and that (2) you can use colons as a +separator character. Thus 10d20' can be entered as 10d20 or 10:20 and +10d20'30" can be entered as 10:20:30. + +=over + +=item Unix shells (sh, bash, tsch) + +The characters ' and " can be quoted by preceding them with a \ +(backslash); or you can quote a ' with a pair of "s. The two +alternatives are illustrated by + + echo 10d20\'30\" "20d30'40" | GeoConvert -d -p -1 + => 10d20'30"N 020d30'40"E + +Quoting of command line arguments is similar + + GeoConvert -d -p -1 --input-string "10d20'30\" 20d30'40" + => 10d20'30"N 020d30'40"E + +=item Windows command shell (cmd) + +The ' character needs no quoting and the " character can be quoted by a +^. (This quoting is usually unnecessary because the trailing designator +can be omitted.) Thus + + echo 10d20'30^" 20d30'40 | GeoConvert -d -p -1 + => 10d20'30"N 020d30'40"E + +Use \ to quote the " character in a command line argument + + GeoConvert -d -p -1 --input-string "10d20'30\" 20d30'40" + => 10d20'30"N 020d30'40"E + +=item Input from a file + +No quoting need be done if the input from a file. Thus each line of the +file C should just contain the plain coordinates. + + GeoConvert -d -p -1 < input.txt + +=back + +=head1 EXAMPLES + + echo 38SMB4488 | GeoConvert => 33.33424 44.40363 + echo 38SMB4488 | GeoConvert -: -p 1 => 33:20:03.25N 044:2413.06E + echo 38SMB4488 | GeoConvert -u => 38N 444500 3688500 + echo E44d24 N33d20 | GeoConvert -m -p -3 => 38SMB4488 + +=head1 ERRORS + +An illegal line of input will print an error message to standard output +beginning with C and causes B to return an exit code +of 1. However, an error does not cause B to terminate; +following lines will be converted. + +=head1 ABBREVIATIONS + +=over + +=item B + +Universal Transverse Mercator, +L. + +=item B + +Universal Polar Stereographic, +L. + +=item B + +Military Grid Reference System, +L. + +=item B + +World Geodetic System 1984, +L. + +=back + +=head1 SEE ALSO + +The algorithms for the transverse Mercator projection are described in +C. F. F. Karney, I, J. Geodesy B<85>(8), 475-485 (Aug. 2011); DOI +L; preprint +L. + +=head1 AUTHOR + +B was written by Charles Karney. + +=head1 HISTORY + +B was added to GeographicLib, +L, in 2009-01. diff --git a/gtsam/3rdparty/GeographicLib/man/GeoConvert.usage b/gtsam/3rdparty/GeographicLib/man/GeoConvert.usage new file mode 100644 index 000000000..7a0f8a852 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeoConvert.usage @@ -0,0 +1,282 @@ +int usage(int retval, bool brief) { + if (brief) + ( retval ? std::cerr : std::cout ) << "Usage:\n" +" GeoConvert [ -g | -d | -: | -u | -m | -c ] [ -p prec ] [ -z zone | -s |\n" +" -t ] [ -n ] [ -w ] [ --comment-delimiter commentdelim ] [ --version |\n" +" -h | --help ] [ --input-file infile | --input-string instring ] [\n" +" --line-separator linesep ] [ --output-file outfile ]\n" +"\n" +"For full documentation type:\n" +" GeoConvert --help\n" +"or visit:\n" +" http://geographiclib.sf.net/1.34/GeoConvert.1.html\n"; + else + ( retval ? std::cerr : std::cout ) << "Man page:\n" +"NAME\n" +" GeoConvert -- convert geographic coordinates\n" +"\n" +"SYNOPSIS\n" +" GeoConvert [ -g | -d | -: | -u | -m | -c ] [ -p prec ] [ -z zone | -s |\n" +" -t ] [ -n ] [ -w ] [ --comment-delimiter commentdelim ] [ --version |\n" +" -h | --help ] [ --input-file infile | --input-string instring ] [\n" +" --line-separator linesep ] [ --output-file outfile ]\n" +"\n" +"DESCRIPTION\n" +" GeoConvert reads from standard input interpreting each line as a\n" +" geographic coordinate and prints the coordinate in the format specified\n" +" by the options on standard output. The input is interpreted in one of\n" +" three different ways depending on how many space or comma delimited\n" +" tokens there are on the line. The options -g, -d, -u, and -m govern\n" +" the format of output. In all cases, the WGS84 model of the earth is\n" +" used (a = 6378137 m, f = 1/298.257223563).\n" +"\n" +" geographic\n" +" 2 tokens (output options -g, -d, or -:) given as latitude longitude\n" +" using decimal degrees or degrees minutes seconds. d, ', and \" are\n" +" used to denote degrees, minutes, and seconds, with the least\n" +" significant designator optional. (See \"QUOTING\" for how to quote\n" +" the characters ' and \" when entering coordinates on the command\n" +" line.) Various unicode characters (encoded with UTF-8) may also be\n" +" used to denote degrees, minutes, and seconds, e.g., the degree,\n" +" prime, and double prime symbols. Alternatively, : (colon) may be\n" +" used to separate the various components. Latitude is given first\n" +" (unless the -w option is given); however, on input, either may be\n" +" given first by appending or prepending N or S to the latitude and E\n" +" or W to the longitude. For example, the following are all\n" +" equivalent\n" +"\n" +" 33.3 44.4\n" +" E44.4 N33.3\n" +" 33d18'N 44d24'E\n" +" 44d24 33d18N\n" +" 33:18 44:24\n" +"\n" +" UTM/UPS\n" +" 3 tokens (output option -u) given as zone+hemisphere easting\n" +" northing or easting northing zone+hemisphere, where hemisphere is\n" +" either N or S. The zone is absent for a UPS specification. For\n" +" example,\n" +"\n" +" 38N 444140.54 3684706.36\n" +" 444140.54 3684706.36 38N\n" +" S 2173854.98 2985980.58\n" +" 2173854.98 2985980.58 S\n" +"\n" +" MRGS\n" +" 1 token (output option -m) is used to specify the center of an MGRS\n" +" grid square. For example,\n" +"\n" +" 38SMB4484\n" +" 38SMB44140847064\n" +"\n" +"OPTIONS\n" +" -g output latitude and longitude using decimal degrees. Default\n" +" output mode.\n" +"\n" +" -d output latitude and longitude using degrees, minutes, and seconds\n" +" (DMS).\n" +"\n" +" -: like -d, except use : as a separator instead of the d, ', and \"\n" +" delimiters.\n" +"\n" +" -u output UTM or UPS.\n" +"\n" +" -m output MGRS.\n" +"\n" +" -c output meridian convergence and scale for the corresponding UTM or\n" +" UPS projection. Convergence is the bearing of grid north given as\n" +" degrees clockwise from true north.\n" +"\n" +" -p set the output precision to prec (default 0); prec is the precision\n" +" relative to 1 m. See \"PRECISION\".\n" +"\n" +" -z set the zone to zone for output. Use either 0 < zone <= 60 for a\n" +" UTM zone or zone = 0 for UPS. Alternatively use a zone+hemisphere\n" +" designation, e.g., 38N. See \"ZONE\".\n" +"\n" +" -s use the standard UPS and UTM zones.\n" +"\n" +" -t similar to -s but forces UPS regions to the closest UTM zone.\n" +"\n" +" -n on input, MGRS coordinates refer to the south-west corner of the\n" +" MGRS square instead of the center; see \"MGRS\".\n" +"\n" +" -w on input and output, longitude precedes latitude (except that on\n" +" input this can be overridden by a hemisphere designator, N, S, E,\n" +" W).\n" +"\n" +" --comment-delimiter\n" +" set the comment delimiter to commentdelim (e.g., \"#\" or \"//\"). If\n" +" set, the input lines will be scanned for this delimiter and, if\n" +" found, the delimiter and the rest of the line will be removed prior\n" +" to processing and subsequently appended to the output line\n" +" (separated by a space).\n" +"\n" +" --version\n" +" print version and exit.\n" +"\n" +" -h print usage and exit.\n" +"\n" +" --help\n" +" print full documentation and exit.\n" +"\n" +" --input-file\n" +" read input from the file infile instead of from standard input; a\n" +" file name of \"-\" stands for standard input.\n" +"\n" +" --input-string\n" +" read input from the string instring instead of from standard input.\n" +" All occurrences of the line separator character (default is a\n" +" semicolon) in instring are converted to newlines before the reading\n" +" begins.\n" +"\n" +" --line-separator\n" +" set the line separator character to linesep. By default this is a\n" +" semicolon.\n" +"\n" +" --output-file\n" +" write output to the file outfile instead of to standard output; a\n" +" file name of \"-\" stands for standard output.\n" +"\n" +"PRECISION\n" +" prec gives precision of the output with prec = 0 giving 1 m precision,\n" +" prec = 3 giving 1 mm precision, etc. prec is the number of digits\n" +" after the decimal point for UTM/UPS. The number of digits per\n" +" coordinate for MGRS is 5 + prec. For decimal degrees, the number of\n" +" digits after the decimal point is 5 + prec. For DMS (degree, minute,\n" +" seconds) output, the number of digits after the decimal point in the\n" +" seconds components is 1 + prec; if this is negative then use minutes\n" +" (prec = -2 or -3) or degrees (prec <= -4) as the least significant\n" +" component. Print convergence, resp. scale, with 5 + prec, resp. 7 +\n" +" prec, digits after the decimal point. The minimum value of prec is -5\n" +" and the maximum is 9 for UTM/UPS, 9 for decimal degrees, 10 for DMS, 6\n" +" for MGRS, and 8 for convergence and scale.\n" +"\n" +"MGRS\n" +" MGRS coordinates represent a square patch of the earth, thus\n" +" \"38SMB4488\" is in zone \"38N\" with 444km <= easting < 445km and 3688km\n" +" <= northing < 3689km. Consistent with this representation, coordinates\n" +" are truncated (instead of rounded) to the requested precision.\n" +" Similarly, on input an MGRS coordinate represents the center of the\n" +" square (\"38N 444500 3688500\" in the example above). However, if the -n\n" +" option is given then the south-west corner of the square is returned\n" +" instead (\"38N 444000 3688000\" in the example above).\n" +"\n" +"ZONE\n" +" If the input is geographic, GeoConvert uses the standard rules of\n" +" selecting UTM vs UPS and for assigning the UTM zone (with the Norway\n" +" and Svalbard exceptions). If the input is UTM/UPS or MGRS, then the\n" +" choice between UTM and UPS and the UTM zone mirrors the input. The -z\n" +" zone, -s, and -t options allow these rules to be overridden with zone =\n" +" 0 being used to indicate UPS. For example, the point\n" +"\n" +" 79.9S 6.1E\n" +"\n" +" corresponds to possible MGRS coordinates\n" +"\n" +" 32CMS4324728161 (standard UTM zone = 32)\n" +" 31CEM6066227959 (neighboring UTM zone = 31)\n" +" BBZ1945517770 (neighboring UPS zone)\n" +"\n" +" then\n" +"\n" +" echo 79.9S 6.1E | GeoConvert -p -3 -m => 32CMS4328\n" +" echo 31CEM6066227959 | GeoConvert -p -3 -m => 31CEM6027\n" +" echo 31CEM6066227959 | GeoConvert -p -3 -m -s => 32CMS4328\n" +" echo 31CEM6066227959 | GeoConvert -p -3 -m -z 0 => BBZ1917\n" +"\n" +" Is zone is specified with a hemisphere, then this is honored when\n" +" printing UTM coordinates:\n" +"\n" +" echo -1 3 | GeoConvert -u => 31S 500000 9889470\n" +" echo -1 3 | GeoConvert -u -z 31 => 31S 500000 9889470\n" +" echo -1 3 | GeoConvert -u -z 31S => 31S 500000 9889470\n" +" echo -1 3 | GeoConvert -u -z 31N => 31N 500000 -110530\n" +"\n" +" NOTE: the letter in the zone specification for UTM is a hemisphere\n" +" designator N or S and not an MGRS latitude band letter. Convert the\n" +" MGRS latitude band letter to a hemisphere as follows: replace C thru M\n" +" by S; replace N thru X by N.\n" +"\n" +"QUOTING\n" +" Unfortunately the characters ' and \" have special meanings in many\n" +" shells and have to be entered with care. However note (1) that the\n" +" trailing designator is optional and that (2) you can use colons as a\n" +" separator character. Thus 10d20' can be entered as 10d20 or 10:20 and\n" +" 10d20'30\" can be entered as 10:20:30.\n" +"\n" +" Unix shells (sh, bash, tsch)\n" +" The characters ' and \" can be quoted by preceding them with a \\\n" +" (backslash); or you can quote a ' with a pair of \"s. The two\n" +" alternatives are illustrated by\n" +"\n" +" echo 10d20\\'30\\\" \"20d30'40\" | GeoConvert -d -p -1\n" +" => 10d20'30\"N 020d30'40\"E\n" +"\n" +" Quoting of command line arguments is similar\n" +"\n" +" GeoConvert -d -p -1 --input-string \"10d20'30\\\" 20d30'40\"\n" +" => 10d20'30\"N 020d30'40\"E\n" +"\n" +" Windows command shell (cmd)\n" +" The ' character needs no quoting and the \" character can be quoted\n" +" by a ^. (This quoting is usually unnecessary because the trailing\n" +" designator can be omitted.) Thus\n" +"\n" +" echo 10d20'30^\" 20d30'40 | GeoConvert -d -p -1\n" +" => 10d20'30\"N 020d30'40\"E\n" +"\n" +" Use \\ to quote the \" character in a command line argument\n" +"\n" +" GeoConvert -d -p -1 --input-string \"10d20'30\\\" 20d30'40\"\n" +" => 10d20'30\"N 020d30'40\"E\n" +"\n" +" Input from a file\n" +" No quoting need be done if the input from a file. Thus each line\n" +" of the file \"input.txt\" should just contain the plain coordinates.\n" +"\n" +" GeoConvert -d -p -1 < input.txt\n" +"\n" +"EXAMPLES\n" +" echo 38SMB4488 | GeoConvert => 33.33424 44.40363\n" +" echo 38SMB4488 | GeoConvert -: -p 1 => 33:20:03.25N 044:2413.06E\n" +" echo 38SMB4488 | GeoConvert -u => 38N 444500 3688500\n" +" echo E44d24 N33d20 | GeoConvert -m -p -3 => 38SMB4488\n" +"\n" +"ERRORS\n" +" An illegal line of input will print an error message to standard output\n" +" beginning with \"ERROR:\" and causes GeoConvert to return an exit code of\n" +" 1. However, an error does not cause GeoConvert to terminate; following\n" +" lines will be converted.\n" +"\n" +"ABBREVIATIONS\n" +" UTM Universal Transverse Mercator,\n" +" .\n" +"\n" +" UPS Universal Polar Stereographic,\n" +" .\n" +"\n" +" MGRS\n" +" Military Grid Reference System,\n" +" .\n" +"\n" +" WGS84\n" +" World Geodetic System 1984, .\n" +"\n" +"SEE ALSO\n" +" The algorithms for the transverse Mercator projection are described in\n" +" C. F. F. Karney, Transverse Mercator with an accuracy of a few\n" +" nanometers, J. Geodesy 85(8), 475-485 (Aug. 2011); DOI\n" +" http://dx.doi.org/10.1007/s00190-011-0445-3\n" +" ; preprint\n" +" .\n" +"\n" +"AUTHOR\n" +" GeoConvert was written by Charles Karney.\n" +"\n" +"HISTORY\n" +" GeoConvert was added to GeographicLib, ,\n" +" in 2009-01.\n" +; + return retval; +} diff --git a/gtsam/3rdparty/GeographicLib/man/GeodSolve.1 b/gtsam/3rdparty/GeographicLib/man/GeodSolve.1 new file mode 100644 index 000000000..06ca388e4 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeodSolve.1 @@ -0,0 +1,427 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "GEODSOLVE 1" +.TH GEODSOLVE 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +GeodSolve \-\- perform geodesic calculations +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBGeodSolve\fR [ \fB\-i\fR | \fB\-l\fR \fIlat1\fR \fIlon1\fR \fIazi1\fR ] [ \fB\-a\fR ] +[ \fB\-e\fR \fIa\fR \fIf\fR ] +[ \fB\-d\fR | \fB\-:\fR ] [ \fB\-b\fR ] [ \fB\-f\fR ] [ \fB\-p\fR \fIprec\fR ] [ \fB\-E\fR ] +[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] +[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] +[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] +[ \fB\-\-line\-separator\fR \fIlinesep\fR ] +[ \fB\-\-output\-file\fR \fIoutfile\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +The shortest path between two points on the ellipsoid at (\fIlat1\fR, +\&\fIlon1\fR) and (\fIlat2\fR, \fIlon2\fR) is called the geodesic. Its length is +\&\fIs12\fR and the geodesic from point 1 to point 2 has forward azimuths +\&\fIazi1\fR and \fIazi2\fR at the two end points. +.PP +\&\fBGeodSolve\fR operates in one of three modes: +.IP "1." 4 +By default, \fBGeodSolve\fR accepts lines on the standard input containing +\&\fIlat1\fR \fIlon1\fR \fIazi1\fR \fIs12\fR and prints \fIlat2\fR \fIlon2\fR \fIazi2\fR +on standard output. This is the direct geodesic calculation. +.IP "2." 4 +Command line arguments \fB\-l\fR \fIlat1\fR \fIlon1\fR \fIazi1\fR specify a geodesic +line. \fBGeodSolve\fR then accepts a sequence of \fIs12\fR values (one per +line) on standard input and prints \fIlat2\fR \fIlon2\fR \fIazi2\fR for each. +This generates a sequence of points on a single geodesic. +.IP "3." 4 +With the \fB\-i\fR command line argument, \fBGeodSolve\fR performs the inverse +geodesic calculation. It reads lines containing \fIlat1\fR \fIlon1\fR \fIlat2\fR +\&\fIlon2\fR and prints the corresponding values of \fIazi1\fR \fIazi2\fR \fIs12\fR. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-i\fR" 4 +.IX Item "-i" +perform an inverse geodesic calculation (see 3 above). +.IP "\fB\-l\fR" 4 +.IX Item "-l" +line mode (see 2 above); generate a sequence of points along the +geodesic specified by \fIlat1\fR \fIlon1\fR \fIazi1\fR. +.IP "\fB\-a\fR" 4 +.IX Item "-a" +arc mode; on input \fIand\fR output \fIs12\fR is replaced by \fIa12\fR the arc +length (in degrees) on the auxiliary sphere. See \*(L"\s-1AUXILIARY\s0 \s-1SPHERE\s0\*(R". +.IP "\fB\-e\fR" 4 +.IX Item "-e" +specify the ellipsoid via \fIa\fR \fIf\fR; the equatorial radius is \fIa\fR and +the flattening is \fIf\fR. Setting \fIf\fR = 0 results in a sphere. Specify +\&\fIf\fR < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, +is allowed for \fIf\fR. (Also, if \fIf\fR > 1, the flattening is set to +1/\fIf\fR.) By default, the \s-1WGS84\s0 ellipsoid is used, \fIa\fR = 6378137 m, +\&\fIf\fR = 1/298.257223563. +.IP "\fB\-d\fR" 4 +.IX Item "-d" +output angles as degrees, minutes, seconds instead of decimal degrees. +.IP "\fB\-:\fR" 4 +.IX Item "-:" +like \fB\-d\fR, except use : as a separator instead of the d, ', and " +delimiters. +.IP "\fB\-b\fR" 4 +.IX Item "-b" +report the \fIback\fR azimuth at point 2 instead of the forward azimuth. +.IP "\fB\-f\fR" 4 +.IX Item "-f" +full output; each line of output consists of 12 quantities: \fIlat1\fR +\&\fIlon1\fR \fIazi1\fR \fIlat2\fR \fIlon2\fR \fIazi2\fR \fIs12\fR \fIa12\fR \fIm12\fR \fIM12\fR +\&\fIM21\fR \fIS12\fR. \fIa12\fR is described in \*(L"\s-1AUXILIARY\s0 \s-1SPHERE\s0\*(R". The four +quantities \fIm12\fR, \fIM12\fR, \fIM21\fR, and \fIS12\fR are described in +\&\*(L"\s-1ADDITIONAL\s0 \s-1QUANTITIES\s0\*(R". +.IP "\fB\-p\fR" 4 +.IX Item "-p" +set the output precision to \fIprec\fR (default 3); \fIprec\fR is the +precision relative to 1 m. See \*(L"\s-1PRECISION\s0\*(R". +.IP "\fB\-E\fR" 4 +.IX Item "-E" +use \*(L"exact\*(R" algorithms (based on elliptic integrals) for the geodesic +calculations. These are more accurate than the (default) series +expansions for |\fIf\fR| > 0.02. +.IP "\fB\-\-comment\-delimiter\fR" 4 +.IX Item "--comment-delimiter" +set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +print version and exit. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +print usage and exit. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +print full documentation and exit. +.IP "\fB\-\-input\-file\fR" 4 +.IX Item "--input-file" +read input from the file \fIinfile\fR instead of from standard input; a file +name of \*(L"\-\*(R" stands for standard input. +.IP "\fB\-\-input\-string\fR" 4 +.IX Item "--input-string" +read input from the string \fIinstring\fR instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in \fIinstring\fR are converted to newlines before the reading begins. +.IP "\fB\-\-line\-separator\fR" 4 +.IX Item "--line-separator" +set the line separator character to \fIlinesep\fR. By default this is a +semicolon. +.IP "\fB\-\-output\-file\fR" 4 +.IX Item "--output-file" +write output to the file \fIoutfile\fR instead of to standard output; a +file name of \*(L"\-\*(R" stands for standard output. +.SH "INPUT" +.IX Header "INPUT" +\&\fBGeodSolve\fR measures all angles in degrees and all lengths (\fIs12\fR) in +meters. On input angles (latitude, longitude, azimuth, arc length) can +be as decimal degrees or degrees (d), minutes ('), seconds (\*(L"). A +decimal point can only appear in the least significant component and the +designator (d, ', or \*(R") for this component is optional; thus \f(CW\*(C`40d30\*(C'\fR, +\&\f(CW\*(C`40d30\*(Aq\*(C'\fR, \f(CW\*(C`40.5d\*(C'\fR, and \f(CW40.5\fR are all equivalent. By default, +latitude precedes longitude for each point; however on input either may +be given first by appending (or prepending) \fIN\fR or \fIS\fR to the latitude +and \fIE\fR or \fIW\fR to the longitude. Azimuths are measured clockwise from +north; however this may be overridden with \fIE\fR or \fIW\fR. +.PP +See the \f(CW\*(C`QUOTING\*(C'\fR section of \fIGeoConvert\fR\|(1) for how to quote the \s-1DMS\s0 +designators ' and ". +.SH "AUXILIARY SPHERE" +.IX Header "AUXILIARY SPHERE" +Geodesics on the ellipsoid can be transferred to the \fIauxiliary sphere\fR +on which the distance is measured in terms of the arc length \fIa12\fR +(measured in degrees) instead of \fIs12\fR. In terms of \fIa12\fR, 180 +degrees is the distance from one equator crossing to the next or from +the minimum latitude to the maximum latitude. Geodesics with \fIa12\fR +> 180 degrees do not correspond to shortest paths. With the \fB\-a\fR +flag, \fIs12\fR (on both input and output) is replaced by \fIa12\fR. The +\&\fB\-a\fR flag does \fInot\fR affect the full output given by the \fB\-f\fR flag +(which always includes both \fIs12\fR and \fIa12\fR). +.SH "ADDITIONAL QUANTITIES" +.IX Header "ADDITIONAL QUANTITIES" +The \fB\-f\fR flag reports four additional quantities. +.PP +The reduced length of the geodesic, \fIm12\fR, is defined such that if the +initial azimuth is perturbed by d\fIazi1\fR (radians) then the second point +is displaced by \fIm12\fR d\fIazi1\fR in the direction perpendicular to the +geodesic. \fIm12\fR is given in meters. On a curved surface the +reduced length obeys a symmetry relation, \fIm12\fR + \fIm21\fR = 0. On a +flat surface, we have \fIm12\fR = \fIs12\fR. +.PP +\&\fIM12\fR and \fIM21\fR are geodesic scales. If two geodesics are parallel at +point 1 and separated by a small distance \fIdt\fR, then they are separated +by a distance \fIM12\fR \fIdt\fR at point 2. \fIM21\fR is defined similarly +(with the geodesics being parallel to one another at point 2). \fIM12\fR +and \fIM21\fR are dimensionless quantities. On a flat surface, we have +\&\fIM12\fR = \fIM21\fR = 1. +.PP +If points 1, 2, and 3 lie on a single geodesic, then the following +addition rules hold, +\&\fIs13\fR = \fIs12\fR + \fIs23\fR, +\&\fIa13\fR = \fIa12\fR + \fIa23\fR, +\&\fIS13\fR = \fIS12\fR + \fIS23\fR, +\&\fIm13\fR = \fIm12\fR \fIM23\fR + \fIm23\fR \fIM21\fR, +\&\fIM13\fR = \fIM12\fR \fIM23\fR \- (1 \- \fIM12\fR \fIM21\fR) \fIm23\fR / \fIm12\fR, and +\&\fIM31\fR = \fIM32\fR \fIM21\fR \- (1 \- \fIM23\fR \fIM32\fR) \fIm12\fR / \fIm23\fR. +.PP +Finally, \fIS12\fR is the area between the geodesic from point 1 to point 2 +and the equator; i.e., it is the area, measured counter-clockwise, of +the geodesic quadrilateral with corners (\fIlat1\fR,\fIlon1\fR), (0,\fIlon1\fR), +(0,\fIlon2\fR), and (\fIlat2\fR,\fIlon2\fR). It is given in meters^2. +.SH "PRECISION" +.IX Header "PRECISION" +\&\fIprec\fR gives precision of the output with \fIprec\fR = 0 giving 1 m +precision, \fIprec\fR = 3 giving 1 mm precision, etc. \fIprec\fR is the +number of digits after the decimal point for lengths. For decimal +degrees, the number of digits after the decimal point is 5 + \fIprec\fR. +For \s-1DMS\s0 (degree, minute, seconds) output, the number of digits after the +decimal point in the seconds component is 1 + \fIprec\fR. The minimum +value of \fIprec\fR is 0 and the maximum is 10. +.SH "ERRORS" +.IX Header "ERRORS" +An illegal line of input will print an error message to standard output +beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGeodSolve\fR to return an exit code +of 1. However, an error does not cause \fBGeodSolve\fR to terminate; +following lines will be converted. +.SH "ACCURACY" +.IX Header "ACCURACY" +Using the (default) series solution, GeodSolve is accurate to about 15 +nm (15 nanometers) for the \s-1WGS84\s0 ellipsoid. The approximate maximum +error (expressed as a distance) for an ellipsoid with the same major +radius as the \s-1WGS84\s0 ellipsoid and different values of the flattening is +.PP +.Vb 6 +\& |f| error +\& 0.01 25 nm +\& 0.02 30 nm +\& 0.05 10 um +\& 0.1 1.5 mm +\& 0.2 300 mm +.Ve +.PP +If \fB\-E\fR is specified, GeodSolve is accurate to about 40 nm (40 +nanometers) for the \s-1WGS84\s0 ellipsoid. The approximate maximum error +(expressed as a distance) for an ellipsoid with a quarter meridian of +10000 km and different values of the \fIa/b\fR = 1 \- \fIf\fR is +.PP +.Vb 10 +\& 1\-f error (nm) +\& 1/128 387 +\& 1/64 345 +\& 1/32 269 +\& 1/16 210 +\& 1/8 115 +\& 1/4 69 +\& 1/2 36 +\& 1 15 +\& 2 25 +\& 4 96 +\& 8 318 +\& 16 985 +\& 32 2352 +\& 64 6008 +\& 128 19024 +.Ve +.SH "MULTIPLE SOLUTIONS" +.IX Header "MULTIPLE SOLUTIONS" +The shortest distance returned for the inverse problem is (obviously) +uniquely defined. However, in a few special cases there are multiple +azimuths which yield the same shortest distance. Here is a catalog of +those cases: +.IP "\fIlat1\fR = \-\fIlat2\fR (with neither point at a pole)" 4 +.IX Item "lat1 = -lat2 (with neither point at a pole)" +If \fIazi1\fR = \fIazi2\fR, the geodesic is unique. Otherwise there are two +geodesics and the second one is obtained by setting [\fIazi1\fR,\fIazi2\fR] = +[\fIazi2\fR,\fIazi1\fR], [\fIM12\fR,\fIM21\fR] = [\fIM21\fR,\fIM12\fR], \fIS12\fR = \-\fIS12\fR. +(This occurs when the longitude difference is near +/\-180 for oblate +ellipsoids.) +.IP "\fIlon2\fR = \fIlon1\fR +/\- 180 (with neither point at a pole)" 4 +.IX Item "lon2 = lon1 +/- 180 (with neither point at a pole)" +If \fIazi1\fR = 0 or +/\-180, the geodesic is unique. Otherwise there are +two geodesics and the second one is obtained by setting +[\fIazi1\fR,\fIazi2\fR] = [\-\fIazi1\fR,\-\fIazi2\fR], \fIS12\fR = \-\fIS12\fR. (This occurs +when \fIlat2\fR is near \-\fIlat1\fR for prolate ellipsoids.) +.IP "Points 1 and 2 at opposite poles" 4 +.IX Item "Points 1 and 2 at opposite poles" +There are infinitely many geodesics which can be generated by setting +[\fIazi1\fR,\fIazi2\fR] = [\fIazi1\fR,\fIazi2\fR] + [\fId\fR,\-\fId\fR], for arbitrary +\&\fId\fR. (For spheres, this prescription applies when points 1 and 2 are +antipodal.) +.IP "\fIs12\fR = 0 (coincident points)" 4 +.IX Item "s12 = 0 (coincident points)" +There are infinitely many geodesics which can be generated by setting +[\fIazi1\fR,\fIazi2\fR] = [\fIazi1\fR,\fIazi2\fR] + [\fId\fR,\fId\fR], for arbitrary \fId\fR. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +Route from \s-1JFK\s0 Airport to Singapore Changi Airport: +.PP +.Vb 2 +\& echo 40:38:23N 073:46:44W 01:21:33N 103:59:22E | +\& GeodSolve \-i \-: \-p 0 +\& +\& 003:18:29.9 177:29:09.2 15347628 +.Ve +.PP +Waypoints on the route at intervals of 2000km: +.PP +.Vb 2 +\& for ((i = 0; i <= 16; i += 2)); do echo ${i}000000;done | +\& GeodSolve \-l 40:38:23N 073:46:44W 003:18:29.9 \-: \-p 0 +\& +\& 40:38:23.0N 073:46:44.0W 003:18:29.9 +\& 58:34:45.1N 071:49:36.7W 004:48:48.8 +\& 76:22:28.4N 065:32:17.8W 010:41:38.4 +\& 84:50:28.0N 075:04:39.2E 150:55:00.9 +\& 67:26:20.3N 098:00:51.2E 173:27:20.3 +\& 49:33:03.2N 101:06:52.6E 176:07:54.3 +\& 31:34:16.5N 102:30:46.3E 177:03:08.4 +\& 13:31:56.0N 103:26:50.7E 177:24:55.0 +\& 04:32:05.7S 104:14:48.7E 177:28:43.6 +.Ve +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fIGeoConvert\fR\|(1). The algorithms are described in C. F. F. Karney, +\&\fIAlgorithms for geodesics\fR, J. Geodesy 87, 43\-55 (2013); \s-1DOI:\s0 +http://dx.doi.org/10.1007/s00190\-012\-0578\-z ; +addenda: http://geographiclib.sf.net/geod\-addenda.html . +The wikipedia page, Geodesics on an ellipsoid, +. +.SH "AUTHOR" +.IX Header "AUTHOR" +\&\fBGeodSolve\fR was written by Charles Karney. +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBGeodSolve\fR was added to GeographicLib, , +in 2009\-03. Prior to version 1.30, it was called \fBGeod\fR. (The name +was changed to avoid a conflict with the \fBgeod\fR utility in \fIproj.4\fR.) diff --git a/gtsam/3rdparty/GeographicLib/man/GeodSolve.1.html b/gtsam/3rdparty/GeographicLib/man/GeodSolve.1.html new file mode 100644 index 000000000..262bccf3b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeodSolve.1.html @@ -0,0 +1,288 @@ + + + + + + + + + + + + + +

NAME

+ +

GeodSolve -- perform geodesic calculations

+ +

SYNOPSIS

+ +

GeodSolve [ -i | -l lat1 lon1 azi1 ] [ -a ] [ -e a f ] [ -d | -: ] [ -b ] [ -f ] [ -p prec ] [ -E ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]

+ +

DESCRIPTION

+ +

The shortest path between two points on the ellipsoid at (lat1, lon1) and (lat2, lon2) is called the geodesic. Its length is s12 and the geodesic from point 1 to point 2 has forward azimuths azi1 and azi2 at the two end points.

+ +

GeodSolve operates in one of three modes:

+ +
    + +
  1. By default, GeodSolve accepts lines on the standard input containing lat1 lon1 azi1 s12 and prints lat2 lon2 azi2 on standard output. This is the direct geodesic calculation.

    + +
  2. +
  3. Command line arguments -l lat1 lon1 azi1 specify a geodesic line. GeodSolve then accepts a sequence of s12 values (one per line) on standard input and prints lat2 lon2 azi2 for each. This generates a sequence of points on a single geodesic.

    + +
  4. +
  5. With the -i command line argument, GeodSolve performs the inverse geodesic calculation. It reads lines containing lat1 lon1 lat2 lon2 and prints the corresponding values of azi1 azi2 s12.

    + +
  6. +
+ +

OPTIONS

+ +
+ +

INPUT

+ +

GeodSolve measures all angles in degrees and all lengths (s12) in meters. On input angles (latitude, longitude, azimuth, arc length) can be as decimal degrees or degrees (d), minutes ('), seconds ("). A decimal point can only appear in the least significant component and the designator (d, ', or ") for this component is optional; thus 40d30, 40d30', 40.5d, and 40.5 are all equivalent. By default, latitude precedes longitude for each point; however on input either may be given first by appending (or prepending) N or S to the latitude and E or W to the longitude. Azimuths are measured clockwise from north; however this may be overridden with E or W.

+ +

See the QUOTING section of GeoConvert(1) for how to quote the DMS designators ' and ".

+ +

AUXILIARY SPHERE

+ +

Geodesics on the ellipsoid can be transferred to the auxiliary sphere on which the distance is measured in terms of the arc length a12 (measured in degrees) instead of s12. In terms of a12, 180 degrees is the distance from one equator crossing to the next or from the minimum latitude to the maximum latitude. Geodesics with a12 > 180 degrees do not correspond to shortest paths. With the -a flag, s12 (on both input and output) is replaced by a12. The -a flag does not affect the full output given by the -f flag (which always includes both s12 and a12).

+ +

ADDITIONAL QUANTITIES

+ +

The -f flag reports four additional quantities.

+ +

The reduced length of the geodesic, m12, is defined such that if the initial azimuth is perturbed by dazi1 (radians) then the second point is displaced by m12 dazi1 in the direction perpendicular to the geodesic. m12 is given in meters. On a curved surface the reduced length obeys a symmetry relation, m12 + m21 = 0. On a flat surface, we have m12 = s12.

+ +

M12 and M21 are geodesic scales. If two geodesics are parallel at point 1 and separated by a small distance dt, then they are separated by a distance M12 dt at point 2. M21 is defined similarly (with the geodesics being parallel to one another at point 2). M12 and M21 are dimensionless quantities. On a flat surface, we have M12 = M21 = 1.

+ +

If points 1, 2, and 3 lie on a single geodesic, then the following addition rules hold, s13 = s12 + s23, a13 = a12 + a23, S13 = S12 + S23, m13 = m12 M23 + m23 M21, M13 = M12 M23 - (1 - M12 M21) m23 / m12, and M31 = M32 M21 - (1 - M23 M32) m12 / m23.

+ +

Finally, S12 is the area between the geodesic from point 1 to point 2 and the equator; i.e., it is the area, measured counter-clockwise, of the geodesic quadrilateral with corners (lat1,lon1), (0,lon1), (0,lon2), and (lat2,lon2). It is given in meters^2.

+ +

PRECISION

+ +

prec gives precision of the output with prec = 0 giving 1 m precision, prec = 3 giving 1 mm precision, etc. prec is the number of digits after the decimal point for lengths. For decimal degrees, the number of digits after the decimal point is 5 + prec. For DMS (degree, minute, seconds) output, the number of digits after the decimal point in the seconds component is 1 + prec. The minimum value of prec is 0 and the maximum is 10.

+ +

ERRORS

+ +

An illegal line of input will print an error message to standard output beginning with ERROR: and causes GeodSolve to return an exit code of 1. However, an error does not cause GeodSolve to terminate; following lines will be converted.

+ +

ACCURACY

+ +

Using the (default) series solution, GeodSolve is accurate to about 15 nm (15 nanometers) for the WGS84 ellipsoid. The approximate maximum error (expressed as a distance) for an ellipsoid with the same major radius as the WGS84 ellipsoid and different values of the flattening is

+ +
   |f|     error
+   0.01    25 nm
+   0.02    30 nm
+   0.05    10 um
+   0.1    1.5 mm
+   0.2    300 mm
+ +

If -E is specified, GeodSolve is accurate to about 40 nm (40 nanometers) for the WGS84 ellipsoid. The approximate maximum error (expressed as a distance) for an ellipsoid with a quarter meridian of 10000 km and different values of the a/b = 1 - f is

+ +
   1-f    error (nm)
+   1/128   387
+   1/64    345
+   1/32    269
+   1/16    210
+   1/8     115
+   1/4      69
+   1/2      36
+     1      15
+     2      25
+     4      96
+     8     318
+    16     985
+    32    2352
+    64    6008
+   128   19024
+ +

MULTIPLE SOLUTIONS

+ +

The shortest distance returned for the inverse problem is (obviously) uniquely defined. However, in a few special cases there are multiple azimuths which yield the same shortest distance. Here is a catalog of those cases:

+ +
+ +
lat1 = -lat2 (with neither point at a pole)
+
+ +

If azi1 = azi2, the geodesic is unique. Otherwise there are two geodesics and the second one is obtained by setting [azi1,azi2] = [azi2,azi1], [M12,M21] = [M21,M12], S12 = -S12. (This occurs when the longitude difference is near +/-180 for oblate ellipsoids.)

+ +
+
lon2 = lon1 +/- 180 (with neither point at a pole)
+
+ +

If azi1 = 0 or +/-180, the geodesic is unique. Otherwise there are two geodesics and the second one is obtained by setting [azi1,azi2] = [-azi1,-azi2], S12 = -S12. (This occurs when lat2 is near -lat1 for prolate ellipsoids.)

+ +
+
Points 1 and 2 at opposite poles
+
+ +

There are infinitely many geodesics which can be generated by setting [azi1,azi2] = [azi1,azi2] + [d,-d], for arbitrary d. (For spheres, this prescription applies when points 1 and 2 are antipodal.)

+ +
+
s12 = 0 (coincident points)
+
+ +

There are infinitely many geodesics which can be generated by setting [azi1,azi2] = [azi1,azi2] + [d,d], for arbitrary d.

+ +
+
+ +

EXAMPLES

+ +

Route from JFK Airport to Singapore Changi Airport:

+ +
   echo 40:38:23N 073:46:44W 01:21:33N 103:59:22E |
+   GeodSolve -i -: -p 0
+
+   003:18:29.9 177:29:09.2 15347628
+ +

Waypoints on the route at intervals of 2000km:

+ +
   for ((i = 0; i <= 16; i += 2)); do echo ${i}000000;done |
+   GeodSolve -l 40:38:23N 073:46:44W 003:18:29.9 -: -p 0
+
+   40:38:23.0N 073:46:44.0W 003:18:29.9
+   58:34:45.1N 071:49:36.7W 004:48:48.8
+   76:22:28.4N 065:32:17.8W 010:41:38.4
+   84:50:28.0N 075:04:39.2E 150:55:00.9
+   67:26:20.3N 098:00:51.2E 173:27:20.3
+   49:33:03.2N 101:06:52.6E 176:07:54.3
+   31:34:16.5N 102:30:46.3E 177:03:08.4
+   13:31:56.0N 103:26:50.7E 177:24:55.0
+   04:32:05.7S 104:14:48.7E 177:28:43.6
+ +

SEE ALSO

+ +

GeoConvert(1). The algorithms are described in C. F. F. Karney, Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); DOI: http://dx.doi.org/10.1007/s00190-012-0578-z; addenda: http://geographiclib.sf.net/geod-addenda.html. The wikipedia page, Geodesics on an ellipsoid, http://en.wikipedia.org/wiki/Geodesics_on_an_ellipsoid.

+ +

AUTHOR

+ +

GeodSolve was written by Charles Karney.

+ +

HISTORY

+ +

GeodSolve was added to GeographicLib, http://geographiclib.sf.net, in 2009-03. Prior to version 1.30, it was called Geod. (The name was changed to avoid a conflict with the geod utility in proj.4.)

+ + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/man/GeodSolve.pod b/gtsam/3rdparty/GeographicLib/man/GeodSolve.pod new file mode 100644 index 000000000..1159b108d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeodSolve.pod @@ -0,0 +1,342 @@ +=head1 NAME + +GeodSolve -- perform geodesic calculations + +=head1 SYNOPSIS + +B [ B<-i> | B<-l> I I I ] [ B<-a> ] +[ B<-e> I I ] +[ B<-d> | B<-:> ] [ B<-b> ] [ B<-f> ] [ B<-p> I ] [ B<-E> ] +[ B<--comment-delimiter> I ] +[ B<--version> | B<-h> | B<--help> ] +[ B<--input-file> I | B<--input-string> I ] +[ B<--line-separator> I ] +[ B<--output-file> I ] + +=head1 DESCRIPTION + +The shortest path between two points on the ellipsoid at (I, +I) and (I, I) is called the geodesic. Its length is +I and the geodesic from point 1 to point 2 has forward azimuths +I and I at the two end points. + +B operates in one of three modes: + +=over + +=item 1. + +By default, B accepts lines on the standard input containing +I I I I and prints I I I +on standard output. This is the direct geodesic calculation. + +=item 2. + +Command line arguments B<-l> I I I specify a geodesic +line. B then accepts a sequence of I values (one per +line) on standard input and prints I I I for each. +This generates a sequence of points on a single geodesic. + +=item 3. + +With the B<-i> command line argument, B performs the inverse +geodesic calculation. It reads lines containing I I I +I and prints the corresponding values of I I I. + +=back + +=head1 OPTIONS + +=over + +=item B<-i> + +perform an inverse geodesic calculation (see 3 above). + +=item B<-l> + +line mode (see 2 above); generate a sequence of points along the +geodesic specified by I I I. + +=item B<-a> + +arc mode; on input I output I is replaced by I the arc +length (in degrees) on the auxiliary sphere. See L. + +=item B<-e> + +specify the ellipsoid via I I; the equatorial radius is I and +the flattening is I. Setting I = 0 results in a sphere. Specify +I E 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, +is allowed for I. (Also, if I E 1, the flattening is set to +1/I.) By default, the WGS84 ellipsoid is used, I = 6378137 m, +I = 1/298.257223563. + +=item B<-d> + +output angles as degrees, minutes, seconds instead of decimal degrees. + +=item B<-:> + +like B<-d>, except use : as a separator instead of the d, ', and " +delimiters. + +=item B<-b> + +report the I azimuth at point 2 instead of the forward azimuth. + +=item B<-f> + +full output; each line of output consists of 12 quantities: I +I I I I I I I I I +I I. I is described in L. The four +quantities I, I, I, and I are described in +L. + +=item B<-p> + +set the output precision to I (default 3); I is the +precision relative to 1 m. See L. + +=item B<-E> + +use "exact" algorithms (based on elliptic integrals) for the geodesic +calculations. These are more accurate than the (default) series +expansions for |I| > 0.02. + +=item B<--comment-delimiter> + +set the comment delimiter to I (e.g., "#" or "//"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). + +=item B<--version> + +print version and exit. + +=item B<-h> + +print usage and exit. + +=item B<--help> + +print full documentation and exit. + +=item B<--input-file> + +read input from the file I instead of from standard input; a file +name of "-" stands for standard input. + +=item B<--input-string> + +read input from the string I instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in I are converted to newlines before the reading begins. + +=item B<--line-separator> + +set the line separator character to I. By default this is a +semicolon. + +=item B<--output-file> + +write output to the file I instead of to standard output; a +file name of "-" stands for standard output. + +=back + +=head1 INPUT + +B measures all angles in degrees and all lengths (I) in +meters. On input angles (latitude, longitude, azimuth, arc length) can +be as decimal degrees or degrees (d), minutes ('), seconds ("). A +decimal point can only appear in the least significant component and the +designator (d, ', or ") for this component is optional; thus C<40d30>, +C<40d30'>, C<40.5d>, and C<40.5> are all equivalent. By default, +latitude precedes longitude for each point; however on input either may +be given first by appending (or prepending) I or I to the latitude +and I or I to the longitude. Azimuths are measured clockwise from +north; however this may be overridden with I or I. + +See the C section of GeoConvert(1) for how to quote the DMS +designators ' and ". + +=head1 AUXILIARY SPHERE + +Geodesics on the ellipsoid can be transferred to the I +on which the distance is measured in terms of the arc length I +(measured in degrees) instead of I. In terms of I, 180 +degrees is the distance from one equator crossing to the next or from +the minimum latitude to the maximum latitude. Geodesics with I +E 180 degrees do not correspond to shortest paths. With the B<-a> +flag, I (on both input and output) is replaced by I. The +B<-a> flag does I affect the full output given by the B<-f> flag +(which always includes both I and I). + +=head1 ADDITIONAL QUANTITIES + +The B<-f> flag reports four additional quantities. + +The reduced length of the geodesic, I, is defined such that if the +initial azimuth is perturbed by dI (radians) then the second point +is displaced by I dI in the direction perpendicular to the +geodesic. I is given in meters. On a curved surface the +reduced length obeys a symmetry relation, I + I = 0. On a +flat surface, we have I = I. + +I and I are geodesic scales. If two geodesics are parallel at +point 1 and separated by a small distance I
, then they are separated +by a distance I I
at point 2. I is defined similarly +(with the geodesics being parallel to one another at point 2). I +and I are dimensionless quantities. On a flat surface, we have +I = I = 1. + +If points 1, 2, and 3 lie on a single geodesic, then the following +addition rules hold, +I = I + I, +I = I + I, +I = I + I, +I = I I + I I, +I = I I - (1 - I I) I / I, and +I = I I - (1 - I I) I / I. + +Finally, I is the area between the geodesic from point 1 to point 2 +and the equator; i.e., it is the area, measured counter-clockwise, of +the geodesic quadrilateral with corners (I,I), (0,I), +(0,I), and (I,I). It is given in meters^2. + +=head1 PRECISION + +I gives precision of the output with I = 0 giving 1 m +precision, I = 3 giving 1 mm precision, etc. I is the +number of digits after the decimal point for lengths. For decimal +degrees, the number of digits after the decimal point is 5 + I. +For DMS (degree, minute, seconds) output, the number of digits after the +decimal point in the seconds component is 1 + I. The minimum +value of I is 0 and the maximum is 10. + +=head1 ERRORS + +An illegal line of input will print an error message to standard output +beginning with C and causes B to return an exit code +of 1. However, an error does not cause B to terminate; +following lines will be converted. + +=head1 ACCURACY + +Using the (default) series solution, GeodSolve is accurate to about 15 +nm (15 nanometers) for the WGS84 ellipsoid. The approximate maximum +error (expressed as a distance) for an ellipsoid with the same major +radius as the WGS84 ellipsoid and different values of the flattening is + + |f| error + 0.01 25 nm + 0.02 30 nm + 0.05 10 um + 0.1 1.5 mm + 0.2 300 mm + +If B<-E> is specified, GeodSolve is accurate to about 40 nm (40 +nanometers) for the WGS84 ellipsoid. The approximate maximum error +(expressed as a distance) for an ellipsoid with a quarter meridian of +10000 km and different values of the I = 1 - I is + + 1-f error (nm) + 1/128 387 + 1/64 345 + 1/32 269 + 1/16 210 + 1/8 115 + 1/4 69 + 1/2 36 + 1 15 + 2 25 + 4 96 + 8 318 + 16 985 + 32 2352 + 64 6008 + 128 19024 + +=head1 MULTIPLE SOLUTIONS + +The shortest distance returned for the inverse problem is (obviously) +uniquely defined. However, in a few special cases there are multiple +azimuths which yield the same shortest distance. Here is a catalog of +those cases: + +=over + +=item I = -I (with neither point at a pole) + +If I = I, the geodesic is unique. Otherwise there are two +geodesics and the second one is obtained by setting [I,I] = +[I,I], [I,I] = [I,I], I = -I. +(This occurs when the longitude difference is near +/-180 for oblate +ellipsoids.) + +=item I = I +/- 180 (with neither point at a pole) + +If I = 0 or +/-180, the geodesic is unique. Otherwise there are +two geodesics and the second one is obtained by setting +[I,I] = [-I,-I], I = -I. (This occurs +when I is near -I for prolate ellipsoids.) + +=item Points 1 and 2 at opposite poles + +There are infinitely many geodesics which can be generated by setting +[I,I] = [I,I] + [I,-I], for arbitrary +I. (For spheres, this prescription applies when points 1 and 2 are +antipodal.) + +=item I = 0 (coincident points) + +There are infinitely many geodesics which can be generated by setting +[I,I] = [I,I] + [I,I], for arbitrary I. + +=back + +=head1 EXAMPLES + +Route from JFK Airport to Singapore Changi Airport: + + echo 40:38:23N 073:46:44W 01:21:33N 103:59:22E | + GeodSolve -i -: -p 0 + + 003:18:29.9 177:29:09.2 15347628 + +Waypoints on the route at intervals of 2000km: + + for ((i = 0; i <= 16; i += 2)); do echo ${i}000000;done | + GeodSolve -l 40:38:23N 073:46:44W 003:18:29.9 -: -p 0 + + 40:38:23.0N 073:46:44.0W 003:18:29.9 + 58:34:45.1N 071:49:36.7W 004:48:48.8 + 76:22:28.4N 065:32:17.8W 010:41:38.4 + 84:50:28.0N 075:04:39.2E 150:55:00.9 + 67:26:20.3N 098:00:51.2E 173:27:20.3 + 49:33:03.2N 101:06:52.6E 176:07:54.3 + 31:34:16.5N 102:30:46.3E 177:03:08.4 + 13:31:56.0N 103:26:50.7E 177:24:55.0 + 04:32:05.7S 104:14:48.7E 177:28:43.6 + +=head1 SEE ALSO + +GeoConvert(1). The algorithms are described in C. F. F. Karney, +I, J. Geodesy 87, 43-55 (2013); DOI: +L; +addenda: L. +The wikipedia page, Geodesics on an ellipsoid, +L. + +=head1 AUTHOR + +B was written by Charles Karney. + +=head1 HISTORY + +B was added to GeographicLib, L, +in 2009-03. Prior to version 1.30, it was called B. (The name +was changed to avoid a conflict with the B utility in I.) diff --git a/gtsam/3rdparty/GeographicLib/man/GeodSolve.usage b/gtsam/3rdparty/GeographicLib/man/GeodSolve.usage new file mode 100644 index 000000000..48bc7261e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeodSolve.usage @@ -0,0 +1,285 @@ +int usage(int retval, bool brief) { + if (brief) + ( retval ? std::cerr : std::cout ) << "Usage:\n" +" GeodSolve [ -i | -l lat1 lon1 azi1 ] [ -a ] [ -e a f ] [ -d | -: ] [ -b\n" +" ] [ -f ] [ -p prec ] [ -E ] [ --comment-delimiter commentdelim ] [\n" +" --version | -h | --help ] [ --input-file infile | --input-string\n" +" instring ] [ --line-separator linesep ] [ --output-file outfile ]\n" +"\n" +"For full documentation type:\n" +" GeodSolve --help\n" +"or visit:\n" +" http://geographiclib.sf.net/1.34/GeodSolve.1.html\n"; + else + ( retval ? std::cerr : std::cout ) << "Man page:\n" +"NAME\n" +" GeodSolve -- perform geodesic calculations\n" +"\n" +"SYNOPSIS\n" +" GeodSolve [ -i | -l lat1 lon1 azi1 ] [ -a ] [ -e a f ] [ -d | -: ] [ -b\n" +" ] [ -f ] [ -p prec ] [ -E ] [ --comment-delimiter commentdelim ] [\n" +" --version | -h | --help ] [ --input-file infile | --input-string\n" +" instring ] [ --line-separator linesep ] [ --output-file outfile ]\n" +"\n" +"DESCRIPTION\n" +" The shortest path between two points on the ellipsoid at (lat1, lon1)\n" +" and (lat2, lon2) is called the geodesic. Its length is s12 and the\n" +" geodesic from point 1 to point 2 has forward azimuths azi1 and azi2 at\n" +" the two end points.\n" +"\n" +" GeodSolve operates in one of three modes:\n" +"\n" +" 1. By default, GeodSolve accepts lines on the standard input\n" +" containing lat1 lon1 azi1 s12 and prints lat2 lon2 azi2 on standard\n" +" output. This is the direct geodesic calculation.\n" +"\n" +" 2. Command line arguments -l lat1 lon1 azi1 specify a geodesic line.\n" +" GeodSolve then accepts a sequence of s12 values (one per line) on\n" +" standard input and prints lat2 lon2 azi2 for each. This generates\n" +" a sequence of points on a single geodesic.\n" +"\n" +" 3. With the -i command line argument, GeodSolve performs the inverse\n" +" geodesic calculation. It reads lines containing lat1 lon1 lat2\n" +" lon2 and prints the corresponding values of azi1 azi2 s12.\n" +"\n" +"OPTIONS\n" +" -i perform an inverse geodesic calculation (see 3 above).\n" +"\n" +" -l line mode (see 2 above); generate a sequence of points along the\n" +" geodesic specified by lat1 lon1 azi1.\n" +"\n" +" -a arc mode; on input and output s12 is replaced by a12 the arc length\n" +" (in degrees) on the auxiliary sphere. See \"AUXILIARY SPHERE\".\n" +"\n" +" -e specify the ellipsoid via a f; the equatorial radius is a and the\n" +" flattening is f. Setting f = 0 results in a sphere. Specify f < 0\n" +" for a prolate ellipsoid. A simple fraction, e.g., 1/297, is\n" +" allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By\n" +" default, the WGS84 ellipsoid is used, a = 6378137 m, f =\n" +" 1/298.257223563.\n" +"\n" +" -d output angles as degrees, minutes, seconds instead of decimal\n" +" degrees.\n" +"\n" +" -: like -d, except use : as a separator instead of the d, ', and \"\n" +" delimiters.\n" +"\n" +" -b report the back azimuth at point 2 instead of the forward azimuth.\n" +"\n" +" -f full output; each line of output consists of 12 quantities: lat1\n" +" lon1 azi1 lat2 lon2 azi2 s12 a12 m12 M12 M21 S12. a12 is described\n" +" in \"AUXILIARY SPHERE\". The four quantities m12, M12, M21, and S12\n" +" are described in \"ADDITIONAL QUANTITIES\".\n" +"\n" +" -p set the output precision to prec (default 3); prec is the precision\n" +" relative to 1 m. See \"PRECISION\".\n" +"\n" +" -E use \"exact\" algorithms (based on elliptic integrals) for the\n" +" geodesic calculations. These are more accurate than the (default)\n" +" series expansions for |f| > 0.02.\n" +"\n" +" --comment-delimiter\n" +" set the comment delimiter to commentdelim (e.g., \"#\" or \"//\"). If\n" +" set, the input lines will be scanned for this delimiter and, if\n" +" found, the delimiter and the rest of the line will be removed prior\n" +" to processing and subsequently appended to the output line\n" +" (separated by a space).\n" +"\n" +" --version\n" +" print version and exit.\n" +"\n" +" -h print usage and exit.\n" +"\n" +" --help\n" +" print full documentation and exit.\n" +"\n" +" --input-file\n" +" read input from the file infile instead of from standard input; a\n" +" file name of \"-\" stands for standard input.\n" +"\n" +" --input-string\n" +" read input from the string instring instead of from standard input.\n" +" All occurrences of the line separator character (default is a\n" +" semicolon) in instring are converted to newlines before the reading\n" +" begins.\n" +"\n" +" --line-separator\n" +" set the line separator character to linesep. By default this is a\n" +" semicolon.\n" +"\n" +" --output-file\n" +" write output to the file outfile instead of to standard output; a\n" +" file name of \"-\" stands for standard output.\n" +"\n" +"INPUT\n" +" GeodSolve measures all angles in degrees and all lengths (s12) in\n" +" meters. On input angles (latitude, longitude, azimuth, arc length) can\n" +" be as decimal degrees or degrees (d), minutes ('), seconds (\"). A\n" +" decimal point can only appear in the least significant component and\n" +" the designator (d, ', or \") for this component is optional; thus\n" +" \"40d30\", \"40d30'\", \"40.5d\", and 40.5 are all equivalent. By default,\n" +" latitude precedes longitude for each point; however on input either may\n" +" be given first by appending (or prepending) N or S to the latitude and\n" +" E or W to the longitude. Azimuths are measured clockwise from north;\n" +" however this may be overridden with E or W.\n" +"\n" +" See the \"QUOTING\" section of GeoConvert(1) for how to quote the DMS\n" +" designators ' and \".\n" +"\n" +"AUXILIARY SPHERE\n" +" Geodesics on the ellipsoid can be transferred to the auxiliary sphere\n" +" on which the distance is measured in terms of the arc length a12\n" +" (measured in degrees) instead of s12. In terms of a12, 180 degrees is\n" +" the distance from one equator crossing to the next or from the minimum\n" +" latitude to the maximum latitude. Geodesics with a12 > 180 degrees do\n" +" not correspond to shortest paths. With the -a flag, s12 (on both input\n" +" and output) is replaced by a12. The -a flag does not affect the full\n" +" output given by the -f flag (which always includes both s12 and a12).\n" +"\n" +"ADDITIONAL QUANTITIES\n" +" The -f flag reports four additional quantities.\n" +"\n" +" The reduced length of the geodesic, m12, is defined such that if the\n" +" initial azimuth is perturbed by dazi1 (radians) then the second point\n" +" is displaced by m12 dazi1 in the direction perpendicular to the\n" +" geodesic. m12 is given in meters. On a curved surface the reduced\n" +" length obeys a symmetry relation, m12 + m21 = 0. On a flat surface, we\n" +" have m12 = s12.\n" +"\n" +" M12 and M21 are geodesic scales. If two geodesics are parallel at\n" +" point 1 and separated by a small distance dt, then they are separated\n" +" by a distance M12 dt at point 2. M21 is defined similarly (with the\n" +" geodesics being parallel to one another at point 2). M12 and M21 are\n" +" dimensionless quantities. On a flat surface, we have M12 = M21 = 1.\n" +"\n" +" If points 1, 2, and 3 lie on a single geodesic, then the following\n" +" addition rules hold, s13 = s12 + s23, a13 = a12 + a23, S13 = S12 + S23,\n" +" m13 = m12 M23 + m23 M21, M13 = M12 M23 - (1 - M12 M21) m23 / m12, and\n" +" M31 = M32 M21 - (1 - M23 M32) m12 / m23.\n" +"\n" +" Finally, S12 is the area between the geodesic from point 1 to point 2\n" +" and the equator; i.e., it is the area, measured counter-clockwise, of\n" +" the geodesic quadrilateral with corners (lat1,lon1), (0,lon1),\n" +" (0,lon2), and (lat2,lon2). It is given in meters^2.\n" +"\n" +"PRECISION\n" +" prec gives precision of the output with prec = 0 giving 1 m precision,\n" +" prec = 3 giving 1 mm precision, etc. prec is the number of digits\n" +" after the decimal point for lengths. For decimal degrees, the number\n" +" of digits after the decimal point is 5 + prec. For DMS (degree,\n" +" minute, seconds) output, the number of digits after the decimal point\n" +" in the seconds component is 1 + prec. The minimum value of prec is 0\n" +" and the maximum is 10.\n" +"\n" +"ERRORS\n" +" An illegal line of input will print an error message to standard output\n" +" beginning with \"ERROR:\" and causes GeodSolve to return an exit code of\n" +" 1. However, an error does not cause GeodSolve to terminate; following\n" +" lines will be converted.\n" +"\n" +"ACCURACY\n" +" Using the (default) series solution, GeodSolve is accurate to about 15\n" +" nm (15 nanometers) for the WGS84 ellipsoid. The approximate maximum\n" +" error (expressed as a distance) for an ellipsoid with the same major\n" +" radius as the WGS84 ellipsoid and different values of the flattening is\n" +"\n" +" |f| error\n" +" 0.01 25 nm\n" +" 0.02 30 nm\n" +" 0.05 10 um\n" +" 0.1 1.5 mm\n" +" 0.2 300 mm\n" +"\n" +" If -E is specified, GeodSolve is accurate to about 40 nm (40\n" +" nanometers) for the WGS84 ellipsoid. The approximate maximum error\n" +" (expressed as a distance) for an ellipsoid with a quarter meridian of\n" +" 10000 km and different values of the a/b = 1 - f is\n" +"\n" +" 1-f error (nm)\n" +" 1/128 387\n" +" 1/64 345\n" +" 1/32 269\n" +" 1/16 210\n" +" 1/8 115\n" +" 1/4 69\n" +" 1/2 36\n" +" 1 15\n" +" 2 25\n" +" 4 96\n" +" 8 318\n" +" 16 985\n" +" 32 2352\n" +" 64 6008\n" +" 128 19024\n" +"\n" +"MULTIPLE SOLUTIONS\n" +" The shortest distance returned for the inverse problem is (obviously)\n" +" uniquely defined. However, in a few special cases there are multiple\n" +" azimuths which yield the same shortest distance. Here is a catalog of\n" +" those cases:\n" +"\n" +" lat1 = -lat2 (with neither point at a pole)\n" +" If azi1 = azi2, the geodesic is unique. Otherwise there are two\n" +" geodesics and the second one is obtained by setting [azi1,azi2] =\n" +" [azi2,azi1], [M12,M21] = [M21,M12], S12 = -S12. (This occurs when\n" +" the longitude difference is near +/-180 for oblate ellipsoids.)\n" +"\n" +" lon2 = lon1 +/- 180 (with neither point at a pole)\n" +" If azi1 = 0 or +/-180, the geodesic is unique. Otherwise there are\n" +" two geodesics and the second one is obtained by setting [azi1,azi2]\n" +" = [-azi1,-azi2], S12 = -S12. (This occurs when lat2 is near -lat1\n" +" for prolate ellipsoids.)\n" +"\n" +" Points 1 and 2 at opposite poles\n" +" There are infinitely many geodesics which can be generated by\n" +" setting [azi1,azi2] = [azi1,azi2] + [d,-d], for arbitrary d. (For\n" +" spheres, this prescription applies when points 1 and 2 are\n" +" antipodal.)\n" +"\n" +" s12 = 0 (coincident points)\n" +" There are infinitely many geodesics which can be generated by\n" +" setting [azi1,azi2] = [azi1,azi2] + [d,d], for arbitrary d.\n" +"\n" +"EXAMPLES\n" +" Route from JFK Airport to Singapore Changi Airport:\n" +"\n" +" echo 40:38:23N 073:46:44W 01:21:33N 103:59:22E |\n" +" GeodSolve -i -: -p 0\n" +"\n" +" 003:18:29.9 177:29:09.2 15347628\n" +"\n" +" Waypoints on the route at intervals of 2000km:\n" +"\n" +" for ((i = 0; i <= 16; i += 2)); do echo ${i}000000;done |\n" +" GeodSolve -l 40:38:23N 073:46:44W 003:18:29.9 -: -p 0\n" +"\n" +" 40:38:23.0N 073:46:44.0W 003:18:29.9\n" +" 58:34:45.1N 071:49:36.7W 004:48:48.8\n" +" 76:22:28.4N 065:32:17.8W 010:41:38.4\n" +" 84:50:28.0N 075:04:39.2E 150:55:00.9\n" +" 67:26:20.3N 098:00:51.2E 173:27:20.3\n" +" 49:33:03.2N 101:06:52.6E 176:07:54.3\n" +" 31:34:16.5N 102:30:46.3E 177:03:08.4\n" +" 13:31:56.0N 103:26:50.7E 177:24:55.0\n" +" 04:32:05.7S 104:14:48.7E 177:28:43.6\n" +"\n" +"SEE ALSO\n" +" GeoConvert(1). The algorithms are described in C. F. F. Karney,\n" +" Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); DOI:\n" +" http://dx.doi.org/10.1007/s00190-012-0578-z\n" +" ; addenda:\n" +" http://geographiclib.sf.net/geod-addenda.html\n" +" . The wikipedia page,\n" +" Geodesics on an ellipsoid,\n" +" .\n" +"\n" +"AUTHOR\n" +" GeodSolve was written by Charles Karney.\n" +"\n" +"HISTORY\n" +" GeodSolve was added to GeographicLib, , in\n" +" 2009-03. Prior to version 1.30, it was called Geod. (The name was\n" +" changed to avoid a conflict with the geod utility in proj.4.)\n" +; + return retval; +} diff --git a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1 b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1 new file mode 100644 index 000000000..a4cc6680e --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1 @@ -0,0 +1,251 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "GEODESICPROJ 1" +.TH GEODESICPROJ 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +GeodesicProj \-\- perform projections based on geodesics +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBGeodesicProj\fR ( \fB\-z\fR | \fB\-c\fR | \fB\-g\fR ) \fIlat0\fR \fIlon0\fR [ \fB\-r\fR ] +[ \fB\-e\fR \fIa\fR \fIf\fR ] +[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] +[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] +[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] +[ \fB\-\-line\-separator\fR \fIlinesep\fR ] +[ \fB\-\-output\-file\fR \fIoutfile\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +Perform projections based on geodesics. Convert geodetic coordinates to +either azimuthal equidistant, Cassini-Soldner, or gnomonic coordinates. +The center of the projection (\fIlat0\fR, \fIlon0\fR) is specified by either the \fB\-c\fR +option (for Cassini-Soldner), the \fB\-z\fR option (for azimuthal equidistant), +or the \fB\-g\fR option (for gnomonic). At least one of these options must be +given (the last one given is used). +.PP +Geodetic coordinates are provided on standard input as a set of lines +containing (blank separated) \fIlatitude\fR and \fIlongitude\fR (decimal +degrees or degrees, minutes, seconds). For each set of geodetic +coordinates, the corresponding projected coordinates \fIx\fR, \fIy\fR (meters) +are printed on standard output together with the azimuth \fIazi\fR +(degrees) and reciprocal scale \fIrk\fR. For Cassini-Soldner, \fIazi\fR is +the bearing of the easting direction and the scale in the easting +direction is 1 and the scale in the northing direction is 1/\fIrk\fR. For +azimuthal equidistant and gnomonic, \fIazi\fR is the bearing of the radial +direction and the scale in the azimuthal direction is 1/\fIrk\fR. For +azimuthal equidistant and gnomonic, the scales in the radial direction +are 1 and 1/\fIrk\fR^2, respectively. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-z\fR" 4 +.IX Item "-z" +use the azimuthal equidistant projection centered at latitude = \fIlat0\fR, +longitude = \fIlon0\fR. +.IP "\fB\-c\fR" 4 +.IX Item "-c" +use the Cassini-Soldner projection centered at latitude = \fIlat0\fR, +longitude = \fIlon0\fR. +.IP "\fB\-g\fR" 4 +.IX Item "-g" +use the ellipsoidal gnomonic projection centered at latitude = \fIlat0\fR, +longitude = \fIlon0\fR. +.IP "\fB\-r\fR" 4 +.IX Item "-r" +perform the reverse projection. \fIx\fR and \fIy\fR are given on standard +input and each line of standard output gives \fIlatitude\fR, \fIlongitude\fR, +\&\fIazi\fR, and \fIrk\fR. +.IP "\fB\-e\fR" 4 +.IX Item "-e" +specify the ellipsoid via \fIa\fR \fIf\fR; the equatorial radius is \fIa\fR and +the flattening is \fIf\fR. Setting \fIf\fR = 0 results in a sphere. Specify +\&\fIf\fR < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, +is allowed for \fIf\fR. (Also, if \fIf\fR > 1, the flattening is set to +1/\fIf\fR.) By default, the \s-1WGS84\s0 ellipsoid is used, \fIa\fR = 6378137 m, +\&\fIf\fR = 1/298.257223563. +.IP "\fB\-\-comment\-delimiter\fR" 4 +.IX Item "--comment-delimiter" +set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +print version and exit. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +print usage and exit. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +print full documentation and exit. +.IP "\fB\-\-input\-file\fR" 4 +.IX Item "--input-file" +read input from the file \fIinfile\fR instead of from standard input; a file +name of \*(L"\-\*(R" stands for standard input. +.IP "\fB\-\-input\-string\fR" 4 +.IX Item "--input-string" +read input from the string \fIinstring\fR instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in \fIinstring\fR are converted to newlines before the reading begins. +.IP "\fB\-\-line\-separator\fR" 4 +.IX Item "--line-separator" +set the line separator character to \fIlinesep\fR. By default this is a +semicolon. +.IP "\fB\-\-output\-file\fR" 4 +.IX Item "--output-file" +write output to the file \fIoutfile\fR instead of to standard output; a +file name of \*(L"\-\*(R" stands for standard output. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +.Vb 4 +\& echo 48.648 \-2.007 | GeodesicProj \-c 48.836 2.337 +\& => \-319919 \-11791 86.7 0.999 +\& echo \-319919 \-11791 | GeodesicProj \-c 48.836 2.337 \-r +\& => 48.648 \-2.007 86.7 0.999 +.Ve +.SH "ERRORS" +.IX Header "ERRORS" +An illegal line of input will print an error message to standard output +beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGeodesicProj\fR to return an exit +code of 1. However, an error does not cause \fBGeodesicProj\fR to +terminate; following lines will be converted. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +The ellipsoidal gnomonic projection is derived in Section 8 of +C. F. F. Karney, \fIAlgorithms for geodesics\fR, J. Geodesy 87, 43\-55 (2013); \s-1DOI\s0 +http://dx.doi.org/10.1007/s00190\-012\-0578\-z ; +addenda: http://geographiclib.sf.net/geod\-addenda.html . +.SH "AUTHOR" +.IX Header "AUTHOR" +\&\fBGeodesicProj\fR was written by Charles Karney. +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBGeodesicProj\fR was added to GeographicLib, +, in 2009\-08. Prior to version 1.9 it was +called EquidistantTest. diff --git a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1.html b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1.html new file mode 100644 index 000000000..c40ca5a4d --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1.html @@ -0,0 +1,140 @@ + + + + + + + + + + + + + +

NAME

+ +

GeodesicProj -- perform projections based on geodesics

+ +

SYNOPSIS

+ +

GeodesicProj ( -z | -c | -g ) lat0 lon0 [ -r ] [ -e a f ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]

+ +

DESCRIPTION

+ +

Perform projections based on geodesics. Convert geodetic coordinates to either azimuthal equidistant, Cassini-Soldner, or gnomonic coordinates. The center of the projection (lat0, lon0) is specified by either the -c option (for Cassini-Soldner), the -z option (for azimuthal equidistant), or the -g option (for gnomonic). At least one of these options must be given (the last one given is used).

+ +

Geodetic coordinates are provided on standard input as a set of lines containing (blank separated) latitude and longitude (decimal degrees or degrees, minutes, seconds). For each set of geodetic coordinates, the corresponding projected coordinates x, y (meters) are printed on standard output together with the azimuth azi (degrees) and reciprocal scale rk. For Cassini-Soldner, azi is the bearing of the easting direction and the scale in the easting direction is 1 and the scale in the northing direction is 1/rk. For azimuthal equidistant and gnomonic, azi is the bearing of the radial direction and the scale in the azimuthal direction is 1/rk. For azimuthal equidistant and gnomonic, the scales in the radial direction are 1 and 1/rk^2, respectively.

+ +

OPTIONS

+ +
+ +
-z
+
+ +

use the azimuthal equidistant projection centered at latitude = lat0, longitude = lon0.

+ +
+
-c
+
+ +

use the Cassini-Soldner projection centered at latitude = lat0, longitude = lon0.

+ +
+
-g
+
+ +

use the ellipsoidal gnomonic projection centered at latitude = lat0, longitude = lon0.

+ +
+
-r
+
+ +

perform the reverse projection. x and y are given on standard input and each line of standard output gives latitude, longitude, azi, and rk.

+ +
+
-e
+
+ +

specify the ellipsoid via a f; the equatorial radius is a and the flattening is f. Setting f = 0 results in a sphere. Specify f < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By default, the WGS84 ellipsoid is used, a = 6378137 m, f = 1/298.257223563.

+ +
+
--comment-delimiter
+
+ +

set the comment delimiter to commentdelim (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).

+ +
+
--version
+
+ +

print version and exit.

+ +
+
-h
+
+ +

print usage and exit.

+ +
+
--help
+
+ +

print full documentation and exit.

+ +
+
--input-file
+
+ +

read input from the file infile instead of from standard input; a file name of "-" stands for standard input.

+ +
+
--input-string
+
+ +

read input from the string instring instead of from standard input. All occurrences of the line separator character (default is a semicolon) in instring are converted to newlines before the reading begins.

+ +
+
--line-separator
+
+ +

set the line separator character to linesep. By default this is a semicolon.

+ +
+
--output-file
+
+ +

write output to the file outfile instead of to standard output; a file name of "-" stands for standard output.

+ +
+
+ +

EXAMPLES

+ +
   echo 48.648 -2.007 | GeodesicProj -c 48.836 2.337
+   => -319919 -11791 86.7 0.999
+   echo -319919 -11791 | GeodesicProj -c 48.836 2.337 -r
+   => 48.648 -2.007 86.7 0.999
+ +

ERRORS

+ +

An illegal line of input will print an error message to standard output beginning with ERROR: and causes GeodesicProj to return an exit code of 1. However, an error does not cause GeodesicProj to terminate; following lines will be converted.

+ +

SEE ALSO

+ +

The ellipsoidal gnomonic projection is derived in Section 8 of C. F. F. Karney, Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); DOI http://dx.doi.org/10.1007/s00190-012-0578-z; addenda: http://geographiclib.sf.net/geod-addenda.html.

+ +

AUTHOR

+ +

GeodesicProj was written by Charles Karney.

+ +

HISTORY

+ +

GeodesicProj was added to GeographicLib, http://geographiclib.sf.net, in 2009-08. Prior to version 1.9 it was called EquidistantTest.

+ + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.pod b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.pod new file mode 100644 index 000000000..2e2e961e6 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.pod @@ -0,0 +1,143 @@ +=head1 NAME + +GeodesicProj -- perform projections based on geodesics + +=head1 SYNOPSIS + +B ( B<-z> | B<-c> | B<-g> ) I I [ B<-r> ] +[ B<-e> I I ] +[ B<--comment-delimiter> I ] +[ B<--version> | B<-h> | B<--help> ] +[ B<--input-file> I | B<--input-string> I ] +[ B<--line-separator> I ] +[ B<--output-file> I ] + +=head1 DESCRIPTION + +Perform projections based on geodesics. Convert geodetic coordinates to +either azimuthal equidistant, Cassini-Soldner, or gnomonic coordinates. +The center of the projection (I, I) is specified by either the B<-c> +option (for Cassini-Soldner), the B<-z> option (for azimuthal equidistant), +or the B<-g> option (for gnomonic). At least one of these options must be +given (the last one given is used). + +Geodetic coordinates are provided on standard input as a set of lines +containing (blank separated) I and I (decimal +degrees or degrees, minutes, seconds). For each set of geodetic +coordinates, the corresponding projected coordinates I, I (meters) +are printed on standard output together with the azimuth I +(degrees) and reciprocal scale I. For Cassini-Soldner, I is +the bearing of the easting direction and the scale in the easting +direction is 1 and the scale in the northing direction is 1/I. For +azimuthal equidistant and gnomonic, I is the bearing of the radial +direction and the scale in the azimuthal direction is 1/I. For +azimuthal equidistant and gnomonic, the scales in the radial direction +are 1 and 1/I^2, respectively. + +=head1 OPTIONS + +=over + +=item B<-z> + +use the azimuthal equidistant projection centered at latitude = I, +longitude = I. + +=item B<-c> + +use the Cassini-Soldner projection centered at latitude = I, +longitude = I. + +=item B<-g> + +use the ellipsoidal gnomonic projection centered at latitude = I, +longitude = I. + +=item B<-r> + +perform the reverse projection. I and I are given on standard +input and each line of standard output gives I, I, +I, and I. + +=item B<-e> + +specify the ellipsoid via I I; the equatorial radius is I and +the flattening is I. Setting I = 0 results in a sphere. Specify +I E 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, +is allowed for I. (Also, if I E 1, the flattening is set to +1/I.) By default, the WGS84 ellipsoid is used, I = 6378137 m, +I = 1/298.257223563. + +=item B<--comment-delimiter> + +set the comment delimiter to I (e.g., "#" or "//"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). + +=item B<--version> + +print version and exit. + +=item B<-h> + +print usage and exit. + +=item B<--help> + +print full documentation and exit. + +=item B<--input-file> + +read input from the file I instead of from standard input; a file +name of "-" stands for standard input. + +=item B<--input-string> + +read input from the string I instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in I are converted to newlines before the reading begins. + +=item B<--line-separator> + +set the line separator character to I. By default this is a +semicolon. + +=item B<--output-file> + +write output to the file I instead of to standard output; a +file name of "-" stands for standard output. + +=back + +=head1 EXAMPLES + + echo 48.648 -2.007 | GeodesicProj -c 48.836 2.337 + => -319919 -11791 86.7 0.999 + echo -319919 -11791 | GeodesicProj -c 48.836 2.337 -r + => 48.648 -2.007 86.7 0.999 + +=head1 ERRORS + +An illegal line of input will print an error message to standard output +beginning with C and causes B to return an exit +code of 1. However, an error does not cause B to +terminate; following lines will be converted. + +=head1 SEE ALSO + +The ellipsoidal gnomonic projection is derived in Section 8 of +C. F. F. Karney, I, J. Geodesy 87, 43-55 (2013); DOI +L; +addenda: L. + +=head1 AUTHOR + +B was written by Charles Karney. + +=head1 HISTORY + +B was added to GeographicLib, +L, in 2009-08. Prior to version 1.9 it was +called EquidistantTest. diff --git a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.usage b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.usage new file mode 100644 index 000000000..9a5ab2517 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.usage @@ -0,0 +1,127 @@ +int usage(int retval, bool brief) { + if (brief) + ( retval ? std::cerr : std::cout ) << "Usage:\n" +" GeodesicProj ( -z | -c | -g ) lat0 lon0 [ -r ] [ -e a f ] [\n" +" --comment-delimiter commentdelim ] [ --version | -h | --help ] [\n" +" --input-file infile | --input-string instring ] [ --line-separator\n" +" linesep ] [ --output-file outfile ]\n" +"\n" +"For full documentation type:\n" +" GeodesicProj --help\n" +"or visit:\n" +" http://geographiclib.sf.net/1.34/GeodesicProj.1.html\n"; + else + ( retval ? std::cerr : std::cout ) << "Man page:\n" +"NAME\n" +" GeodesicProj -- perform projections based on geodesics\n" +"\n" +"SYNOPSIS\n" +" GeodesicProj ( -z | -c | -g ) lat0 lon0 [ -r ] [ -e a f ] [\n" +" --comment-delimiter commentdelim ] [ --version | -h | --help ] [\n" +" --input-file infile | --input-string instring ] [ --line-separator\n" +" linesep ] [ --output-file outfile ]\n" +"\n" +"DESCRIPTION\n" +" Perform projections based on geodesics. Convert geodetic coordinates\n" +" to either azimuthal equidistant, Cassini-Soldner, or gnomonic\n" +" coordinates. The center of the projection (lat0, lon0) is specified by\n" +" either the -c option (for Cassini-Soldner), the -z option (for\n" +" azimuthal equidistant), or the -g option (for gnomonic). At least one\n" +" of these options must be given (the last one given is used).\n" +"\n" +" Geodetic coordinates are provided on standard input as a set of lines\n" +" containing (blank separated) latitude and longitude (decimal degrees or\n" +" degrees, minutes, seconds). For each set of geodetic coordinates, the\n" +" corresponding projected coordinates x, y (meters) are printed on\n" +" standard output together with the azimuth azi (degrees) and reciprocal\n" +" scale rk. For Cassini-Soldner, azi is the bearing of the easting\n" +" direction and the scale in the easting direction is 1 and the scale in\n" +" the northing direction is 1/rk. For azimuthal equidistant and\n" +" gnomonic, azi is the bearing of the radial direction and the scale in\n" +" the azimuthal direction is 1/rk. For azimuthal equidistant and\n" +" gnomonic, the scales in the radial direction are 1 and 1/rk^2,\n" +" respectively.\n" +"\n" +"OPTIONS\n" +" -z use the azimuthal equidistant projection centered at latitude =\n" +" lat0, longitude = lon0.\n" +"\n" +" -c use the Cassini-Soldner projection centered at latitude = lat0,\n" +" longitude = lon0.\n" +"\n" +" -g use the ellipsoidal gnomonic projection centered at latitude =\n" +" lat0, longitude = lon0.\n" +"\n" +" -r perform the reverse projection. x and y are given on standard\n" +" input and each line of standard output gives latitude, longitude,\n" +" azi, and rk.\n" +"\n" +" -e specify the ellipsoid via a f; the equatorial radius is a and the\n" +" flattening is f. Setting f = 0 results in a sphere. Specify f < 0\n" +" for a prolate ellipsoid. A simple fraction, e.g., 1/297, is\n" +" allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By\n" +" default, the WGS84 ellipsoid is used, a = 6378137 m, f =\n" +" 1/298.257223563.\n" +"\n" +" --comment-delimiter\n" +" set the comment delimiter to commentdelim (e.g., \"#\" or \"//\"). If\n" +" set, the input lines will be scanned for this delimiter and, if\n" +" found, the delimiter and the rest of the line will be removed prior\n" +" to processing and subsequently appended to the output line\n" +" (separated by a space).\n" +"\n" +" --version\n" +" print version and exit.\n" +"\n" +" -h print usage and exit.\n" +"\n" +" --help\n" +" print full documentation and exit.\n" +"\n" +" --input-file\n" +" read input from the file infile instead of from standard input; a\n" +" file name of \"-\" stands for standard input.\n" +"\n" +" --input-string\n" +" read input from the string instring instead of from standard input.\n" +" All occurrences of the line separator character (default is a\n" +" semicolon) in instring are converted to newlines before the reading\n" +" begins.\n" +"\n" +" --line-separator\n" +" set the line separator character to linesep. By default this is a\n" +" semicolon.\n" +"\n" +" --output-file\n" +" write output to the file outfile instead of to standard output; a\n" +" file name of \"-\" stands for standard output.\n" +"\n" +"EXAMPLES\n" +" echo 48.648 -2.007 | GeodesicProj -c 48.836 2.337\n" +" => -319919 -11791 86.7 0.999\n" +" echo -319919 -11791 | GeodesicProj -c 48.836 2.337 -r\n" +" => 48.648 -2.007 86.7 0.999\n" +"\n" +"ERRORS\n" +" An illegal line of input will print an error message to standard output\n" +" beginning with \"ERROR:\" and causes GeodesicProj to return an exit code\n" +" of 1. However, an error does not cause GeodesicProj to terminate;\n" +" following lines will be converted.\n" +"\n" +"SEE ALSO\n" +" The ellipsoidal gnomonic projection is derived in Section 8 of C. F. F.\n" +" Karney, Algorithms for geodesics, J. Geodesy 87, 43-55 (2013); DOI\n" +" http://dx.doi.org/10.1007/s00190-012-0578-z\n" +" ; addenda:\n" +" http://geographiclib.sf.net/geod-addenda.html\n" +" .\n" +"\n" +"AUTHOR\n" +" GeodesicProj was written by Charles Karney.\n" +"\n" +"HISTORY\n" +" GeodesicProj was added to GeographicLib, ,\n" +" in 2009-08. Prior to version 1.9 it was called EquidistantTest.\n" +; + return retval; +} diff --git a/gtsam/3rdparty/GeographicLib/man/GeoidEval.1 b/gtsam/3rdparty/GeographicLib/man/GeoidEval.1 new file mode 100644 index 000000000..681a096f0 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeoidEval.1 @@ -0,0 +1,395 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "GEOIDEVAL 1" +.TH GEOIDEVAL 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +GeoidEval \-\- look up geoid heights +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBGeoidEval\fR [ \fB\-n\fR \fIname\fR ] [ \fB\-d\fR \fIdir\fR ] [ \fB\-l\fR ] +[ \fB\-a\fR | \fB\-c\fR \fIsouth\fR \fIwest\fR \fInorth\fR \fIeast\fR ] [ \fB\-g\fR ] +[ \fB\-z\fR \fIzone\fR ] [ \fB\-\-msltohae\fR ] [ \fB\-\-haetomsl\fR ] +[ \fB\-v\fR ] +[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] +[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] +[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] +[ \fB\-\-line\-separator\fR \fIlinesep\fR ] +[ \fB\-\-output\-file\fR \fIoutfile\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBGeoidEval\fR reads in positions on standard input and prints out the +corresponding geoid heights on standard output. Optionally, it also +prints the northerly and easterly gradients of the geoid height. +.PP +Positions are given as latitude and longitude, \s-1UTM/UPS\s0, or \s-1MGRS\s0, in any +of the formats accepted by \fIGeoConvert\fR\|(1). (\s-1MGRS\s0 coordinates signify the +\&\fIcenter\fR of the corresponding \s-1MGRS\s0 square.) If the \fB\-z\fR option is +specified then the specified zone is prepended to each line of input +(which must be in \s-1UTM/UPS\s0 coordinates). This allows a file with \s-1UTM\s0 +eastings and northings in a single zone to be used as standard input. +.PP +More accurate results for the geoid height are provided by \fIGravity\fR\|(1). +This utility can also compute the direction of gravity accurately. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-n\fR" 4 +.IX Item "-n" +use geoid \fIname\fR instead of the default \f(CW\*(C`egm96\-5\*(C'\fR. See +\&\*(L"\s-1GEOIDS\s0\*(R". +.IP "\fB\-d\fR" 4 +.IX Item "-d" +read geoid data from \fIdir\fR instead of the default. See +\&\*(L"\s-1GEOIDS\s0\*(R". +.IP "\fB\-l\fR" 4 +.IX Item "-l" +use bilinear interpolation instead of cubic. See +\&\*(L"\s-1INTERPOLATION\s0\*(R". +.IP "\fB\-a\fR" 4 +.IX Item "-a" +cache the entire data set in memory. See \*(L"\s-1CACHE\s0\*(R". +.IP "\fB\-c\fR" 4 +.IX Item "-c" +cache the data bounded by \fIsouth\fR \fIwest\fR \fInorth\fR \fIeast\fR in memory. +See \*(L"\s-1CACHE\s0\*(R". +.IP "\fB\-g\fR" 4 +.IX Item "-g" +print the northerly and easterly gradients after the geoid height (i.e., +the rate at which the geoid height changes per unit distance along the +\&\s-1WGS84\s0 ellipsoid in the specified directions). As a result of the way +that the geoid data is stored, the calculation of gradients can result +in large quantization errors. This is particularly acute at high +latitudes and for the easterly gradient. +.IP "\fB\-z\fR" 4 +.IX Item "-z" +prefix each line of input by \fIzone\fR, e.g., \f(CW\*(C`38N\*(C'\fR. This should be used +when the input consists of \s-1UTM/UPS\s0 eastings and northings. +.IP "\fB\-\-msltohae\fR" 4 +.IX Item "--msltohae" +standard input should include a final token on each line which is +treated as a height (in meters) above the geoid and the output echoes +the input line with the height converted to height above ellipsoid +(\s-1HAE\s0). If \fB\-z\fR \fIzone\fR is specified then the \fIthird\fR token is treated +as the height; this makes it possible to convert \s-1LIDAR\s0 data where each +line consists of: easting northing height intensity. +.IP "\fB\-\-haetomsl\fR" 4 +.IX Item "--haetomsl" +this is similar to \fB\-\-msltohae\fR except that the height token is treated +as a height (in meters) above the ellipsoid and the output echoes the +input line with the height converted to height above the geoid (\s-1MSL\s0). +.IP "\fB\-v\fR" 4 +.IX Item "-v" +print information about the geoid on standard error before processing +the input. +.IP "\fB\-\-comment\-delimiter\fR" 4 +.IX Item "--comment-delimiter" +set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +print version and exit. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +print usage, the default geoid path and name, and exit. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +print full documentation and exit. +.IP "\fB\-\-input\-file\fR" 4 +.IX Item "--input-file" +read input from the file \fIinfile\fR instead of from standard input; a file +name of \*(L"\-\*(R" stands for standard input. +.IP "\fB\-\-input\-string\fR" 4 +.IX Item "--input-string" +read input from the string \fIinstring\fR instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in \fIinstring\fR are converted to newlines before the reading begins. +.IP "\fB\-\-line\-separator\fR" 4 +.IX Item "--line-separator" +set the line separator character to \fIlinesep\fR. By default this is a +semicolon. +.IP "\fB\-\-output\-file\fR" 4 +.IX Item "--output-file" +write output to the file \fIoutfile\fR instead of to standard output; a +file name of \*(L"\-\*(R" stands for standard output. +.SH "GEOIDS" +.IX Header "GEOIDS" +\&\fBGeoidEval\fR computes geoid heights by interpolating on the data in a +regularly spaced table (see \*(L"\s-1INTERPOLATION\s0\*(R"). The following geoid +tables are available (however, some may not be installed): +.PP +.Vb 9 +\& bilinear error cubic error +\& name geoid grid max rms max rms +\& egm84\-30 EGM84 30\*(Aq 1.546 m 70 mm 0.274 m 14 mm +\& egm84\-15 EGM84 15\*(Aq 0.413 m 18 mm 0.021 m 1.2 mm +\& egm96\-15 EGM96 15\*(Aq 1.152 m 40 mm 0.169 m 7.0 mm +\& egm96\-5 EGM96 5\*(Aq 0.140 m 4.6 mm .0032 m 0.7 mm +\& egm2008\-5 EGM2008 5\*(Aq 0.478 m 12 mm 0.294 m 4.5 mm +\& egm2008\-2_5 EGM2008 2.5\*(Aq 0.135 m 3.2 mm 0.031 m 0.8 mm +\& egm2008\-1 EGM2008 1\*(Aq 0.025 m 0.8 mm .0022 m 0.7 mm +.Ve +.PP +By default, the \f(CW\*(C`egm96\-5\*(C'\fR geoid is used. This may changed by setting +the environment variable \f(CW\*(C`GEOID_NAME\*(C'\fR or with the \fB\-n\fR option. The +errors listed here are estimates of the quantization and interpolation +errors in the reported heights compared to the specified geoid. +.PP +The geoid data will be loaded from a directory specified at compile +time. This may changed by setting the environment variables +\&\f(CW\*(C`GEOID_PATH\*(C'\fR or \f(CW\*(C`GEOGRAPHICLIB_DATA\*(C'\fR, or with the \fB\-d\fR option. The +\&\fB\-h\fR option prints the default geoid path and name. Use the \fB\-v\fR +option to ascertain the full path name of the data file. +.PP +Instructions for downloading and installing geoid data are available at +. +.PP +\&\fB\s-1NOTE\s0\fR: all the geoids above apply to the \s-1WGS84\s0 ellipsoid (\fIa\fR = +6378137 m, \fIf\fR = 1/298.257223563) only. +.SH "INTERPOLATION" +.IX Header "INTERPOLATION" +Cubic interpolation is used to compute the geoid height unless \fB\-l\fR is +specified in which case bilinear interpolation is used. The cubic +interpolation is based on a least-squares fit of a cubic polynomial to a +12\-point stencil +.PP +.Vb 4 +\& . 1 1 . +\& 1 2 2 1 +\& 1 2 2 1 +\& . 1 1 . +.Ve +.PP +The cubic is constrained to be independent of longitude when evaluating +the height at one of the poles. Cubic interpolation is considerably +more accurate than bilinear; however it results in small discontinuities +in the returned height on cell boundaries. The gradients are computed +by differentiating the interpolated results. +.SH "CACHE" +.IX Header "CACHE" +By default, the data file is randomly read to compute the geoid heights +at the input positions. Usually this is sufficient for interactive use. +If many heights are to be computed, use \fB\-c\fR \fIsouth\fR \fIwest\fR \fInorth\fR +\&\fIeast\fR to notify \fBGeoidEval\fR to read a rectangle of data into memory; +heights within the this rectangle can then be computed without any disk +access. If \fB\-a\fR is specified all the geoid data is read; in the case +of \f(CW\*(C`egm2008\-1\*(C'\fR, this requires about 0.5 \s-1GB\s0 of \s-1RAM\s0. The evaluation of +heights outside the cached area causes the necessary data to be read +from disk. Use the \fB\-v\fR option to verify the size of the cache. +.PP +Regardless of whether any cache is requested (with the \fB\-a\fR or \fB\-c\fR +options), the data for the last grid cell in cached. This allows +the geoid height along a continuous path to be returned with little +disk overhead. +.SH "ENVIRONMENT" +.IX Header "ENVIRONMENT" +.IP "\fB\s-1GEOID_NAME\s0\fR" 4 +.IX Item "GEOID_NAME" +Override the compile-time default geoid name of \f(CW\*(C`egm96\-5\*(C'\fR. The \fB\-h\fR +option reports the value of \fB\s-1GEOID_NAME\s0\fR, if defined, otherwise it +reports the compile-time value. If the \fB\-n\fR \fIname\fR option is used, +then \fIname\fR takes precedence. +.IP "\fB\s-1GEOID_PATH\s0\fR" 4 +.IX Item "GEOID_PATH" +Override the compile-time default geoid path. This is typically +\&\f(CW\*(C`/usr/local/share/GeographicLib/geoids\*(C'\fR on Unix-like systems and +\&\f(CW\*(C`C:/Documents and Settings/All Users/Application +Data/GeographicLib/geoids\*(C'\fR on Windows systems. The \fB\-h\fR option reports +the value of \fB\s-1GEOID_PATH\s0\fR, if defined, otherwise it reports the +compile-time value. If the \fB\-d\fR \fIdir\fR option is used, then \fIdir\fR +takes precedence. +.IP "\fB\s-1GEOGRAPHICLIB_DATA\s0\fR" 4 +.IX Item "GEOGRAPHICLIB_DATA" +Another way of overriding the compile-time default magnetic path. If it +is set (and if \fB\s-1MAGNETIC_PATH\s0\fR is not set), then +$\fB\s-1GEOGRAPHICLIB_DATA\s0\fR/magnetic is used. +.SH "ERRORS" +.IX Header "ERRORS" +An illegal line of input will print an error message to standard output +beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGeoidEval\fR to return an exit code +of 1. However, an error does not cause \fBGeoidEval\fR to terminate; +following lines will be converted. +.SH "ABBREVIATIONS" +.IX Header "ABBREVIATIONS" +The geoid is usually approximated by an \*(L"earth gravity model\*(R". The +models published by the \s-1NGA\s0 are: +.IP "\fB\s-1EGM84\s0\fR" 4 +.IX Item "EGM84" +An earth gravity model published by the \s-1NGA\s0 in 1984, +http://earth\-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html . +.IP "\fB\s-1EGM96\s0\fR" 4 +.IX Item "EGM96" +An earth gravity model published by the \s-1NGA\s0 in 1996, +http://earth\-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html . +.IP "\fB\s-1EGM2008\s0\fR" 4 +.IX Item "EGM2008" +An earth gravity model published by the \s-1NGA\s0 in 2008, +http://earth\-info.nga.mil/GandG/wgs84/gravitymod/egm2008 . +.IP "\fB\s-1WGS84\s0\fR" 4 +.IX Item "WGS84" +World Geodetic System 1984, +. +.IP "\fB\s-1HAE\s0\fR" 4 +.IX Item "HAE" +Height above the \s-1WGS84\s0 ellipsoid. +.IP "\fB\s-1MSL\s0\fR" 4 +.IX Item "MSL" +Mean sea level, used as a convenient short hand for the geoid. +(However, typically, the geoid differs by a few meters from mean sea +level.) +.SH "EXAMPLES" +.IX Header "EXAMPLES" +The height of the \s-1EGM96\s0 geoid at Timbuktu +.PP +.Vb 2 +\& echo 16:46:33N 3:00:34W | GeoidEval +\& => 28.7068 \-0.02e\-6 \-1.73e\-6 +.Ve +.PP +The first number returned is the height of the geoid and the 2nd and 3rd +are its slopes in the northerly and easterly directions. +.PP +Convert a point in \s-1UTM\s0 zone 18N from \s-1MSL\s0 to \s-1HAE\s0 +.PP +.Vb 2 +\& echo 531595 4468135 23 | GeoidEval \-\-msltohae \-z 18N +\& => 531595 4468135 \-10.842 +.Ve +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fIGeoConvert\fR\|(1), \fIGravity\fR\|(1). +.SH "AUTHOR" +.IX Header "AUTHOR" +\&\fBGeoidEval\fR was written by Charles Karney. +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBGeoidEval\fR was added to GeographicLib, , +in 2009\-09. diff --git a/gtsam/3rdparty/GeographicLib/man/GeoidEval.1.html b/gtsam/3rdparty/GeographicLib/man/GeoidEval.1.html new file mode 100644 index 000000000..91f8f3610 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeoidEval.1.html @@ -0,0 +1,286 @@ + + + + + + + + + + + + + +

NAME

+ +

GeoidEval -- look up geoid heights

+ +

SYNOPSIS

+ +

GeoidEval [ -n name ] [ -d dir ] [ -l ] [ -a | -c south west north east ] [ -g ] [ -z zone ] [ --msltohae ] [ --haetomsl ] [ -v ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]

+ +

DESCRIPTION

+ +

GeoidEval reads in positions on standard input and prints out the corresponding geoid heights on standard output. Optionally, it also prints the northerly and easterly gradients of the geoid height.

+ +

Positions are given as latitude and longitude, UTM/UPS, or MGRS, in any of the formats accepted by GeoConvert(1). (MGRS coordinates signify the center of the corresponding MGRS square.) If the -z option is specified then the specified zone is prepended to each line of input (which must be in UTM/UPS coordinates). This allows a file with UTM eastings and northings in a single zone to be used as standard input.

+ +

More accurate results for the geoid height are provided by Gravity(1). This utility can also compute the direction of gravity accurately.

+ +

OPTIONS

+ +
+ +
-n
+
+ +

use geoid name instead of the default egm96-5. See "GEOIDS".

+ +
+
-d
+
+ +

read geoid data from dir instead of the default. See "GEOIDS".

+ +
+
-l
+
+ +

use bilinear interpolation instead of cubic. See "INTERPOLATION".

+ +
+
-a
+
+ +

cache the entire data set in memory. See "CACHE".

+ +
+
-c
+
+ +

cache the data bounded by south west north east in memory. See "CACHE".

+ +
+
-g
+
+ +

print the northerly and easterly gradients after the geoid height (i.e., the rate at which the geoid height changes per unit distance along the WGS84 ellipsoid in the specified directions). As a result of the way that the geoid data is stored, the calculation of gradients can result in large quantization errors. This is particularly acute at high latitudes and for the easterly gradient.

+ +
+
-z
+
+ +

prefix each line of input by zone, e.g., 38N. This should be used when the input consists of UTM/UPS eastings and northings.

+ +
+
--msltohae
+
+ +

standard input should include a final token on each line which is treated as a height (in meters) above the geoid and the output echoes the input line with the height converted to height above ellipsoid (HAE). If -z zone is specified then the third token is treated as the height; this makes it possible to convert LIDAR data where each line consists of: easting northing height intensity.

+ +
+
--haetomsl
+
+ +

this is similar to --msltohae except that the height token is treated as a height (in meters) above the ellipsoid and the output echoes the input line with the height converted to height above the geoid (MSL).

+ +
+
-v
+
+ +

print information about the geoid on standard error before processing the input.

+ +
+
--comment-delimiter
+
+ +

set the comment delimiter to commentdelim (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).

+ +
+
--version
+
+ +

print version and exit.

+ +
+
-h
+
+ +

print usage, the default geoid path and name, and exit.

+ +
+
--help
+
+ +

print full documentation and exit.

+ +
+
--input-file
+
+ +

read input from the file infile instead of from standard input; a file name of "-" stands for standard input.

+ +
+
--input-string
+
+ +

read input from the string instring instead of from standard input. All occurrences of the line separator character (default is a semicolon) in instring are converted to newlines before the reading begins.

+ +
+
--line-separator
+
+ +

set the line separator character to linesep. By default this is a semicolon.

+ +
+
--output-file
+
+ +

write output to the file outfile instead of to standard output; a file name of "-" stands for standard output.

+ +
+
+ +

GEOIDS

+ +

GeoidEval computes geoid heights by interpolating on the data in a regularly spaced table (see "INTERPOLATION"). The following geoid tables are available (however, some may not be installed):

+ +
                                  bilinear error    cubic error
+   name         geoid    grid     max      rms      max      rms
+   egm84-30     EGM84    30'      1.546 m  70 mm    0.274 m  14 mm
+   egm84-15     EGM84    15'      0.413 m  18 mm    0.021 m  1.2 mm
+   egm96-15     EGM96    15'      1.152 m  40 mm    0.169 m  7.0 mm
+   egm96-5      EGM96     5'      0.140 m  4.6 mm   .0032 m  0.7 mm
+   egm2008-5    EGM2008   5'      0.478 m  12 mm    0.294 m  4.5 mm
+   egm2008-2_5  EGM2008   2.5'    0.135 m  3.2 mm   0.031 m  0.8 mm
+   egm2008-1    EGM2008   1'      0.025 m  0.8 mm   .0022 m  0.7 mm
+ +

By default, the egm96-5 geoid is used. This may changed by setting the environment variable GEOID_NAME or with the -n option. The errors listed here are estimates of the quantization and interpolation errors in the reported heights compared to the specified geoid.

+ +

The geoid data will be loaded from a directory specified at compile time. This may changed by setting the environment variables GEOID_PATH or GEOGRAPHICLIB_DATA, or with the -d option. The -h option prints the default geoid path and name. Use the -v option to ascertain the full path name of the data file.

+ +

Instructions for downloading and installing geoid data are available at http://geographiclib.sf.net/html/geoid.html#geoidinst.

+ +

NOTE: all the geoids above apply to the WGS84 ellipsoid (a = 6378137 m, f = 1/298.257223563) only.

+ +

INTERPOLATION

+ +

Cubic interpolation is used to compute the geoid height unless -l is specified in which case bilinear interpolation is used. The cubic interpolation is based on a least-squares fit of a cubic polynomial to a 12-point stencil

+ +
   . 1 1 .
+   1 2 2 1
+   1 2 2 1
+   . 1 1 .
+ +

The cubic is constrained to be independent of longitude when evaluating the height at one of the poles. Cubic interpolation is considerably more accurate than bilinear; however it results in small discontinuities in the returned height on cell boundaries. The gradients are computed by differentiating the interpolated results.

+ +

CACHE

+ +

By default, the data file is randomly read to compute the geoid heights at the input positions. Usually this is sufficient for interactive use. If many heights are to be computed, use -c south west north east to notify GeoidEval to read a rectangle of data into memory; heights within the this rectangle can then be computed without any disk access. If -a is specified all the geoid data is read; in the case of egm2008-1, this requires about 0.5 GB of RAM. The evaluation of heights outside the cached area causes the necessary data to be read from disk. Use the -v option to verify the size of the cache.

+ +

Regardless of whether any cache is requested (with the -a or -c options), the data for the last grid cell in cached. This allows the geoid height along a continuous path to be returned with little disk overhead.

+ +

ENVIRONMENT

+ +
+ +
GEOID_NAME
+
+ +

Override the compile-time default geoid name of egm96-5. The -h option reports the value of GEOID_NAME, if defined, otherwise it reports the compile-time value. If the -n name option is used, then name takes precedence.

+ +
+
GEOID_PATH
+
+ +

Override the compile-time default geoid path. This is typically /usr/local/share/GeographicLib/geoids on Unix-like systems and C:/Documents and Settings/All Users/Application Data/GeographicLib/geoids on Windows systems. The -h option reports the value of GEOID_PATH, if defined, otherwise it reports the compile-time value. If the -d dir option is used, then dir takes precedence.

+ +
+
GEOGRAPHICLIB_DATA
+
+ +

Another way of overriding the compile-time default magnetic path. If it is set (and if MAGNETIC_PATH is not set), then $GEOGRAPHICLIB_DATA/magnetic is used.

+ +
+
+ +

ERRORS

+ +

An illegal line of input will print an error message to standard output beginning with ERROR: and causes GeoidEval to return an exit code of 1. However, an error does not cause GeoidEval to terminate; following lines will be converted.

+ +

ABBREVIATIONS

+ +

The geoid is usually approximated by an "earth gravity model". The models published by the NGA are:

+ +
+ +
EGM84
+
+ +

An earth gravity model published by the NGA in 1984, http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html.

+ +
+
EGM96
+
+ +

An earth gravity model published by the NGA in 1996, http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html.

+ +
+
EGM2008
+
+ +

An earth gravity model published by the NGA in 2008, http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008.

+ +
+
WGS84
+
+ +

World Geodetic System 1984, http://en.wikipedia.org/wiki/WGS84.

+ +
+
HAE
+
+ +

Height above the WGS84 ellipsoid.

+ +
+
MSL
+
+ +

Mean sea level, used as a convenient short hand for the geoid. (However, typically, the geoid differs by a few meters from mean sea level.)

+ +
+
+ +

EXAMPLES

+ +

The height of the EGM96 geoid at Timbuktu

+ +
    echo 16:46:33N 3:00:34W | GeoidEval
+    => 28.7068 -0.02e-6 -1.73e-6
+ +

The first number returned is the height of the geoid and the 2nd and 3rd are its slopes in the northerly and easterly directions.

+ +

Convert a point in UTM zone 18N from MSL to HAE

+ +
   echo 531595 4468135 23 | GeoidEval --msltohae -z 18N
+   => 531595 4468135 -10.842
+ +

SEE ALSO

+ +

GeoConvert(1), Gravity(1).

+ +

AUTHOR

+ +

GeoidEval was written by Charles Karney.

+ +

HISTORY

+ +

GeoidEval was added to GeographicLib, http://geographiclib.sf.net, in 2009-09.

+ + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/man/GeoidEval.pod b/gtsam/3rdparty/GeographicLib/man/GeoidEval.pod new file mode 100644 index 000000000..c6ca929fc --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeoidEval.pod @@ -0,0 +1,307 @@ +=head1 NAME + +GeoidEval -- look up geoid heights + +=head1 SYNOPSIS + +B [ B<-n> I ] [ B<-d> I ] [ B<-l> ] +[ B<-a> | B<-c> I I I I ] [ B<-g> ] +[ B<-z> I ] [ B<--msltohae> ] [ B<--haetomsl> ] +[ B<-v> ] +[ B<--comment-delimiter> I ] +[ B<--version> | B<-h> | B<--help> ] +[ B<--input-file> I | B<--input-string> I ] +[ B<--line-separator> I ] +[ B<--output-file> I ] + +=head1 DESCRIPTION + +B reads in positions on standard input and prints out the +corresponding geoid heights on standard output. Optionally, it also +prints the northerly and easterly gradients of the geoid height. + +Positions are given as latitude and longitude, UTM/UPS, or MGRS, in any +of the formats accepted by GeoConvert(1). (MGRS coordinates signify the +I
of the corresponding MGRS square.) If the B<-z> option is +specified then the specified zone is prepended to each line of input +(which must be in UTM/UPS coordinates). This allows a file with UTM +eastings and northings in a single zone to be used as standard input. + +More accurate results for the geoid height are provided by Gravity(1). +This utility can also compute the direction of gravity accurately. + +=head1 OPTIONS + +=over + +=item B<-n> + +use geoid I instead of the default C. See +L. + +=item B<-d> + +read geoid data from I instead of the default. See +L. + +=item B<-l> + +use bilinear interpolation instead of cubic. See +L. + +=item B<-a> + +cache the entire data set in memory. See L. + +=item B<-c> + +cache the data bounded by I I I I in memory. +See L. + +=item B<-g> + +print the northerly and easterly gradients after the geoid height (i.e., +the rate at which the geoid height changes per unit distance along the +WGS84 ellipsoid in the specified directions). As a result of the way +that the geoid data is stored, the calculation of gradients can result +in large quantization errors. This is particularly acute at high +latitudes and for the easterly gradient. + +=item B<-z> + +prefix each line of input by I, e.g., C<38N>. This should be used +when the input consists of UTM/UPS eastings and northings. + +=item B<--msltohae> + +standard input should include a final token on each line which is +treated as a height (in meters) above the geoid and the output echoes +the input line with the height converted to height above ellipsoid +(HAE). If B<-z> I is specified then the I token is treated +as the height; this makes it possible to convert LIDAR data where each +line consists of: easting northing height intensity. + +=item B<--haetomsl> + +this is similar to B<--msltohae> except that the height token is treated +as a height (in meters) above the ellipsoid and the output echoes the +input line with the height converted to height above the geoid (MSL). + +=item B<-v> + +print information about the geoid on standard error before processing +the input. + +=item B<--comment-delimiter> + +set the comment delimiter to I (e.g., "#" or "//"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). + +=item B<--version> + +print version and exit. + +=item B<-h> + +print usage, the default geoid path and name, and exit. + +=item B<--help> + +print full documentation and exit. + +=item B<--input-file> + +read input from the file I instead of from standard input; a file +name of "-" stands for standard input. + +=item B<--input-string> + +read input from the string I instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in I are converted to newlines before the reading begins. + +=item B<--line-separator> + +set the line separator character to I. By default this is a +semicolon. + +=item B<--output-file> + +write output to the file I instead of to standard output; a +file name of "-" stands for standard output. + +=back + +=head1 GEOIDS + +B computes geoid heights by interpolating on the data in a +regularly spaced table (see L). The following geoid +tables are available (however, some may not be installed): + + bilinear error cubic error + name geoid grid max rms max rms + egm84-30 EGM84 30' 1.546 m 70 mm 0.274 m 14 mm + egm84-15 EGM84 15' 0.413 m 18 mm 0.021 m 1.2 mm + egm96-15 EGM96 15' 1.152 m 40 mm 0.169 m 7.0 mm + egm96-5 EGM96 5' 0.140 m 4.6 mm .0032 m 0.7 mm + egm2008-5 EGM2008 5' 0.478 m 12 mm 0.294 m 4.5 mm + egm2008-2_5 EGM2008 2.5' 0.135 m 3.2 mm 0.031 m 0.8 mm + egm2008-1 EGM2008 1' 0.025 m 0.8 mm .0022 m 0.7 mm + +By default, the C geoid is used. This may changed by setting +the environment variable C or with the B<-n> option. The +errors listed here are estimates of the quantization and interpolation +errors in the reported heights compared to the specified geoid. + +The geoid data will be loaded from a directory specified at compile +time. This may changed by setting the environment variables +C or C, or with the B<-d> option. The +B<-h> option prints the default geoid path and name. Use the B<-v> +option to ascertain the full path name of the data file. + +Instructions for downloading and installing geoid data are available at +L. + +B: all the geoids above apply to the WGS84 ellipsoid (I = +6378137 m, I = 1/298.257223563) only. + +=head1 INTERPOLATION + +Cubic interpolation is used to compute the geoid height unless B<-l> is +specified in which case bilinear interpolation is used. The cubic +interpolation is based on a least-squares fit of a cubic polynomial to a +12-point stencil + + . 1 1 . + 1 2 2 1 + 1 2 2 1 + . 1 1 . + +The cubic is constrained to be independent of longitude when evaluating +the height at one of the poles. Cubic interpolation is considerably +more accurate than bilinear; however it results in small discontinuities +in the returned height on cell boundaries. The gradients are computed +by differentiating the interpolated results. + +=head1 CACHE + +By default, the data file is randomly read to compute the geoid heights +at the input positions. Usually this is sufficient for interactive use. +If many heights are to be computed, use B<-c> I I I +I to notify B to read a rectangle of data into memory; +heights within the this rectangle can then be computed without any disk +access. If B<-a> is specified all the geoid data is read; in the case +of C, this requires about 0.5 GB of RAM. The evaluation of +heights outside the cached area causes the necessary data to be read +from disk. Use the B<-v> option to verify the size of the cache. + +Regardless of whether any cache is requested (with the B<-a> or B<-c> +options), the data for the last grid cell in cached. This allows +the geoid height along a continuous path to be returned with little +disk overhead. + +=head1 ENVIRONMENT + +=over + +=item B + +Override the compile-time default geoid name of C. The B<-h> +option reports the value of B, if defined, otherwise it +reports the compile-time value. If the B<-n> I option is used, +then I takes precedence. + +=item B + +Override the compile-time default geoid path. This is typically +C on Unix-like systems and +C on Windows systems. The B<-h> option reports +the value of B, if defined, otherwise it reports the +compile-time value. If the B<-d> I option is used, then I +takes precedence. + +=item B + +Another way of overriding the compile-time default magnetic path. If it +is set (and if B is not set), then +$B/magnetic is used. + +=back + +=head1 ERRORS + +An illegal line of input will print an error message to standard output +beginning with C and causes B to return an exit code +of 1. However, an error does not cause B to terminate; +following lines will be converted. + +=head1 ABBREVIATIONS + +The geoid is usually approximated by an "earth gravity model". The +models published by the NGA are: + +=over + +=item B + +An earth gravity model published by the NGA in 1984, +L. + +=item B + +An earth gravity model published by the NGA in 1996, +L. + +=item B + +An earth gravity model published by the NGA in 2008, +L. + +=item B + +World Geodetic System 1984, +L. + +=item B + +Height above the WGS84 ellipsoid. + +=item B + +Mean sea level, used as a convenient short hand for the geoid. +(However, typically, the geoid differs by a few meters from mean sea +level.) + +=back + +=head1 EXAMPLES + +The height of the EGM96 geoid at Timbuktu + + echo 16:46:33N 3:00:34W | GeoidEval + => 28.7068 -0.02e-6 -1.73e-6 + +The first number returned is the height of the geoid and the 2nd and 3rd +are its slopes in the northerly and easterly directions. + +Convert a point in UTM zone 18N from MSL to HAE + + echo 531595 4468135 23 | GeoidEval --msltohae -z 18N + => 531595 4468135 -10.842 + +=head1 SEE ALSO + +GeoConvert(1), Gravity(1). + +=head1 AUTHOR + +B was written by Charles Karney. + +=head1 HISTORY + +B was added to GeographicLib, L, +in 2009-09. diff --git a/gtsam/3rdparty/GeographicLib/man/GeoidEval.usage b/gtsam/3rdparty/GeographicLib/man/GeoidEval.usage new file mode 100644 index 000000000..727811108 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/GeoidEval.usage @@ -0,0 +1,260 @@ +int usage(int retval, bool brief) { + if (brief) + ( retval ? std::cerr : std::cout ) << "Usage:\n" +" GeoidEval [ -n name ] [ -d dir ] [ -l ] [ -a | -c south west north east\n" +" ] [ -g ] [ -z zone ] [ --msltohae ] [ --haetomsl ] [ -v ] [\n" +" --comment-delimiter commentdelim ] [ --version | -h | --help ] [\n" +" --input-file infile | --input-string instring ] [ --line-separator\n" +" linesep ] [ --output-file outfile ]\n" +"\n" +"For full documentation type:\n" +" GeoidEval --help\n" +"or visit:\n" +" http://geographiclib.sf.net/1.34/GeoidEval.1.html\n"; + else + ( retval ? std::cerr : std::cout ) << "Man page:\n" +"NAME\n" +" GeoidEval -- look up geoid heights\n" +"\n" +"SYNOPSIS\n" +" GeoidEval [ -n name ] [ -d dir ] [ -l ] [ -a | -c south west north east\n" +" ] [ -g ] [ -z zone ] [ --msltohae ] [ --haetomsl ] [ -v ] [\n" +" --comment-delimiter commentdelim ] [ --version | -h | --help ] [\n" +" --input-file infile | --input-string instring ] [ --line-separator\n" +" linesep ] [ --output-file outfile ]\n" +"\n" +"DESCRIPTION\n" +" GeoidEval reads in positions on standard input and prints out the\n" +" corresponding geoid heights on standard output. Optionally, it also\n" +" prints the northerly and easterly gradients of the geoid height.\n" +"\n" +" Positions are given as latitude and longitude, UTM/UPS, or MGRS, in any\n" +" of the formats accepted by GeoConvert(1). (MGRS coordinates signify\n" +" the center of the corresponding MGRS square.) If the -z option is\n" +" specified then the specified zone is prepended to each line of input\n" +" (which must be in UTM/UPS coordinates). This allows a file with UTM\n" +" eastings and northings in a single zone to be used as standard input.\n" +"\n" +" More accurate results for the geoid height are provided by Gravity(1).\n" +" This utility can also compute the direction of gravity accurately.\n" +"\n" +"OPTIONS\n" +" -n use geoid name instead of the default \"egm96-5\". See \"GEOIDS\".\n" +"\n" +" -d read geoid data from dir instead of the default. See \"GEOIDS\".\n" +"\n" +" -l use bilinear interpolation instead of cubic. See \"INTERPOLATION\".\n" +"\n" +" -a cache the entire data set in memory. See \"CACHE\".\n" +"\n" +" -c cache the data bounded by south west north east in memory. See\n" +" \"CACHE\".\n" +"\n" +" -g print the northerly and easterly gradients after the geoid height\n" +" (i.e., the rate at which the geoid height changes per unit distance\n" +" along the WGS84 ellipsoid in the specified directions). As a\n" +" result of the way that the geoid data is stored, the calculation of\n" +" gradients can result in large quantization errors. This is\n" +" particularly acute at high latitudes and for the easterly gradient.\n" +"\n" +" -z prefix each line of input by zone, e.g., \"38N\". This should be\n" +" used when the input consists of UTM/UPS eastings and northings.\n" +"\n" +" --msltohae\n" +" standard input should include a final token on each line which is\n" +" treated as a height (in meters) above the geoid and the output\n" +" echoes the input line with the height converted to height above\n" +" ellipsoid (HAE). If -z zone is specified then the third token is\n" +" treated as the height; this makes it possible to convert LIDAR data\n" +" where each line consists of: easting northing height intensity.\n" +"\n" +" --haetomsl\n" +" this is similar to --msltohae except that the height token is\n" +" treated as a height (in meters) above the ellipsoid and the output\n" +" echoes the input line with the height converted to height above the\n" +" geoid (MSL).\n" +"\n" +" -v print information about the geoid on standard error before\n" +" processing the input.\n" +"\n" +" --comment-delimiter\n" +" set the comment delimiter to commentdelim (e.g., \"#\" or \"//\"). If\n" +" set, the input lines will be scanned for this delimiter and, if\n" +" found, the delimiter and the rest of the line will be removed prior\n" +" to processing and subsequently appended to the output line\n" +" (separated by a space).\n" +"\n" +" --version\n" +" print version and exit.\n" +"\n" +" -h print usage, the default geoid path and name, and exit.\n" +"\n" +" --help\n" +" print full documentation and exit.\n" +"\n" +" --input-file\n" +" read input from the file infile instead of from standard input; a\n" +" file name of \"-\" stands for standard input.\n" +"\n" +" --input-string\n" +" read input from the string instring instead of from standard input.\n" +" All occurrences of the line separator character (default is a\n" +" semicolon) in instring are converted to newlines before the reading\n" +" begins.\n" +"\n" +" --line-separator\n" +" set the line separator character to linesep. By default this is a\n" +" semicolon.\n" +"\n" +" --output-file\n" +" write output to the file outfile instead of to standard output; a\n" +" file name of \"-\" stands for standard output.\n" +"\n" +"GEOIDS\n" +" GeoidEval computes geoid heights by interpolating on the data in a\n" +" regularly spaced table (see \"INTERPOLATION\"). The following geoid\n" +" tables are available (however, some may not be installed):\n" +"\n" +" bilinear error cubic error\n" +" name geoid grid max rms max rms\n" +" egm84-30 EGM84 30' 1.546 m 70 mm 0.274 m 14 mm\n" +" egm84-15 EGM84 15' 0.413 m 18 mm 0.021 m 1.2 mm\n" +" egm96-15 EGM96 15' 1.152 m 40 mm 0.169 m 7.0 mm\n" +" egm96-5 EGM96 5' 0.140 m 4.6 mm .0032 m 0.7 mm\n" +" egm2008-5 EGM2008 5' 0.478 m 12 mm 0.294 m 4.5 mm\n" +" egm2008-2_5 EGM2008 2.5' 0.135 m 3.2 mm 0.031 m 0.8 mm\n" +" egm2008-1 EGM2008 1' 0.025 m 0.8 mm .0022 m 0.7 mm\n" +"\n" +" By default, the \"egm96-5\" geoid is used. This may changed by setting\n" +" the environment variable \"GEOID_NAME\" or with the -n option. The\n" +" errors listed here are estimates of the quantization and interpolation\n" +" errors in the reported heights compared to the specified geoid.\n" +"\n" +" The geoid data will be loaded from a directory specified at compile\n" +" time. This may changed by setting the environment variables\n" +" \"GEOID_PATH\" or \"GEOGRAPHICLIB_DATA\", or with the -d option. The -h\n" +" option prints the default geoid path and name. Use the -v option to\n" +" ascertain the full path name of the data file.\n" +"\n" +" Instructions for downloading and installing geoid data are available at\n" +" .\n" +"\n" +" NOTE: all the geoids above apply to the WGS84 ellipsoid (a = 6378137 m,\n" +" f = 1/298.257223563) only.\n" +"\n" +"INTERPOLATION\n" +" Cubic interpolation is used to compute the geoid height unless -l is\n" +" specified in which case bilinear interpolation is used. The cubic\n" +" interpolation is based on a least-squares fit of a cubic polynomial to\n" +" a 12-point stencil\n" +"\n" +" . 1 1 .\n" +" 1 2 2 1\n" +" 1 2 2 1\n" +" . 1 1 .\n" +"\n" +" The cubic is constrained to be independent of longitude when evaluating\n" +" the height at one of the poles. Cubic interpolation is considerably\n" +" more accurate than bilinear; however it results in small\n" +" discontinuities in the returned height on cell boundaries. The\n" +" gradients are computed by differentiating the interpolated results.\n" +"\n" +"CACHE\n" +" By default, the data file is randomly read to compute the geoid heights\n" +" at the input positions. Usually this is sufficient for interactive\n" +" use. If many heights are to be computed, use -c south west north east\n" +" to notify GeoidEval to read a rectangle of data into memory; heights\n" +" within the this rectangle can then be computed without any disk access.\n" +" If -a is specified all the geoid data is read; in the case of\n" +" \"egm2008-1\", this requires about 0.5 GB of RAM. The evaluation of\n" +" heights outside the cached area causes the necessary data to be read\n" +" from disk. Use the -v option to verify the size of the cache.\n" +"\n" +" Regardless of whether any cache is requested (with the -a or -c\n" +" options), the data for the last grid cell in cached. This allows the\n" +" geoid height along a continuous path to be returned with little disk\n" +" overhead.\n" +"\n" +"ENVIRONMENT\n" +" GEOID_NAME\n" +" Override the compile-time default geoid name of \"egm96-5\". The -h\n" +" option reports the value of GEOID_NAME, if defined, otherwise it\n" +" reports the compile-time value. If the -n name option is used,\n" +" then name takes precedence.\n" +"\n" +" GEOID_PATH\n" +" Override the compile-time default geoid path. This is typically\n" +" \"/usr/local/share/GeographicLib/geoids\" on Unix-like systems and\n" +" \"C:/Documents and Settings/All Users/Application\n" +" Data/GeographicLib/geoids\" on Windows systems. The -h option\n" +" reports the value of GEOID_PATH, if defined, otherwise it reports\n" +" the compile-time value. If the -d dir option is used, then dir\n" +" takes precedence.\n" +"\n" +" GEOGRAPHICLIB_DATA\n" +" Another way of overriding the compile-time default magnetic path.\n" +" If it is set (and if MAGNETIC_PATH is not set), then\n" +" $GEOGRAPHICLIB_DATA/magnetic is used.\n" +"\n" +"ERRORS\n" +" An illegal line of input will print an error message to standard output\n" +" beginning with \"ERROR:\" and causes GeoidEval to return an exit code of\n" +" 1. However, an error does not cause GeoidEval to terminate; following\n" +" lines will be converted.\n" +"\n" +"ABBREVIATIONS\n" +" The geoid is usually approximated by an \"earth gravity model\". The\n" +" models published by the NGA are:\n" +"\n" +" EGM84\n" +" An earth gravity model published by the NGA in 1984,\n" +" http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html\n" +" .\n" +"\n" +" EGM96\n" +" An earth gravity model published by the NGA in 1996,\n" +" http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html\n" +" .\n" +"\n" +" EGM2008\n" +" An earth gravity model published by the NGA in 2008,\n" +" http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008\n" +" .\n" +"\n" +" WGS84\n" +" World Geodetic System 1984, .\n" +"\n" +" HAE Height above the WGS84 ellipsoid.\n" +"\n" +" MSL Mean sea level, used as a convenient short hand for the geoid.\n" +" (However, typically, the geoid differs by a few meters from mean\n" +" sea level.)\n" +"\n" +"EXAMPLES\n" +" The height of the EGM96 geoid at Timbuktu\n" +"\n" +" echo 16:46:33N 3:00:34W | GeoidEval\n" +" => 28.7068 -0.02e-6 -1.73e-6\n" +"\n" +" The first number returned is the height of the geoid and the 2nd and\n" +" 3rd are its slopes in the northerly and easterly directions.\n" +"\n" +" Convert a point in UTM zone 18N from MSL to HAE\n" +"\n" +" echo 531595 4468135 23 | GeoidEval --msltohae -z 18N\n" +" => 531595 4468135 -10.842\n" +"\n" +"SEE ALSO\n" +" GeoConvert(1), Gravity(1).\n" +"\n" +"AUTHOR\n" +" GeoidEval was written by Charles Karney.\n" +"\n" +"HISTORY\n" +" GeoidEval was added to GeographicLib, , in\n" +" 2009-09.\n" +; + return retval; +} diff --git a/gtsam/3rdparty/GeographicLib/man/Gravity.1 b/gtsam/3rdparty/GeographicLib/man/Gravity.1 new file mode 100644 index 000000000..97e247b7f --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/Gravity.1 @@ -0,0 +1,330 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "GRAVITY 1" +.TH GRAVITY 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +Gravity \-\- compute the earth's gravity field +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBGravity\fR [ \fB\-n\fR \fIname\fR ] [ \fB\-d\fR \fIdir\fR ] +[ \fB\-G\fR | \fB\-D\fR | \fB\-A\fR | \fB\-H\fR ] [ \fB\-c\fR \fIlat\fR \fIh\fR ] +[ \fB\-p\fR \fIprec\fR ] +[ \fB\-v\fR ] +[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] +[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] +[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] +[ \fB\-\-line\-separator\fR \fIlinesep\fR ] +[ \fB\-\-output\-file\fR \fIoutfile\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBGravity\fR reads in positions on standard input and prints out the +gravitational field on standard output. +.PP +The input line is of the form \fIlat\fR \fIlon\fR \fIh\fR. \fIlat\fR and \fIlon\fR are +the latitude and longitude expressed as decimal degrees or degrees, +minutes, and seconds; see \fIGeoConvert\fR\|(1) for details. \fIh\fR is the height +above the ellipsoid in meters; this quantity is optional and defaults to +0. Alternatively, the gravity field can be computed at various points +on a circle of latitude (constant \fIlat\fR and \fIh\fR) via the \fB\-c\fR option; +in this case only the longitude should be given on the input lines. The +quantities printed out are governed by the \fB\-G\fR (default), \fB\-D\fR, +\&\fB\-A\fR, or \fB\-H\fR options. +.PP +All the supported gravity models use \s-1WGS84\s0 as the reference ellipsoid +\&\fIa\fR = 6378137 m, \fIf\fR = 1/298.257223563, \fIomega\fR = 7292115e\-11 rad/s, +and \fI\s-1GM\s0\fR = 3986004.418e8 m^3/s^2. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-n\fR" 4 +.IX Item "-n" +use gravity field model \fIname\fR instead of the default \f(CW\*(C`egm96\*(C'\fR. See +\&\*(L"\s-1MODELS\s0\*(R". +.IP "\fB\-d\fR" 4 +.IX Item "-d" +read gravity models from \fIdir\fR instead of the default. See +\&\*(L"\s-1MODELS\s0\*(R". +.IP "\fB\-G\fR" 4 +.IX Item "-G" +compute the acceleration due to gravity (including the centrifugal +acceleration due the the earth's rotation) \fBg\fR. The output consists of +\&\fIgx\fR \fIgy\fR \fIgz\fR (all in m/s^2), where the \fIx\fR, \fIy\fR, and \fIz\fR +components are in easterly, northerly, and up directions, respectively. +Usually \fIgz\fR is negative. +.IP "\fB\-D\fR" 4 +.IX Item "-D" +compute the gravity disturbance \fBdelta\fR = \fBg\fR \- \fBgamma\fR, where +\&\fBgamma\fR is the \*(L"normal\*(R" gravity due to the reference ellipsoid . The +output consists of \fIdeltax\fR \fIdeltay\fR \fIdeltaz\fR (all in mGal, 1 mGal = +10^\-5 m/s^2), where the \fIx\fR, \fIy\fR, and \fIz\fR components are in easterly, +northerly, and up directions, respectively. Note that \fIdeltax\fR = +\&\fIgx\fR, because \fIgammax\fR = 0. +.IP "\fB\-A\fR" 4 +.IX Item "-A" +computes the gravitational anomaly. The output consists of 3 items +\&\fIDg01\fR \fIxi\fR \fIeta\fR, where \fIDg01\fR is in mGal (1 mGal = 10^\-5 m/s^2) +and \fIxi\fR and \fIeta\fR are in arcseconds. The gravitational anomaly +compares the gravitational field \fBg\fR at \fIP\fR with the normal gravity +\&\fBgamma\fR at \fIQ\fR where the \fIP\fR is vertically above \fIQ\fR and the +gravitational potential at \fIP\fR equals the normal potential at \fIQ\fR. +\&\fIDg01\fR gives the difference in the magnitudes of these two vectors and +\&\fIxi\fR and \fIeta\fR give the difference in their directions (as northerly +and easterly components). The calculation uses a spherical +approximation to match the results of the \s-1NGA\s0's synthesis programs. +.IP "\fB\-H\fR" 4 +.IX Item "-H" +compute the height of the geoid above the reference ellipsoid (in +meters). In this case, \fIh\fR should be zero. The results accurately +match the results of the \s-1NGA\s0's synthesis programs. \fIGeoidEval\fR\|(1) can +compute geoid heights much more quickly by interpolating on a grid of +precomputed results; however the results from \fIGeoidEval\fR\|(1) are only +accurate to a few millimeters. +.IP "\fB\-c\fR" 4 +.IX Item "-c" +evaluate the field on a circle of latitude given by \fIlat\fR and \fIh\fR +instead of reading these quantities from the input lines. In this case, +\&\fBGravity\fR can calculate the field considerably more quickly. If geoid +heights are being computed (the \fB\-H\fR option), then \fIh\fR must be zero. +.IP "\fB\-p\fR" 4 +.IX Item "-p" +set the output precision to \fIprec\fR. By default \fIprec\fR is 5 for +acceleration due to gravity, 3 for the gravity disturbance and anomaly, +and 4 for the geoid height. +.IP "\fB\-v\fR" 4 +.IX Item "-v" +print information about the gravity model on standard error before +processing the input. +.IP "\fB\-\-comment\-delimiter\fR" 4 +.IX Item "--comment-delimiter" +set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +print version and exit. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +print usage, the default gravity path and name, and exit. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +print full documentation and exit. +.IP "\fB\-\-input\-file\fR" 4 +.IX Item "--input-file" +read input from the file \fIinfile\fR instead of from standard input; a file +name of \*(L"\-\*(R" stands for standard input. +.IP "\fB\-\-input\-string\fR" 4 +.IX Item "--input-string" +read input from the string \fIinstring\fR instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in \fIinstring\fR are converted to newlines before the reading begins. +.IP "\fB\-\-line\-separator\fR" 4 +.IX Item "--line-separator" +set the line separator character to \fIlinesep\fR. By default this is a +semicolon. +.IP "\fB\-\-output\-file\fR" 4 +.IX Item "--output-file" +write output to the file \fIoutfile\fR instead of to standard output; a +file name of \*(L"\-\*(R" stands for standard output. +.SH "MODELS" +.IX Header "MODELS" +\&\fBGravity\fR computes the gravity field using one of the following models +.PP +.Vb 8 +\& egm84, earth gravity model 1984. See +\& http://earth\-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html +\& egm96, earth gravity model 1996. See +\& http://earth\-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html +\& egm2008, earth gravity model 2008. See +\& http://earth\-info.nga.mil/GandG/wgs84/gravitymod/egm2008 +\& wgs84, world geodetic system 1984. This returns the normal +\& gravity for the WGS84 ellipsoid. +.Ve +.PP +These models approximate the gravitation field above the surface of the +earth. By default, the \f(CW\*(C`egm96\*(C'\fR gravity model is used. This may +changed by setting the environment variable \f(CW\*(C`GRAVITY_NAME\*(C'\fR or with the +\&\fB\-n\fR option. +.PP +The gravity models will be loaded from a directory specified at compile +time. This may changed by setting the environment variables +\&\f(CW\*(C`GRAVITY_PATH\*(C'\fR or \f(CW\*(C`GEOGRAPHICLIB_DATA\*(C'\fR, or with the \fB\-d\fR option. +The \fB\-h\fR option prints the default gravity path and name. Use the +\&\fB\-v\fR option to ascertain the full path name of the data file. +.PP +Instructions for downloading and installing gravity models are +available at +. +.SH "ENVIRONMENT" +.IX Header "ENVIRONMENT" +.IP "\fB\s-1GRAVITY_NAME\s0\fR" 4 +.IX Item "GRAVITY_NAME" +Override the compile-time default gravity name of \f(CW\*(C`egm96\*(C'\fR. The \fB\-h\fR +option reports the value of \fB\s-1GRAVITY_NAME\s0\fR, if defined, otherwise it +reports the compile-time value. If the \fB\-n\fR \fIname\fR option is used, +then \fIname\fR takes precedence. +.IP "\fB\s-1GRAVITY_PATH\s0\fR" 4 +.IX Item "GRAVITY_PATH" +Override the compile-time default gravity path. This is typically +\&\f(CW\*(C`/usr/local/share/GeographicLib/gravity\*(C'\fR on Unix-like systems and +\&\f(CW\*(C`C:/Documents and Settings/All Users/Application +Data/GeographicLib/gravity\*(C'\fR on Windows systems. The \fB\-h\fR option reports +the value of \fB\s-1GRAVITY_PATH\s0\fR, if defined, otherwise it reports the +compile-time value. If the \fB\-d\fR \fIdir\fR option is used, then \fIdir\fR +takes precedence. +.IP "\fB\s-1GEOGRAPHICLIB_DATA\s0\fR" 4 +.IX Item "GEOGRAPHICLIB_DATA" +Another way of overriding the compile-time default gravity path. If it +is set (and if \fB\s-1GRAVITY_PATH\s0\fR is not set), then +$\fB\s-1GEOGRAPHICLIB_DATA\s0\fR/gravity is used. +.SH "ERRORS" +.IX Header "ERRORS" +An illegal line of input will print an error message to standard output +beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBGravity\fR to return an exit +code of 1. However, an error does not cause \fBGravity\fR to +terminate; following lines will be converted. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +The gravity field from \s-1EGM2008\s0 at the top of Mount Everest +.PP +.Vb 2 +\& echo 27:59:17N 86:55:32E 8820 | Gravity \-n egm2008 +\& => \-0.00001 0.00103 \-9.76782 +.Ve +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fIGeoConvert\fR\|(1), \fIGeoidEval\fR\|(1). +.SH "AUTHOR" +.IX Header "AUTHOR" +\&\fBGravity\fR was written by Charles Karney. +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBGravity\fR was added to GeographicLib, , +in version 1.16. diff --git a/gtsam/3rdparty/GeographicLib/man/Gravity.1.html b/gtsam/3rdparty/GeographicLib/man/Gravity.1.html new file mode 100644 index 000000000..3fbdba19b --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/Gravity.1.html @@ -0,0 +1,209 @@ + + + + + + + + + + + + + +

NAME

+ +

Gravity -- compute the earth's gravity field

+ +

SYNOPSIS

+ +

Gravity [ -n name ] [ -d dir ] [ -G | -D | -A | -H ] [ -c lat h ] [ -p prec ] [ -v ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]

+ +

DESCRIPTION

+ +

Gravity reads in positions on standard input and prints out the gravitational field on standard output.

+ +

The input line is of the form lat lon h. lat and lon are the latitude and longitude expressed as decimal degrees or degrees, minutes, and seconds; see GeoConvert(1) for details. h is the height above the ellipsoid in meters; this quantity is optional and defaults to 0. Alternatively, the gravity field can be computed at various points on a circle of latitude (constant lat and h) via the -c option; in this case only the longitude should be given on the input lines. The quantities printed out are governed by the -G (default), -D, -A, or -H options.

+ +

All the supported gravity models use WGS84 as the reference ellipsoid a = 6378137 m, f = 1/298.257223563, omega = 7292115e-11 rad/s, and GM = 3986004.418e8 m^3/s^2.

+ +

OPTIONS

+ +
+ +
-n
+
+ +

use gravity field model name instead of the default egm96. See "MODELS".

+ +
+
-d
+
+ +

read gravity models from dir instead of the default. See "MODELS".

+ +
+
-G
+
+ +

compute the acceleration due to gravity (including the centrifugal acceleration due the the earth's rotation) g. The output consists of gx gy gz (all in m/s^2), where the x, y, and z components are in easterly, northerly, and up directions, respectively. Usually gz is negative.

+ +
+
-D
+
+ +

compute the gravity disturbance delta = g - gamma, where gamma is the "normal" gravity due to the reference ellipsoid . The output consists of deltax deltay deltaz (all in mGal, 1 mGal = 10^-5 m/s^2), where the x, y, and z components are in easterly, northerly, and up directions, respectively. Note that deltax = gx, because gammax = 0.

+ +
+
-A
+
+ +

computes the gravitational anomaly. The output consists of 3 items Dg01 xi eta, where Dg01 is in mGal (1 mGal = 10^-5 m/s^2) and xi and eta are in arcseconds. The gravitational anomaly compares the gravitational field g at P with the normal gravity gamma at Q where the P is vertically above Q and the gravitational potential at P equals the normal potential at Q. Dg01 gives the difference in the magnitudes of these two vectors and xi and eta give the difference in their directions (as northerly and easterly components). The calculation uses a spherical approximation to match the results of the NGA's synthesis programs.

+ +
+
-H
+
+ +

compute the height of the geoid above the reference ellipsoid (in meters). In this case, h should be zero. The results accurately match the results of the NGA's synthesis programs. GeoidEval(1) can compute geoid heights much more quickly by interpolating on a grid of precomputed results; however the results from GeoidEval(1) are only accurate to a few millimeters.

+ +
+
-c
+
+ +

evaluate the field on a circle of latitude given by lat and h instead of reading these quantities from the input lines. In this case, Gravity can calculate the field considerably more quickly. If geoid heights are being computed (the -H option), then h must be zero.

+ +
+
-p
+
+ +

set the output precision to prec. By default prec is 5 for acceleration due to gravity, 3 for the gravity disturbance and anomaly, and 4 for the geoid height.

+ +
+
-v
+
+ +

print information about the gravity model on standard error before processing the input.

+ +
+
--comment-delimiter
+
+ +

set the comment delimiter to commentdelim (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).

+ +
+
--version
+
+ +

print version and exit.

+ +
+
-h
+
+ +

print usage, the default gravity path and name, and exit.

+ +
+
--help
+
+ +

print full documentation and exit.

+ +
+
--input-file
+
+ +

read input from the file infile instead of from standard input; a file name of "-" stands for standard input.

+ +
+
--input-string
+
+ +

read input from the string instring instead of from standard input. All occurrences of the line separator character (default is a semicolon) in instring are converted to newlines before the reading begins.

+ +
+
--line-separator
+
+ +

set the line separator character to linesep. By default this is a semicolon.

+ +
+
--output-file
+
+ +

write output to the file outfile instead of to standard output; a file name of "-" stands for standard output.

+ +
+
+ +

MODELS

+ +

Gravity computes the gravity field using one of the following models

+ +
    egm84, earth gravity model 1984.  See
+      http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html
+    egm96, earth gravity model 1996.  See
+      http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html
+    egm2008, earth gravity model 2008.  See
+      http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008
+    wgs84, world geodetic system 1984.  This returns the normal
+      gravity for the WGS84 ellipsoid.
+ +

These models approximate the gravitation field above the surface of the earth. By default, the egm96 gravity model is used. This may changed by setting the environment variable GRAVITY_NAME or with the -n option.

+ +

The gravity models will be loaded from a directory specified at compile time. This may changed by setting the environment variables GRAVITY_PATH or GEOGRAPHICLIB_DATA, or with the -d option. The -h option prints the default gravity path and name. Use the -v option to ascertain the full path name of the data file.

+ +

Instructions for downloading and installing gravity models are available at http://geographiclib.sf.net/html/gravity.html#gravityinst.

+ +

ENVIRONMENT

+ +
+ +
GRAVITY_NAME
+
+ +

Override the compile-time default gravity name of egm96. The -h option reports the value of GRAVITY_NAME, if defined, otherwise it reports the compile-time value. If the -n name option is used, then name takes precedence.

+ +
+
GRAVITY_PATH
+
+ +

Override the compile-time default gravity path. This is typically /usr/local/share/GeographicLib/gravity on Unix-like systems and C:/Documents and Settings/All Users/Application Data/GeographicLib/gravity on Windows systems. The -h option reports the value of GRAVITY_PATH, if defined, otherwise it reports the compile-time value. If the -d dir option is used, then dir takes precedence.

+ +
+
GEOGRAPHICLIB_DATA
+
+ +

Another way of overriding the compile-time default gravity path. If it is set (and if GRAVITY_PATH is not set), then $GEOGRAPHICLIB_DATA/gravity is used.

+ +
+
+ +

ERRORS

+ +

An illegal line of input will print an error message to standard output beginning with ERROR: and causes Gravity to return an exit code of 1. However, an error does not cause Gravity to terminate; following lines will be converted.

+ +

EXAMPLES

+ +

The gravity field from EGM2008 at the top of Mount Everest

+ +
    echo 27:59:17N 86:55:32E 8820 | Gravity -n egm2008
+    => -0.00001 0.00103 -9.76782
+ +

SEE ALSO

+ +

GeoConvert(1), GeoidEval(1).

+ +

AUTHOR

+ +

Gravity was written by Charles Karney.

+ +

HISTORY

+ +

Gravity was added to GeographicLib, http://geographiclib.sf.net, in version 1.16.

+ + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/man/Gravity.pod b/gtsam/3rdparty/GeographicLib/man/Gravity.pod new file mode 100644 index 000000000..90f0c8ec8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/Gravity.pod @@ -0,0 +1,232 @@ +=head1 NAME + +Gravity -- compute the earth's gravity field + +=head1 SYNOPSIS + +B [ B<-n> I ] [ B<-d> I ] +[ B<-G> | B<-D> | B<-A> | B<-H> ] [ B<-c> I I ] +[ B<-p> I ] +[ B<-v> ] +[ B<--comment-delimiter> I ] +[ B<--version> | B<-h> | B<--help> ] +[ B<--input-file> I | B<--input-string> I ] +[ B<--line-separator> I ] +[ B<--output-file> I ] + +=head1 DESCRIPTION + +B reads in positions on standard input and prints out the +gravitational field on standard output. + +The input line is of the form I I I. I and I are +the latitude and longitude expressed as decimal degrees or degrees, +minutes, and seconds; see GeoConvert(1) for details. I is the height +above the ellipsoid in meters; this quantity is optional and defaults to +0. Alternatively, the gravity field can be computed at various points +on a circle of latitude (constant I and I) via the B<-c> option; +in this case only the longitude should be given on the input lines. The +quantities printed out are governed by the B<-G> (default), B<-D>, +B<-A>, or B<-H> options. + +All the supported gravity models use WGS84 as the reference ellipsoid +I = 6378137 m, I = 1/298.257223563, I = 7292115e-11 rad/s, +and I = 3986004.418e8 m^3/s^2. + +=head1 OPTIONS + +=over + +=item B<-n> + +use gravity field model I instead of the default C. See +L. + +=item B<-d> + +read gravity models from I instead of the default. See +L. + +=item B<-G> + +compute the acceleration due to gravity (including the centrifugal +acceleration due the the earth's rotation) B. The output consists of +I I I (all in m/s^2), where the I, I, and I +components are in easterly, northerly, and up directions, respectively. +Usually I is negative. + +=item B<-D> + +compute the gravity disturbance B = B - B, where +B is the "normal" gravity due to the reference ellipsoid . The +output consists of I I I (all in mGal, 1 mGal = +10^-5 m/s^2), where the I, I, and I components are in easterly, +northerly, and up directions, respectively. Note that I = +I, because I = 0. + +=item B<-A> + +computes the gravitational anomaly. The output consists of 3 items +I I I, where I is in mGal (1 mGal = 10^-5 m/s^2) +and I and I are in arcseconds. The gravitational anomaly +compares the gravitational field B at I

with the normal gravity +B at I where the I

is vertically above I and the +gravitational potential at I

equals the normal potential at I. +I gives the difference in the magnitudes of these two vectors and +I and I give the difference in their directions (as northerly +and easterly components). The calculation uses a spherical +approximation to match the results of the NGA's synthesis programs. + +=item B<-H> + +compute the height of the geoid above the reference ellipsoid (in +meters). In this case, I should be zero. The results accurately +match the results of the NGA's synthesis programs. GeoidEval(1) can +compute geoid heights much more quickly by interpolating on a grid of +precomputed results; however the results from GeoidEval(1) are only +accurate to a few millimeters. + +=item B<-c> + +evaluate the field on a circle of latitude given by I and I +instead of reading these quantities from the input lines. In this case, +B can calculate the field considerably more quickly. If geoid +heights are being computed (the B<-H> option), then I must be zero. + +=item B<-p> + +set the output precision to I. By default I is 5 for +acceleration due to gravity, 3 for the gravity disturbance and anomaly, +and 4 for the geoid height. + +=item B<-v> + +print information about the gravity model on standard error before +processing the input. + +=item B<--comment-delimiter> + +set the comment delimiter to I (e.g., "#" or "//"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). + +=item B<--version> + +print version and exit. + +=item B<-h> + +print usage, the default gravity path and name, and exit. + +=item B<--help> + +print full documentation and exit. + +=item B<--input-file> + +read input from the file I instead of from standard input; a file +name of "-" stands for standard input. + +=item B<--input-string> + +read input from the string I instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in I are converted to newlines before the reading begins. + +=item B<--line-separator> + +set the line separator character to I. By default this is a +semicolon. + +=item B<--output-file> + +write output to the file I instead of to standard output; a +file name of "-" stands for standard output. + +=back + +=head1 MODELS + +B computes the gravity field using one of the following models + + egm84, earth gravity model 1984. See + http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html + egm96, earth gravity model 1996. See + http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html + egm2008, earth gravity model 2008. See + http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008 + wgs84, world geodetic system 1984. This returns the normal + gravity for the WGS84 ellipsoid. + +These models approximate the gravitation field above the surface of the +earth. By default, the C gravity model is used. This may +changed by setting the environment variable C or with the +B<-n> option. + +The gravity models will be loaded from a directory specified at compile +time. This may changed by setting the environment variables +C or C, or with the B<-d> option. +The B<-h> option prints the default gravity path and name. Use the +B<-v> option to ascertain the full path name of the data file. + +Instructions for downloading and installing gravity models are +available at +L. + +=head1 ENVIRONMENT + +=over + +=item B + +Override the compile-time default gravity name of C. The B<-h> +option reports the value of B, if defined, otherwise it +reports the compile-time value. If the B<-n> I option is used, +then I takes precedence. + +=item B + +Override the compile-time default gravity path. This is typically +C on Unix-like systems and +C on Windows systems. The B<-h> option reports +the value of B, if defined, otherwise it reports the +compile-time value. If the B<-d> I

option is used, then I +takes precedence. + +=item B + +Another way of overriding the compile-time default gravity path. If it +is set (and if B is not set), then +$B/gravity is used. + +=back + +=head1 ERRORS + +An illegal line of input will print an error message to standard output +beginning with C and causes B to return an exit +code of 1. However, an error does not cause B to +terminate; following lines will be converted. + +=head1 EXAMPLES + +The gravity field from EGM2008 at the top of Mount Everest + + echo 27:59:17N 86:55:32E 8820 | Gravity -n egm2008 + => -0.00001 0.00103 -9.76782 + +=head1 SEE ALSO + +GeoConvert(1), GeoidEval(1). + +=head1 AUTHOR + +B was written by Charles Karney. + +=head1 HISTORY + +B was added to GeographicLib, L, +in version 1.16. diff --git a/gtsam/3rdparty/GeographicLib/man/Gravity.usage b/gtsam/3rdparty/GeographicLib/man/Gravity.usage new file mode 100644 index 000000000..20b522307 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/Gravity.usage @@ -0,0 +1,195 @@ +int usage(int retval, bool brief) { + if (brief) + ( retval ? std::cerr : std::cout ) << "Usage:\n" +" Gravity [ -n name ] [ -d dir ] [ -G | -D | -A | -H ] [ -c lat h ] [ -p\n" +" prec ] [ -v ] [ --comment-delimiter commentdelim ] [ --version | -h |\n" +" --help ] [ --input-file infile | --input-string instring ] [\n" +" --line-separator linesep ] [ --output-file outfile ]\n" +"\n" +"For full documentation type:\n" +" Gravity --help\n" +"or visit:\n" +" http://geographiclib.sf.net/1.34/Gravity.1.html\n"; + else + ( retval ? std::cerr : std::cout ) << "Man page:\n" +"NAME\n" +" Gravity -- compute the earth's gravity field\n" +"\n" +"SYNOPSIS\n" +" Gravity [ -n name ] [ -d dir ] [ -G | -D | -A | -H ] [ -c lat h ] [ -p\n" +" prec ] [ -v ] [ --comment-delimiter commentdelim ] [ --version | -h |\n" +" --help ] [ --input-file infile | --input-string instring ] [\n" +" --line-separator linesep ] [ --output-file outfile ]\n" +"\n" +"DESCRIPTION\n" +" Gravity reads in positions on standard input and prints out the\n" +" gravitational field on standard output.\n" +"\n" +" The input line is of the form lat lon h. lat and lon are the latitude\n" +" and longitude expressed as decimal degrees or degrees, minutes, and\n" +" seconds; see GeoConvert(1) for details. h is the height above the\n" +" ellipsoid in meters; this quantity is optional and defaults to 0.\n" +" Alternatively, the gravity field can be computed at various points on a\n" +" circle of latitude (constant lat and h) via the -c option; in this case\n" +" only the longitude should be given on the input lines. The quantities\n" +" printed out are governed by the -G (default), -D, -A, or -H options.\n" +"\n" +" All the supported gravity models use WGS84 as the reference ellipsoid a\n" +" = 6378137 m, f = 1/298.257223563, omega = 7292115e-11 rad/s, and GM =\n" +" 3986004.418e8 m^3/s^2.\n" +"\n" +"OPTIONS\n" +" -n use gravity field model name instead of the default \"egm96\". See\n" +" \"MODELS\".\n" +"\n" +" -d read gravity models from dir instead of the default. See \"MODELS\".\n" +"\n" +" -G compute the acceleration due to gravity (including the centrifugal\n" +" acceleration due the the earth's rotation) g. The output consists\n" +" of gx gy gz (all in m/s^2), where the x, y, and z components are in\n" +" easterly, northerly, and up directions, respectively. Usually gz\n" +" is negative.\n" +"\n" +" -D compute the gravity disturbance delta = g - gamma, where gamma is\n" +" the \"normal\" gravity due to the reference ellipsoid . The output\n" +" consists of deltax deltay deltaz (all in mGal, 1 mGal = 10^-5\n" +" m/s^2), where the x, y, and z components are in easterly,\n" +" northerly, and up directions, respectively. Note that deltax = gx,\n" +" because gammax = 0.\n" +"\n" +" -A computes the gravitational anomaly. The output consists of 3 items\n" +" Dg01 xi eta, where Dg01 is in mGal (1 mGal = 10^-5 m/s^2) and xi\n" +" and eta are in arcseconds. The gravitational anomaly compares the\n" +" gravitational field g at P with the normal gravity gamma at Q where\n" +" the P is vertically above Q and the gravitational potential at P\n" +" equals the normal potential at Q. Dg01 gives the difference in the\n" +" magnitudes of these two vectors and xi and eta give the difference\n" +" in their directions (as northerly and easterly components). The\n" +" calculation uses a spherical approximation to match the results of\n" +" the NGA's synthesis programs.\n" +"\n" +" -H compute the height of the geoid above the reference ellipsoid (in\n" +" meters). In this case, h should be zero. The results accurately\n" +" match the results of the NGA's synthesis programs. GeoidEval(1)\n" +" can compute geoid heights much more quickly by interpolating on a\n" +" grid of precomputed results; however the results from GeoidEval(1)\n" +" are only accurate to a few millimeters.\n" +"\n" +" -c evaluate the field on a circle of latitude given by lat and h\n" +" instead of reading these quantities from the input lines. In this\n" +" case, Gravity can calculate the field considerably more quickly.\n" +" If geoid heights are being computed (the -H option), then h must be\n" +" zero.\n" +"\n" +" -p set the output precision to prec. By default prec is 5 for\n" +" acceleration due to gravity, 3 for the gravity disturbance and\n" +" anomaly, and 4 for the geoid height.\n" +"\n" +" -v print information about the gravity model on standard error before\n" +" processing the input.\n" +"\n" +" --comment-delimiter\n" +" set the comment delimiter to commentdelim (e.g., \"#\" or \"//\"). If\n" +" set, the input lines will be scanned for this delimiter and, if\n" +" found, the delimiter and the rest of the line will be removed prior\n" +" to processing and subsequently appended to the output line\n" +" (separated by a space).\n" +"\n" +" --version\n" +" print version and exit.\n" +"\n" +" -h print usage, the default gravity path and name, and exit.\n" +"\n" +" --help\n" +" print full documentation and exit.\n" +"\n" +" --input-file\n" +" read input from the file infile instead of from standard input; a\n" +" file name of \"-\" stands for standard input.\n" +"\n" +" --input-string\n" +" read input from the string instring instead of from standard input.\n" +" All occurrences of the line separator character (default is a\n" +" semicolon) in instring are converted to newlines before the reading\n" +" begins.\n" +"\n" +" --line-separator\n" +" set the line separator character to linesep. By default this is a\n" +" semicolon.\n" +"\n" +" --output-file\n" +" write output to the file outfile instead of to standard output; a\n" +" file name of \"-\" stands for standard output.\n" +"\n" +"MODELS\n" +" Gravity computes the gravity field using one of the following models\n" +"\n" +" egm84, earth gravity model 1984. See\n" +" http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/wgs84_180.html\n" +" egm96, earth gravity model 1996. See\n" +" http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/egm96.html\n" +" egm2008, earth gravity model 2008. See\n" +" http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008\n" +" wgs84, world geodetic system 1984. This returns the normal\n" +" gravity for the WGS84 ellipsoid.\n" +"\n" +" These models approximate the gravitation field above the surface of the\n" +" earth. By default, the \"egm96\" gravity model is used. This may\n" +" changed by setting the environment variable \"GRAVITY_NAME\" or with the\n" +" -n option.\n" +"\n" +" The gravity models will be loaded from a directory specified at compile\n" +" time. This may changed by setting the environment variables\n" +" \"GRAVITY_PATH\" or \"GEOGRAPHICLIB_DATA\", or with the -d option. The -h\n" +" option prints the default gravity path and name. Use the -v option to\n" +" ascertain the full path name of the data file.\n" +"\n" +" Instructions for downloading and installing gravity models are\n" +" available at\n" +" .\n" +"\n" +"ENVIRONMENT\n" +" GRAVITY_NAME\n" +" Override the compile-time default gravity name of \"egm96\". The -h\n" +" option reports the value of GRAVITY_NAME, if defined, otherwise it\n" +" reports the compile-time value. If the -n name option is used,\n" +" then name takes precedence.\n" +"\n" +" GRAVITY_PATH\n" +" Override the compile-time default gravity path. This is typically\n" +" \"/usr/local/share/GeographicLib/gravity\" on Unix-like systems and\n" +" \"C:/Documents and Settings/All Users/Application\n" +" Data/GeographicLib/gravity\" on Windows systems. The -h option\n" +" reports the value of GRAVITY_PATH, if defined, otherwise it reports\n" +" the compile-time value. If the -d dir option is used, then dir\n" +" takes precedence.\n" +"\n" +" GEOGRAPHICLIB_DATA\n" +" Another way of overriding the compile-time default gravity path.\n" +" If it is set (and if GRAVITY_PATH is not set), then\n" +" $GEOGRAPHICLIB_DATA/gravity is used.\n" +"\n" +"ERRORS\n" +" An illegal line of input will print an error message to standard output\n" +" beginning with \"ERROR:\" and causes Gravity to return an exit code of 1.\n" +" However, an error does not cause Gravity to terminate; following lines\n" +" will be converted.\n" +"\n" +"EXAMPLES\n" +" The gravity field from EGM2008 at the top of Mount Everest\n" +"\n" +" echo 27:59:17N 86:55:32E 8820 | Gravity -n egm2008\n" +" => -0.00001 0.00103 -9.76782\n" +"\n" +"SEE ALSO\n" +" GeoConvert(1), GeoidEval(1).\n" +"\n" +"AUTHOR\n" +" Gravity was written by Charles Karney.\n" +"\n" +"HISTORY\n" +" Gravity was added to GeographicLib, , in\n" +" version 1.16.\n" +; + return retval; +} diff --git a/gtsam/3rdparty/GeographicLib/man/MagneticField.1 b/gtsam/3rdparty/GeographicLib/man/MagneticField.1 new file mode 100644 index 000000000..0659f2325 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/MagneticField.1 @@ -0,0 +1,343 @@ +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.20) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "MAGNETICFIELD 1" +.TH MAGNETICFIELD 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +MagneticField \-\- compute the earth's magnetic field +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBMagneticField\fR [ \fB\-n\fR \fIname\fR ] [ \fB\-d\fR \fIdir\fR ] +[ \fB\-t\fR \fItime\fR | \fB\-c\fR \fItime\fR \fIlat\fR \fIh\fR ] +[ \fB\-r\fR ] [ \fB\-T\fR \fItguard\fR ] [ \fB\-H\fR \fIhguard\fR ] [ \fB\-p\fR \fIprec\fR ] +[ \fB\-v\fR ] +[ \fB\-\-comment\-delimiter\fR \fIcommentdelim\fR ] +[ \fB\-\-version\fR | \fB\-h\fR | \fB\-\-help\fR ] +[ \fB\-\-input\-file\fR \fIinfile\fR | \fB\-\-input\-string\fR \fIinstring\fR ] +[ \fB\-\-line\-separator\fR \fIlinesep\fR ] +[ \fB\-\-output\-file\fR \fIoutfile\fR ] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBMagneticField\fR reads in times and positions on standard input and +prints out the geomagnetic field on standard output and, optionally, its +rate of change. +.PP +The input line is of the form \fItime\fR \fIlat\fR \fIlon\fR \fIh\fR. \fItime\fR is a +date of the form 2012\-07\-03 or a fractional year such as 2012.5. \fIlat\fR +and \fIlon\fR are the latitude and longitude expressed as decimal degrees +or degrees, minutes, and seconds; see \fIGeoConvert\fR\|(1) for details. \fIh\fR +is the height above the ellipsoid in meters; this is optional and +defaults to zero. Alternatively, \fItime\fR can be given on the command +line as the argument to the \fB\-t\fR option, in which case it should not be +included on the input lines. Finally, the magnetic field can be +computed at various points on a circle of latitude (constant \fItime\fR, +\&\fIlat\fR, and \fIh\fR) via the \fB\-c\fR option; in this case only the longitude +should be given on the input lines. +.PP +The output consists of the following 7 items: +.PP +.Vb 9 +\& the declination (the direction of the horizontal component of +\& the magnetic field measured clockwise from north) in degrees, +\& the inclination (the direction of the magnetic field measured +\& down from the horizontal) in degrees, +\& the horizontal field in nanotesla (nT), +\& the north component of the field in nT, +\& the east component of the field in nT, +\& the vertical component of the field in nT (down is positive), +\& the total field in nT. +.Ve +.PP +If the \fB\-r\fR option is given, a second line is printed giving the rates +of change of these quantities in degrees/yr and nT/yr. +.PP +The \s-1WGS84\s0 ellipsoid is used, \fIa\fR = 6378137 m, \fIf\fR = 1/298.257223563. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-n\fR" 4 +.IX Item "-n" +use magnetic field model \fIname\fR instead of the default \f(CW\*(C`wmm2010\*(C'\fR. See +\&\*(L"\s-1MODELS\s0\*(R". +.IP "\fB\-d\fR" 4 +.IX Item "-d" +read magnetic models from \fIdir\fR instead of the default. See +\&\*(L"\s-1MODELS\s0\*(R". +.IP "\fB\-t\fR" 4 +.IX Item "-t" +evaluate the field at \fItime\fR instead of reading the time from the input +lines. +.IP "\fB\-c\fR" 4 +.IX Item "-c" +evaluate the field on a circle of latitude given by \fItime\fR, \fIlat\fR, +\&\fIh\fR instead of reading these quantities from the input lines. In this +case, \fBMagneticField\fR can calculate the field considerably more +quickly. +.IP "\fB\-r\fR" 4 +.IX Item "-r" +toggle whether to report the rates of change of the field. +.IP "\fB\-T\fR" 4 +.IX Item "-T" +signal an error if \fItime\fR lies \fItguard\fR years (default 50 yr) beyond +the range for the model. +.IP "\fB\-H\fR" 4 +.IX Item "-H" +signal an error if \fIh\fR lies \fIhguard\fR meters (default 500000 m) beyond +the range for the model. +.IP "\fB\-p\fR" 4 +.IX Item "-p" +set the output precision to \fIprec\fR (default 1). Fields are printed +with precision with \fIprec\fR decimal places; angles use \fIprec\fR + 1 +places. +.IP "\fB\-v\fR" 4 +.IX Item "-v" +print information about the magnetic model on standard error before +processing the input. +.IP "\fB\-\-comment\-delimiter\fR" 4 +.IX Item "--comment-delimiter" +set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If +set, the input lines will be scanned for this delimiter and, if found, +the delimiter and the rest of the line will be removed prior to +processing and subsequently appended to the output line (separated by a +space). +.IP "\fB\-\-version\fR" 4 +.IX Item "--version" +print version and exit. +.IP "\fB\-h\fR" 4 +.IX Item "-h" +print usage, the default magnetic path and name, and exit. +.IP "\fB\-\-help\fR" 4 +.IX Item "--help" +print full documentation and exit. +.IP "\fB\-\-input\-file\fR" 4 +.IX Item "--input-file" +read input from the file \fIinfile\fR instead of from standard input; a file +name of \*(L"\-\*(R" stands for standard input. +.IP "\fB\-\-input\-string\fR" 4 +.IX Item "--input-string" +read input from the string \fIinstring\fR instead of from standard input. +All occurrences of the line separator character (default is a semicolon) +in \fIinstring\fR are converted to newlines before the reading begins. +.IP "\fB\-\-line\-separator\fR" 4 +.IX Item "--line-separator" +set the line separator character to \fIlinesep\fR. By default this is a +semicolon. +.IP "\fB\-\-output\-file\fR" 4 +.IX Item "--output-file" +write output to the file \fIoutfile\fR instead of to standard output; a +file name of \*(L"\-\*(R" stands for standard output. +.SH "MODELS" +.IX Header "MODELS" +\&\fBMagneticField\fR computes the geomagnetic field using one of the +following models +.PP +.Vb 10 +\& wmm2010, the World Magnetic Model 2010, which approximates the +\& main magnetic field for the period 2010a\*^XX2015. See +\& http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml +\& igrf11, the International Geomagnetic Reference Field (11th +\& generation) which approximates the main magnetic field for +\& the period 1900a\*^XX2015. See +\& http://ngdc.noaa.gov/IAGA/vmod/igrf.html +\& emm2010, the Enhanced Magnetic Model 2010, which approximates the +\& main and crustal magnetic fields for the period 2010a\*^XX2015. See +\& http://ngdc.noaa.gov/geomag/EMM/index.html +.Ve +.PP +These models approximate the magnetic field due to the earth's core and +(in the case of emm2010) its crust. They neglect magnetic fields due to +the ionosphere, the magnetosphere, nearby magnetized materials, +electrical machinery, etc. +.PP +By default, the \f(CW\*(C`wmm2010\*(C'\fR magnetic model is used. This may changed by +setting the environment variable \f(CW\*(C`MAGNETIC_NAME\*(C'\fR or with the \fB\-n\fR +option. +.PP +The magnetic models will be loaded from a directory specified at compile +time. This may changed by setting the environment variables +\&\f(CW\*(C`MAGNETIC_PATH\*(C'\fR or \f(CW\*(C`GEOGRAPHICLIB_DATA\*(C'\fR, or with the \fB\-d\fR option. +The \fB\-h\fR option prints the default magnetic path and name. Use the +\&\fB\-v\fR option to ascertain the full path name of the data file. +.PP +Instructions for downloading and installing magnetic models are +available at +. +.SH "ENVIRONMENT" +.IX Header "ENVIRONMENT" +.IP "\fB\s-1MAGNETIC_NAME\s0\fR" 4 +.IX Item "MAGNETIC_NAME" +Override the compile-time default magnetic name of \f(CW\*(C`wmm2010\*(C'\fR. The \fB\-h\fR +option reports the value of \fB\s-1MAGNETIC_NAME\s0\fR, if defined, otherwise it +reports the compile-time value. If the \fB\-n\fR \fIname\fR option is used, +then \fIname\fR takes precedence. +.IP "\fB\s-1MAGNETIC_PATH\s0\fR" 4 +.IX Item "MAGNETIC_PATH" +Override the compile-time default magnetic path. This is typically +\&\f(CW\*(C`/usr/local/share/GeographicLib/magnetic\*(C'\fR on Unix-like systems and +\&\f(CW\*(C`C:/Documents and Settings/All Users/Application +Data/GeographicLib/magnetic\*(C'\fR on Windows systems. The \fB\-h\fR option reports +the value of \fB\s-1MAGNETIC_PATH\s0\fR, if defined, otherwise it reports the +compile-time value. If the \fB\-d\fR \fIdir\fR option is used, then \fIdir\fR +takes precedence. +.IP "\fB\s-1GEOGRAPHICLIB_DATA\s0\fR" 4 +.IX Item "GEOGRAPHICLIB_DATA" +Another way of overriding the compile-time default magnetic path. If it +is set (and if \fB\s-1MAGNETIC_PATH\s0\fR is not set), then +$\fB\s-1GEOGRAPHICLIB_DATA\s0\fR/magnetic is used. +.SH "ERRORS" +.IX Header "ERRORS" +An illegal line of input will print an error message to standard output +beginning with \f(CW\*(C`ERROR:\*(C'\fR and causes \fBMagneticField\fR to return an exit +code of 1. However, an error does not cause \fBMagneticField\fR to +terminate; following lines will be converted. If \fItime\fR or \fIh\fR are +outside the recommended ranges for the model (but inside the ranges +increase by \fItguard\fR and \fIhguard\fR), a warning is printed on standard +error and the field (which may be inaccurate) is returned in the normal +way. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +The magnetic field from \s-1WMM2010\s0 in Timbuktu on 2012\-01\-01 +.PP +.Vb 3 +\& echo 2012\-01\-01 16:46:33N 3:00:34W 300 | MagneticField \-r +\& => \-2.55 12.43 33771.0 33737.6 \-1500.5 7446.0 34582.1 +\& 0.10 \-0.07 34.3 36.8 54.4 \-35.3 25.9 +.Ve +.PP +The first two numbers returned are the declination and inclination of +the field. The second line gives the annual change. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +\&\fIGeoConvert\fR\|(1). +.SH "AUTHOR" +.IX Header "AUTHOR" +\&\fBMagneticField\fR was written by Charles Karney. +.SH "HISTORY" +.IX Header "HISTORY" +\&\fBMagneticField\fR was added to GeographicLib, +, in version 1.15. diff --git a/gtsam/3rdparty/GeographicLib/man/MagneticField.1.html b/gtsam/3rdparty/GeographicLib/man/MagneticField.1.html new file mode 100644 index 000000000..cac6794c8 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/MagneticField.1.html @@ -0,0 +1,230 @@ + + + + + + + + + + + + + +

NAME

+ +

MagneticField -- compute the earth's magnetic field

+ +

SYNOPSIS

+ +

MagneticField [ -n name ] [ -d dir ] [ -t time | -c time lat h ] [ -r ] [ -T tguard ] [ -H hguard ] [ -p prec ] [ -v ] [ --comment-delimiter commentdelim ] [ --version | -h | --help ] [ --input-file infile | --input-string instring ] [ --line-separator linesep ] [ --output-file outfile ]

+ +

DESCRIPTION

+ +

MagneticField reads in times and positions on standard input and prints out the geomagnetic field on standard output and, optionally, its rate of change.

+ +

The input line is of the form time lat lon h. time is a date of the form 2012-07-03 or a fractional year such as 2012.5. lat and lon are the latitude and longitude expressed as decimal degrees or degrees, minutes, and seconds; see GeoConvert(1) for details. h is the height above the ellipsoid in meters; this is optional and defaults to zero. Alternatively, time can be given on the command line as the argument to the -t option, in which case it should not be included on the input lines. Finally, the magnetic field can be computed at various points on a circle of latitude (constant time, lat, and h) via the -c option; in this case only the longitude should be given on the input lines.

+ +

The output consists of the following 7 items:

+ +
  the declination (the direction of the horizontal component of
+    the magnetic field measured clockwise from north) in degrees,
+  the inclination (the direction of the magnetic field measured
+    down from the horizontal) in degrees,
+  the horizontal field in nanotesla (nT),
+  the north component of the field in nT,
+  the east component of the field in nT,
+  the vertical component of the field in nT (down is positive),
+  the total field in nT.
+ +

If the -r option is given, a second line is printed giving the rates of change of these quantities in degrees/yr and nT/yr.

+ +

The WGS84 ellipsoid is used, a = 6378137 m, f = 1/298.257223563.

+ +

OPTIONS

+ +
+ +
-n
+
+ +

use magnetic field model name instead of the default wmm2010. See "MODELS".

+ +
+
-d
+
+ +

read magnetic models from dir instead of the default. See "MODELS".

+ +
+
-t
+
+ +

evaluate the field at time instead of reading the time from the input lines.

+ +
+
-c
+
+ +

evaluate the field on a circle of latitude given by time, lat, h instead of reading these quantities from the input lines. In this case, MagneticField can calculate the field considerably more quickly.

+ +
+
-r
+
+ +

toggle whether to report the rates of change of the field.

+ +
+
-T
+
+ +

signal an error if time lies tguard years (default 50 yr) beyond the range for the model.

+ +
+
-H
+
+ +

signal an error if h lies hguard meters (default 500000 m) beyond the range for the model.

+ +
+
-p
+
+ +

set the output precision to prec (default 1). Fields are printed with precision with prec decimal places; angles use prec + 1 places.

+ +
+
-v
+
+ +

print information about the magnetic model on standard error before processing the input.

+ +
+
--comment-delimiter
+
+ +

set the comment delimiter to commentdelim (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).

+ +
+
--version
+
+ +

print version and exit.

+ +
+
-h
+
+ +

print usage, the default magnetic path and name, and exit.

+ +
+
--help
+
+ +

print full documentation and exit.

+ +
+
--input-file
+
+ +

read input from the file infile instead of from standard input; a file name of "-" stands for standard input.

+ +
+
--input-string
+
+ +

read input from the string instring instead of from standard input. All occurrences of the line separator character (default is a semicolon) in instring are converted to newlines before the reading begins.

+ +
+
--line-separator
+
+ +

set the line separator character to linesep. By default this is a semicolon.

+ +
+
--output-file
+
+ +

write output to the file outfile instead of to standard output; a file name of "-" stands for standard output.

+ +
+
+ +

MODELS

+ +

MagneticField computes the geomagnetic field using one of the following models

+ +
    wmm2010, the World Magnetic Model 2010, which approximates the
+      main magnetic field for the period 2010–2015.  See
+      http://ngdc.noaa.gov/geomag/WMM/DoDWMM.shtml
+    igrf11, the International Geomagnetic Reference Field (11th
+      generation) which approximates the main magnetic field for
+      the period 1900–2015.  See
+      http://ngdc.noaa.gov/IAGA/vmod/igrf.html
+    emm2010, the Enhanced Magnetic Model 2010, which approximates the
+      main and crustal magnetic fields for the period 2010–2015.  See
+      http://ngdc.noaa.gov/geomag/EMM/index.html
+ +

These models approximate the magnetic field due to the earth's core and (in the case of emm2010) its crust. They neglect magnetic fields due to the ionosphere, the magnetosphere, nearby magnetized materials, electrical machinery, etc.

+ +

By default, the wmm2010 magnetic model is used. This may changed by setting the environment variable MAGNETIC_NAME or with the -n option.

+ +

The magnetic models will be loaded from a directory specified at compile time. This may changed by setting the environment variables MAGNETIC_PATH or GEOGRAPHICLIB_DATA, or with the -d option. The -h option prints the default magnetic path and name. Use the -v option to ascertain the full path name of the data file.

+ +

Instructions for downloading and installing magnetic models are available at http://geographiclib.sf.net/html/magnetic.html#magneticinst.

+ +

ENVIRONMENT

+ +
+ +
MAGNETIC_NAME
+
+ +

Override the compile-time default magnetic name of wmm2010. The -h option reports the value of MAGNETIC_NAME, if defined, otherwise it reports the compile-time value. If the -n name option is used, then name takes precedence.

+ +
+
MAGNETIC_PATH
+
+ +

Override the compile-time default magnetic path. This is typically /usr/local/share/GeographicLib/magnetic on Unix-like systems and C:/Documents and Settings/All Users/Application Data/GeographicLib/magnetic on Windows systems. The -h option reports the value of MAGNETIC_PATH, if defined, otherwise it reports the compile-time value. If the -d dir option is used, then dir takes precedence.

+ +
+
GEOGRAPHICLIB_DATA
+
+ +

Another way of overriding the compile-time default magnetic path. If it is set (and if MAGNETIC_PATH is not set), then $GEOGRAPHICLIB_DATA/magnetic is used.

+ +
+
+ +

ERRORS

+ +

An illegal line of input will print an error message to standard output beginning with ERROR: and causes MagneticField to return an exit code of 1. However, an error does not cause MagneticField to terminate; following lines will be converted. If time or h are outside the recommended ranges for the model (but inside the ranges increase by tguard and hguard), a warning is printed on standard error and the field (which may be inaccurate) is returned in the normal way.

+ +

EXAMPLES

+ +

The magnetic field from WMM2010 in Timbuktu on 2012-01-01

+ +
    echo 2012-01-01 16:46:33N 3:00:34W 300 | MagneticField -r
+    => -2.55 12.43 33771.0 33737.6 -1500.5 7446.0 34582.1
+       0.10 -0.07 34.3 36.8 54.4 -35.3 25.9
+ +

The first two numbers returned are the declination and inclination of the field. The second line gives the annual change.

+ +

SEE ALSO

+ +

GeoConvert(1).

+ +

AUTHOR

+ +

MagneticField was written by Charles Karney.

+ +

HISTORY

+ +

MagneticField was added to GeographicLib, http://geographiclib.sf.net, in version 1.15.

+ + + + + + + diff --git a/gtsam/3rdparty/GeographicLib/man/MagneticField.pod b/gtsam/3rdparty/GeographicLib/man/MagneticField.pod new file mode 100644 index 000000000..519e2ac51 --- /dev/null +++ b/gtsam/3rdparty/GeographicLib/man/MagneticField.pod @@ -0,0 +1,243 @@ +=head1 NAME + +MagneticField -- compute the earth's magnetic field + +=head1 SYNOPSIS + +B [ B<-n> I ] [ B<-d> I ] +[ B<-t> I
+ +
-i
+
+ +

perform an inverse geodesic calculation (see 3 above).

+ +
+
-l
+
+ +

line mode (see 2 above); generate a sequence of points along the geodesic specified by lat1 lon1 azi1.

+ +
+
-a
+
+ +

arc mode; on input and output s12 is replaced by a12 the arc length (in degrees) on the auxiliary sphere. See "AUXILIARY SPHERE".

+ +
+
-e
+
+ +

specify the ellipsoid via a f; the equatorial radius is a and the flattening is f. Setting f = 0 results in a sphere. Specify f < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By default, the WGS84 ellipsoid is used, a = 6378137 m, f = 1/298.257223563.

+ +
+
-d
+
+ +

output angles as degrees, minutes, seconds instead of decimal degrees.

+ +
+
-:
+
+ +

like -d, except use : as a separator instead of the d, ', and " delimiters.

+ +
+
-b
+
+ +

report the back azimuth at point 2 instead of the forward azimuth.

+ +
+
-f
+
+ +

full output; each line of output consists of 12 quantities: lat1 lon1 azi1 lat2 lon2 azi2 s12 a12 m12 M12 M21 S12. a12 is described in "AUXILIARY SPHERE". The four quantities m12, M12, M21, and S12 are described in "ADDITIONAL QUANTITIES".

+ +
+
-p
+
+ +

set the output precision to prec (default 3); prec is the precision relative to 1 m. See "PRECISION".

+ +
+
-E
+
+ +

use "exact" algorithms (based on elliptic integrals) for the geodesic calculations. These are more accurate than the (default) series expansions for |f| > 0.02.

+ +
+
--comment-delimiter
+
+ +

set the comment delimiter to commentdelim (e.g., "#" or "//"). If set, the input lines will be scanned for this delimiter and, if found, the delimiter and the rest of the line will be removed prior to processing and subsequently appended to the output line (separated by a space).

+ +
+
--version
+
+ +

print version and exit.

+ +
+
-h
+
+ +

print usage and exit.

+ +
+
--help
+
+ +

print full documentation and exit.

+ +
+
--input-file
+
+ +

read input from the file infile instead of from standard input; a file name of "-" stands for standard input.

+ +
+
--input-string
+
+ +

read input from the string instring instead of from standard input. All occurrences of the line separator character (default is a semicolon) in instring are converted to newlines before the reading begins.

+ +
+
--line-separator
+
+ +

set the line separator character to linesep. By default this is a semicolon.

+ +
+
--output-file
+
+ +

write output to the file outfile instead of to standard output; a file name of "-" stands for standard output.

+ +
+