X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Fboost%2Fgeometry%2Fsrs%2Fprojections%2Fimpl%2Fproj_mdist.hpp;h=9e8f0cfbe0daedd2eee70825bffa66a659aa0ffc;hb=92f5a8d42d07f9929ae4fa7e01342fe8d96808a8;hp=1c325df1c640f58b77604d6653becdaf2b31b062;hpb=a0324939f9d0e1905d5df8f57442f09dc70af83d;p=ceph.git diff --git a/ceph/src/boost/boost/geometry/srs/projections/impl/proj_mdist.hpp b/ceph/src/boost/boost/geometry/srs/projections/impl/proj_mdist.hpp index 1c325df1c..9e8f0cfbe 100644 --- a/ceph/src/boost/boost/geometry/srs/projections/impl/proj_mdist.hpp +++ b/ceph/src/boost/boost/geometry/srs/projections/impl/proj_mdist.hpp @@ -3,6 +3,10 @@ // Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands. +// This file was modified by Oracle on 2018. +// Modifications copyright (c) 2018, Oracle and/or its affiliates. +// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle + // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -36,6 +40,8 @@ #define BOOST_GEOMETRY_PROJECTIONS_PROJ_MDIST_HPP +#include +#include #include @@ -43,23 +49,23 @@ namespace boost { namespace geometry { namespace projections { namespace detail { - static const int MDIST_MAX_ITER = 20; - template - struct MDIST + struct mdist { - int nb; + static const int static_size = 20; + T es; T E; - T b[MDIST_MAX_ITER]; + T b[static_size]; + int nb; }; - template - inline bool proj_mdist_ini(CT const& es, MDIST& b) + template + inline bool proj_mdist_ini(T const& es, mdist& b) { - CT numf, numfi, twon1, denf, denfi, ens, T, twon; - CT den, El, Es; - CT E[MDIST_MAX_ITER]; + T numf, numfi, twon1, denf, denfi, ens, t, twon; + T den, El, Es; + T E[mdist::static_size]; int i, j; /* generate E(e^2) and its terms E[] */ @@ -68,12 +74,13 @@ namespace detail denf = 1.; twon = 4.; Es = El = E[0] = 1.; - for (i = 1; i < MDIST_MAX_ITER ; ++i) + for (i = 1; i < mdist::static_size ; ++i) { numf *= (twon1 * twon1); den = twon * denf * denf * twon1; - T = numf/den; - Es -= (E[i] = T * ens); + t = numf/den; + E[i] = t * ens; + Es -= E[i]; ens *= es; twon *= 4.; denf *= ++denfi; @@ -103,7 +110,7 @@ namespace detail } template - inline T proj_mdist(T const& phi, T const& sphi, T const& cphi, MDIST const& b) + inline T proj_mdist(T const& phi, T const& sphi, T const& cphi, mdist const& b) { T sc, sum, sphi2, D; int i; @@ -117,14 +124,14 @@ namespace detail } template - inline T proj_inv_mdist(T const& dist, MDIST const& b) + inline T proj_inv_mdist(T const& dist, mdist const& b) { static const T TOL = 1e-14; T s, t, phi, k; int i; k = 1./(1.- b.es); - i = MDIST_MAX_ITER; + i = mdist::static_size; phi = dist; while ( i-- ) { s = sin(phi); @@ -135,7 +142,7 @@ namespace detail return phi; } /* convergence failed */ - BOOST_THROW_EXCEPTION( projection_exception(-17) ); + BOOST_THROW_EXCEPTION( projection_exception(error_non_conv_inv_meri_dist) ); } } // namespace detail